diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/skilldialog.cpp | 23 | ||||
-rw-r--r-- | src/gui/skilldialog.h | 4 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 9f484de8d..97e2fbdf1 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -264,7 +264,7 @@ SkillDialog::SkillDialog() : SkillDialog::~SkillDialog() { // Clear gui - loadSkills(""); + clearSkills(); } void SkillDialog::action(const gcn::ActionEvent &event) @@ -358,18 +358,20 @@ void SkillDialog::update() } } -void SkillDialog::loadSkills(const std::string &file) +void SkillDialog::clearSkills() { mTabs->removeAll(); - delete_all(mSkills); mSkills.clear(); +} - if (file.length() == 0) - return; +void SkillDialog::loadSkills() +{ + clearSkills(); - XML::Document doc(file); - const XmlNodePtr root = doc.rootNode(); + XML::Document doc("ea-skills.xml"); + XML::Document doc2("skills.xml"); + XmlNodePtr root = doc.rootNode(); int setCount = 0; std::string setName; @@ -378,10 +380,15 @@ void SkillDialog::loadSkills(const std::string &file) SkillTab *tab; if (!root || !xmlNameEqual(root, "skills")) + root = doc2.rootNode(); + + if (!root || !xmlNameEqual(root, "skills")) { - logger->log("Error loading skills file: %s", file.c_str()); + logger->log("Error loading skills"); +#ifdef MANASERV_SUPPORT if (Net::getNetworkType() != ServerInfo::MANASERV) +#endif { SkillModel *const model = new SkillModel(); if (!mDefaultModel) diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index 9e956703a..945ae318d 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -108,7 +108,9 @@ class SkillDialog final : public Window, public gcn::ActionListener */ void update(); - void loadSkills(const std::string &file); + void clearSkills(); + + void loadSkills(); bool updateSkill(const int id, const int range, const bool modifiable); |