diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-16 18:53:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-16 18:53:29 +0300 |
commit | 11f10affa92d3868a4a91d45fe4915d36e1400a9 (patch) | |
tree | 5175747a4d0deb0de27045169a5c40514bffbcd9 /src/gui/widgets/spellshortcutcontainer.cpp | |
parent | b9131b6330cf665831d35bdd477e2b98554dca67 (diff) | |
download | plus-11f10affa92d3868a4a91d45fe4915d36e1400a9.tar.gz plus-11f10affa92d3868a4a91d45fe4915d36e1400a9.tar.bz2 plus-11f10affa92d3868a4a91d45fe4915d36e1400a9.tar.xz plus-11f10affa92d3868a4a91d45fe4915d36e1400a9.zip |
improve spellshortcutcontainer.
Diffstat (limited to 'src/gui/widgets/spellshortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.cpp | 18 |
1 files changed, 7 insertions, 11 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) |