From 617feef91574c9ad6dc6dcddf910566f394c9981 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Sep 2014 12:43:27 +0300 Subject: Enable skill use button based on skill type. --- src/gui/windows/skilldialog.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/gui/windows') diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 5b70f685b..8784ded34 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -125,17 +125,8 @@ void SkillDialog::action(const ActionEvent &event) { if (const SkillInfo *const info = tab->getSelectedInfo()) { - if (info && info->data && info->useButton.empty() - && info->data->description.empty()) - { - mUseButton->setEnabled(true); - mUseButton->setCaption(_("Use")); - } - else - { - mUseButton->setEnabled(info->range > 0); - mUseButton->setCaption(info->useButton); - } + mUseButton->setEnabled(info->isUsable()); + mUseButton->setCaption(info->useButton); mIncreaseButton->setEnabled(info->id < SKILL_VAR_MIN_ID); const int num = itemShortcutWindow->getTabIndex(); if (num >= 0 && num < static_cast(SHORTCUT_TABS) @@ -397,7 +388,7 @@ void SkillDialog::addSkill(const int id, skill->skillLevel = strprintf(_("Lvl: %d"), level); skill->range = range; skill->update(); - + skill->useButton = _("Use"); mDefaultModel->addSkill(skill); mSkills[id] = skill; -- cgit v1.2.3-70-g09d2