diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 20 | ||||
-rw-r--r-- | src/gui/windows/skilldialog.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 291836f48..a18ab3b3e 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -130,6 +130,24 @@ SkillDialog::~SkillDialog() clearSkills(); } +void SkillDialog::addDefaultTab() +{ + mDefaultModel = new SkillModel; + SkillListBox *const listbox = new SkillListBox(this, + mDefaultModel); + 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); + // TRANSLATORS: unknown skills tab name + mDefaultTab = new SkillTab(this, _("Unknown"), listbox); + mDeleteTabs.push_back(mDefaultTab); + mTabs->addTab(mDefaultTab, scroll); +} + void SkillDialog::action(const ActionEvent &event) { const std::string &eventId = event.getId(); @@ -256,6 +274,7 @@ void SkillDialog::clearSkills() { mTabs->removeAll(); mDeleteTabs.clear(); + mDefaultTab = nullptr; mDefaultModel = nullptr; delete_all(mSkills); @@ -285,6 +304,7 @@ void SkillDialog::loadSkills() loadXmlFile(paths.getStringValue("skillsFile2"), SkipError_false); loadXmlFile(paths.getStringValue("skillsPatchFile"), SkipError_true); loadXmlDir("skillsPatchDir", loadXmlFile); + addDefaultTab(); update(); } diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h index 5a28d5a74..347e45a36 100644 --- a/src/gui/windows/skilldialog.h +++ b/src/gui/windows/skilldialog.h @@ -215,6 +215,8 @@ class SkillDialog final : public Window, void loadSkillData(XmlNodePtr node, SkillInfo *const skill); + void addDefaultTab(); + typedef std::map<int, SkillInfo*> SkillMap; SkillMap mSkills; std::vector<SkillInfo*> mDurations; |