diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-26 15:54:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-26 15:54:29 +0300 |
commit | b462762ae88e52ba18a0610c62a9dda6ac89d32d (patch) | |
tree | dc5d865703fd06b7c9bdc218f74301eec4cf77e0 /src/gui/skilldialog.cpp | |
parent | 5190fe2cdac7c259d96619e4686f8543bdc96af4 (diff) | |
download | manaverse-b462762ae88e52ba18a0610c62a9dda6ac89d32d.tar.gz manaverse-b462762ae88e52ba18a0610c62a9dda6ac89d32d.tar.bz2 manaverse-b462762ae88e52ba18a0610c62a9dda6ac89d32d.tar.xz manaverse-b462762ae88e52ba18a0610c62a9dda6ac89d32d.zip |
Split skills and stats.
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index b0e3d8e91..39be5eea7 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -662,7 +662,7 @@ void SkillDialog::updateQuest(const int var, const int val) SkillInfo *const info = it->second; if (info) { - PlayerInfo::setStatBase(id, val); + PlayerInfo::setSkillLevel(id, val); info->level = val; info->update(); } @@ -699,11 +699,10 @@ SkillInfo::~SkillInfo() void SkillInfo::update() { - const int baseLevel = PlayerInfo::getStatBase(id); - const int effLevel = PlayerInfo::getStatEffective(id); + const int baseLevel = PlayerInfo::getSkillLevel(id); const std::pair<int, int> exp = PlayerInfo::getStatExperience(id); - if (!modifiable && baseLevel == 0 && effLevel == 0 && exp.second == 0) + if (!modifiable && baseLevel == 0 && exp.second == 0) { if (visible) { @@ -717,18 +716,11 @@ void SkillInfo::update() const bool updateVisibility = !visible; visible = true; - if (effLevel != baseLevel) - { - skillLevel = strprintf(_("Lvl: %d (%+d)"), baseLevel, - effLevel - baseLevel); - } + if (baseLevel == 0) + skillLevel.clear(); else - { - if (baseLevel == 0) - skillLevel.clear(); - else - skillLevel = strprintf(_("Lvl: %d"), baseLevel); - } + skillLevel = strprintf(_("Lvl: %d"), baseLevel); + level = baseLevel; skillLevelWidth = -1; |