summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/skilldialog.cpp18
-rw-r--r--src/gui/skilldialog.h2
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp8
3 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index a930d3929..6008e97b0 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -216,6 +216,12 @@ public:
return nullptr;
}
+ void setCurrent()
+ {
+ if (skillDialog)
+ skillDialog->updateTabSelection();
+ }
+
private:
SkillListBox *mListBox;
};
@@ -656,3 +662,15 @@ void SkillDialog::useItem(int itemId)
}
}
}
+
+void SkillDialog::updateTabSelection()
+{
+ SkillTab *tab = static_cast<SkillTab*>(mTabs->getSelectedTab());
+ if (tab)
+ {
+ if (SkillInfo *info = tab->getSelectedInfo())
+ mUseButton->setEnabled(info->range > 0);
+ else
+ mUseButton->setEnabled(false);
+ }
+}
diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h
index 58c4bc42a..7fc09d5a6 100644
--- a/src/gui/skilldialog.h
+++ b/src/gui/skilldialog.h
@@ -119,6 +119,8 @@ class SkillDialog : public Window, public gcn::ActionListener
void useItem(int itemId);
+ void updateTabSelection();
+
private:
typedef std::map<int, SkillInfo*> SkillMap;
SkillMap mSkills;
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index 1c15ccf2b..381e3102d 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -191,6 +191,14 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics)
SkillInfo *skill = skillDialog->getSkill(itemId - SKILL_MIN_ID);
if (skill)
{
+ Image* image = skill->icon;
+
+ if (image)
+ {
+ image->setAlpha(1.0f);
+ g->drawImage(image, itemX, itemY);
+ }
+
g->drawText(skill->shortName, itemX + 2,
itemY + mBoxHeight / 2, gcn::Graphics::LEFT);
}