From ac98b2a7a2753b9b4a84ec8aeb483151c53cd3d8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 13 Nov 2015 20:39:54 +0300 Subject: Show skill popups in shortcuts window. --- src/gui/widgets/itemshortcutcontainer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- cgit v1.2.3-70-g09d2