From 694e07d193e7c5758a7d672b45668651b034003d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 31 May 2015 00:19:18 +0300 Subject: Convert InputAction enum into strong typed enum. --- src/gui/windows/inventorywindow.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/gui/windows/inventorywindow.cpp') 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( - 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(InputAction::STOP_ATTACK))); + const bool mod = (isStorageActive() && + inputManager.isActionActive(InputAction::STOP_ATTACK)); - const bool mod2 = (tradeWindow && tradeWindow->isWindowVisible() - && inputManager.isActionActive(static_cast( - 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(InputAction::GUI_MOD)) + if (event.getActionId() == InputAction::GUI_MOD) mSplit = true; } void InventoryWindow::keyReleased(KeyEvent &event) { - if (event.getActionId() == static_cast(InputAction::GUI_MOD)) + if (event.getActionId() == InputAction::GUI_MOD) mSplit = false; } -- cgit v1.2.3-60-g2f50