summaryrefslogtreecommitdiff
path: root/src/gui/windows/inventorywindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
commit694e07d193e7c5758a7d672b45668651b034003d (patch)
tree20a4aec8dee2b3b5475db9f3667e797fb43c603b /src/gui/windows/inventorywindow.cpp
parentc9a84749b3b71d4df6cc3b9b488d60dc4a013a20 (diff)
downloadplus-694e07d193e7c5758a7d672b45668651b034003d.tar.gz
plus-694e07d193e7c5758a7d672b45668651b034003d.tar.bz2
plus-694e07d193e7c5758a7d672b45668651b034003d.tar.xz
plus-694e07d193e7c5758a7d672b45668651b034003d.zip
Convert InputAction enum into strong typed enum.
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r--src/gui/windows/inventorywindow.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index ed3742c9b..c5934b7ba 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -491,8 +491,7 @@ void InventoryWindow::action(const ActionEvent &event)
if (PlayerInfo::isItemProtected(item->getId()))
return;
- if (inputManager.isActionActive(static_cast<int>(
- InputAction::STOP_ATTACK)))
+ if (inputManager.isActionActive(InputAction::STOP_ATTACK))
{
PlayerInfo::dropItem(item, item->getQuantity(), Sfx_true);
}
@@ -551,12 +550,12 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
if (clicks == 2 && gui)
gui->resetClickCount();
- const bool mod = (isStorageActive() && inputManager.isActionActive(
- static_cast<int>(InputAction::STOP_ATTACK)));
+ const bool mod = (isStorageActive() &&
+ inputManager.isActionActive(InputAction::STOP_ATTACK));
- const bool mod2 = (tradeWindow && tradeWindow->isWindowVisible()
- && inputManager.isActionActive(static_cast<int>(
- InputAction::STOP_ATTACK)));
+ const bool mod2 = (tradeWindow &&
+ tradeWindow->isWindowVisible() &&
+ inputManager.isActionActive(InputAction::STOP_ATTACK));
if (!mod && !mod2 && event.getButton() == MouseButton::RIGHT)
{
@@ -707,13 +706,13 @@ void InventoryWindow::mouseExited(MouseEvent &event A_UNUSED)
void InventoryWindow::keyPressed(KeyEvent &event)
{
- if (event.getActionId() == static_cast<int>(InputAction::GUI_MOD))
+ if (event.getActionId() == InputAction::GUI_MOD)
mSplit = true;
}
void InventoryWindow::keyReleased(KeyEvent &event)
{
- if (event.getActionId() == static_cast<int>(InputAction::GUI_MOD))
+ if (event.getActionId() == InputAction::GUI_MOD)
mSplit = false;
}