summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-16 18:53:29 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-16 18:53:29 +0300
commit11f10affa92d3868a4a91d45fe4915d36e1400a9 (patch)
tree5175747a4d0deb0de27045169a5c40514bffbcd9 /src/gui
parentb9131b6330cf665831d35bdd477e2b98554dca67 (diff)
downloadmanaverse-11f10affa92d3868a4a91d45fe4915d36e1400a9.tar.gz
manaverse-11f10affa92d3868a4a91d45fe4915d36e1400a9.tar.bz2
manaverse-11f10affa92d3868a4a91d45fe4915d36e1400a9.tar.xz
manaverse-11f10affa92d3868a4a91d45fe4915d36e1400a9.zip
improve spellshortcutcontainer.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp18
-rw-r--r--src/gui/widgets/spellshortcutcontainer.h2
2 files changed, 8 insertions, 12 deletions
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index 78c3cec23..ef92ba09c 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -147,10 +147,6 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics)
}
}
- if (mSpellMoved)
- {
- // Draw the item image being dragged by the cursor.
- }
BLOCK_END("SpellShortcutContainer::draw")
}
@@ -186,14 +182,14 @@ void SpellShortcutContainer::mousePressed(gcn::MouseEvent &event)
if (index == -1)
return;
- if (event.getButton() == gcn::MouseEvent::LEFT)
+ const unsigned int eventButton = event.getButton();
+ if (eventButton == gcn::MouseEvent::LEFT)
{
- // Stores the selected item if theirs one.
}
- else if (event.getButton() == gcn::MouseEvent::RIGHT)
+ else if (eventButton == gcn::MouseEvent::RIGHT)
{
}
- else if (event.getButton() == gcn::MouseEvent::MIDDLE)
+ else if (eventButton == gcn::MouseEvent::MIDDLE)
{
if (!spellShortcut || !spellManager)
return;
@@ -216,8 +212,9 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event)
const int itemId = spellShortcut->getItem(
(mNumber * SPELL_SHORTCUT_ITEMS) + index);
+ const unsigned int eventButton = event.getButton();
- if (event.getButton() == gcn::MouseEvent::LEFT)
+ if (eventButton == gcn::MouseEvent::LEFT)
{
if (itemId < 0)
return;
@@ -250,7 +247,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event)
spellShortcut->setItemSelected(-1);
}
}
- else if (event.getButton() == gcn::MouseEvent::RIGHT)
+ else if (eventButton == gcn::MouseEvent::RIGHT)
{
TextCommand *spell = nullptr;
if (itemId >= 0)
@@ -288,7 +285,6 @@ void SpellShortcutContainer::mouseMoved(gcn::MouseEvent &event)
}
}
-// Hide SpellTooltip
void SpellShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED)
{
if (mSpellPopup)
diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h
index de1572d1a..c880a2d0c 100644
--- a/src/gui/widgets/spellshortcutcontainer.h
+++ b/src/gui/widgets/spellshortcutcontainer.h
@@ -77,7 +77,7 @@ class SpellShortcutContainer final : public ShortcutContainer
void mouseMoved(gcn::MouseEvent &event) override;
- void setWidget2(const Widget2 *const widget);
+ void setWidget2(const Widget2 *const widget) override;
private:
TextCommand *mSpellMoved;