diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-03-20 23:19:53 +0200 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-20 18:25:55 -0600 |
commit | 792288922ab403c1912858a992e9347b5928dcea (patch) | |
tree | 3dfa7e4d14dc292c93898276406d05290396e131 /src/gui/skilldialog.cpp | |
parent | 45462abc131d58f0a92bf3ccb70b0004d437ac5a (diff) | |
download | mana-792288922ab403c1912858a992e9347b5928dcea.tar.gz mana-792288922ab403c1912858a992e9347b5928dcea.tar.bz2 mana-792288922ab403c1912858a992e9347b5928dcea.tar.xz mana-792288922ab403c1912858a992e9347b5928dcea.zip |
Fix base skill in old servers.
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index da244208..943bda3a 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -295,18 +295,48 @@ void SkillDialog::loadSkills(const std::string &file) XML::Document doc(file); xmlNodePtr root = doc.rootNode(); - if (!root || !xmlStrEqual(root->name, BAD_CAST "skills")) - { - logger->log("Error loading skills file: %s", file.c_str()); - return; - } - int setCount = 0; std::string setName; ScrollArea *scroll; SkillListBox *listbox; SkillTab *tab; + if (!root || !xmlStrEqual(root->name, BAD_CAST "skills")) + { + logger->log("Error loading skills file: %s", file.c_str()); + + if (Net::getNetworkType() == ServerInfo::EATHENA) + { + SkillModel *model = new SkillModel(); + SkillInfo *skill = new SkillInfo; + skill->id = 1; + skill->name = "basic"; + skill->setIcon(""); + skill->modifiable = true; + skill->visible = true; + skill->model = model; + skill->update(); + + model->addSkill(skill); + mSkills[1] = skill; + + model->updateVisibilities(); + + listbox = new SkillListBox(model); + scroll = new ScrollArea(listbox); + scroll->setOpaque(false); + scroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); + scroll->setVerticalScrollPolicy(ScrollArea::SHOW_ALWAYS); + + tab = new SkillTab("Skills", listbox); + + mTabs->addTab(tab, scroll); + + update(); + } + return; + } + for_each_xml_child_node(set, root) { if (xmlStrEqual(set->name, BAD_CAST "set")) |