diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-10 02:16:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-10 02:25:10 +0300 |
commit | 9b80af87b10412a9732001979b76575b49ad4552 (patch) | |
tree | 8025958dad51a20c9b2ea371085df59cf3e6d21d /src/gui/skilldialog.cpp | |
parent | efad6f00faf25eb0ec84bb8539c5fbe9698e09e0 (diff) | |
download | manaverse-9b80af87b10412a9732001979b76575b49ad4552.tar.gz manaverse-9b80af87b10412a9732001979b76575b49ad4552.tar.bz2 manaverse-9b80af87b10412a9732001979b76575b49ad4552.tar.xz manaverse-9b80af87b10412a9732001979b76575b49ad4552.zip |
Add skill range parameter to skills.
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 430705b1d..3cd3c7a16 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -79,11 +79,12 @@ struct SkillInfo std::string skillExp; float progress; gcn::Color color; + int range; SkillInfo() : id(0), name(""), dispName(""), icon(nullptr), modifiable(false), visible(false), model(nullptr), skillLevel(""), skillLevelWidth(0), - skillExp(""), progress(0.0f) + skillExp(""), progress(0.0f), range(0) { } @@ -467,7 +468,7 @@ void SkillDialog::loadSkills(const std::string &file) update(); } -bool SkillDialog::setModifiable(int id, bool modifiable) +bool SkillDialog::updateSkill(int id, int range, bool modifiable) { SkillMap::const_iterator it = mSkills.find(id); @@ -477,6 +478,7 @@ bool SkillDialog::setModifiable(int id, bool modifiable) if (info) { info->modifiable = modifiable; + info->range = range; info->update(); } return true; @@ -484,7 +486,7 @@ bool SkillDialog::setModifiable(int id, bool modifiable) return false; } -void SkillDialog::addSkill(int id, int level, bool modifiable) +void SkillDialog::addSkill(int id, int level, int range, bool modifiable) { if (mDefaultModel) { @@ -497,6 +499,7 @@ void SkillDialog::addSkill(int id, int level, bool modifiable) skill->visible = false; skill->model = mDefaultModel; skill->skillLevel = strprintf(_("Lvl: %d"), level); + skill->range = range; skill->update(); mDefaultModel->addSkill(skill); |