summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-15 20:27:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-15 20:34:56 +0300
commitdb3b43538aae3ce9762de81295bc24f8eb53f016 (patch)
tree66908cfca7ae32305f6bcbe879c03161d83a8910 /src/gui/windows
parent12429b0c526195fca2f9e99e49f94821271b76e8 (diff)
downloadmanaplus-db3b43538aae3ce9762de81295bc24f8eb53f016.tar.gz
manaplus-db3b43538aae3ce9762de81295bc24f8eb53f016.tar.bz2
manaplus-db3b43538aae3ce9762de81295bc24f8eb53f016.tar.xz
manaplus-db3b43538aae3ce9762de81295bc24f8eb53f016.zip
Add support for rectangular skills tabs.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/skilldialog.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index cfcf60b1b..f1c81e0bb 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -322,11 +322,16 @@ void SkillDialog::loadXmlFile(const std::string &fileName,
const std::string setTypeStr = XML::getProperty(set, "type", "");
SkillSetTypeT setType = SkillSetType::VerticalList;
- if (setTypeStr == "list" ||
+ if (setTypeStr == "" ||
+ setTypeStr == "list" ||
setTypeStr == "vertical")
{
setType = SkillSetType::VerticalList;
}
+ else if (setTypeStr == "rectangle")
+ {
+ setType = SkillSetType::Rectangle;
+ }
SkillModel *const model = new SkillModel;
if (!mDefaultModel)
@@ -370,6 +375,22 @@ void SkillDialog::loadXmlFile(const std::string &fileName,
break;
}
case SkillSetType::Rectangle:
+ {
+ SkillRectangleListBox *const listbox =
+ new SkillRectangleListBox(this,
+ model);
+ listbox->setActionEventId("sel");
+ listbox->addActionListener(this);
+ ScrollArea *const scroll = new ScrollArea(this,
+ listbox,
+ Opaque_false);
+ scroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
+ scroll->setVerticalScrollPolicy(ScrollArea::SHOW_ALWAYS);
+ SkillTab *const tab = new SkillTab(this, setName, listbox);
+ mDeleteTabs.push_back(tab);
+ mTabs->addTab(tab, scroll);
+ break;
+ }
default:
reportAlways("Unsupported skillset type: %s",
setTypeStr.c_str());
@@ -422,6 +443,10 @@ SkillInfo *SkillDialog::loadSkill(XmlNodePtr node,
"castingWaterAction", SpriteAction::CASTWATER);
skill->useTextParameter = XML::getBoolProperty(
node, "useTextParameter", false);
+ skill->x = XML::getProperty(node,
+ "x", 0);
+ skill->y = XML::getProperty(node,
+ "y", 0);
skill->visible = skill->alwaysVisible;
model->addSkill(skill);
mSkills[id] = skill;