diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-12-13 22:41:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-12-13 23:52:39 +0300 |
commit | 12429b0c526195fca2f9e99e49f94821271b76e8 (patch) | |
tree | 1bf8345c791f80170de13dce82c40f727da1c9de /src/gui | |
parent | f5c40ef7c84f9d5914550b5781bad01ba63676dd (diff) | |
download | manaverse-12429b0c526195fca2f9e99e49f94821271b76e8.tar.gz manaverse-12429b0c526195fca2f9e99e49f94821271b76e8.tar.bz2 manaverse-12429b0c526195fca2f9e99e49f94821271b76e8.tar.xz manaverse-12429b0c526195fca2f9e99e49f94821271b76e8.zip |
Add support for possible new skill set types.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 7e474a982..cfcf60b1b 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -31,6 +31,8 @@ #include "const/resources/spriteaction.h" +#include "enums/resources/skill/skillsettype.h" + #include "gui/shortcut/itemshortcut.h" #include "gui/windows/setupwindow.h" @@ -318,6 +320,14 @@ void SkillDialog::loadXmlFile(const std::string &fileName, // TRANSLATORS: skills dialog default skill tab strprintf(_("Skill Set %d"), setCount)); + const std::string setTypeStr = XML::getProperty(set, "type", ""); + SkillSetTypeT setType = SkillSetType::VerticalList; + if (setTypeStr == "list" || + setTypeStr == "vertical") + { + setType = SkillSetType::VerticalList; + } + SkillModel *const model = new SkillModel; if (!mDefaultModel) mDefaultModel = model; @@ -340,20 +350,31 @@ void SkillDialog::loadXmlFile(const std::string &fileName, model->updateVisibilities(); - // possible leak listbox, scroll - SkillListBox *const listbox = new SkillListBox(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); + switch (setType) + { + case SkillSetType::VerticalList: + { + // possible leak listbox, scroll + SkillListBox *const listbox = new SkillListBox(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; + } + case SkillSetType::Rectangle: + default: + reportAlways("Unsupported skillset type: %s", + setTypeStr.c_str()); + break; + } } } } |