diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-13 20:39:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-13 20:39:54 +0300 |
commit | ac98b2a7a2753b9b4a84ec8aeb483151c53cd3d8 (patch) | |
tree | a376ecaf38a398ee6abc6b7491cfa2c333b63153 /src | |
parent | 80b8d209216bbe5aa61f6b9b3ad5142197abf10c (diff) | |
download | mv-ac98b2a7a2753b9b4a84ec8aeb483151c53cd3d8.tar.gz mv-ac98b2a7a2753b9b4a84ec8aeb483151c53cd3d8.tar.bz2 mv-ac98b2a7a2753b9b4a84ec8aeb483151c53cd3d8.tar.xz mv-ac98b2a7a2753b9b4a84ec8aeb483151c53cd3d8.zip |
Show skill popups in shortcuts window.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 21fe944ac..170a4f504 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -37,6 +37,7 @@ #include "gui/popups/itempopup.h" #include "gui/popups/popupmenu.h" +#include "gui/popups/skillpopup.h" #include "gui/popups/spellpopup.h" #include "gui/windows/inventorywindow.h" @@ -547,6 +548,7 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) if (itemId < SPELL_MIN_ID) { + skillPopup->setVisible(Visible_false); spellPopup->setVisible(Visible_false); Inventory *const inv = PlayerInfo::getInventory(); @@ -566,6 +568,7 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) } else if (itemId < SKILL_MIN_ID && spellManager) { + skillPopup->setVisible(Visible_false); itemPopup->setVisible(Visible_false); const TextCommand *const spell = spellManager->getSpellByItem(itemId); if (spell && viewport) @@ -581,6 +584,13 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) else if (skillDialog) { itemPopup->setVisible(Visible_false); + spellPopup->setVisible(Visible_false); + const SkillInfo *const skill = skillDialog->getSkillByItem(itemId); + if (!skill) + return; + + skillPopup->show(skill); + skillPopup->position(viewport->mMouseX, viewport->mMouseY); } } @@ -591,6 +601,8 @@ void ItemShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) itemPopup->setVisible(Visible_false); if (spellPopup) spellPopup->setVisible(Visible_false); + if (skillPopup) + skillPopup->setVisible(Visible_false); } void ItemShortcutContainer::widgetHidden(const Event &event A_UNUSED) |