diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-31 00:19:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-31 00:19:18 +0300 |
commit | 694e07d193e7c5758a7d672b45668651b034003d (patch) | |
tree | 20a4aec8dee2b3b5475db9f3667e797fb43c603b /src/gui/windows/inventorywindow.cpp | |
parent | c9a84749b3b71d4df6cc3b9b488d60dc4a013a20 (diff) | |
download | ManaVerse-694e07d193e7c5758a7d672b45668651b034003d.tar.gz ManaVerse-694e07d193e7c5758a7d672b45668651b034003d.tar.bz2 ManaVerse-694e07d193e7c5758a7d672b45668651b034003d.tar.xz ManaVerse-694e07d193e7c5758a7d672b45668651b034003d.zip |
Convert InputAction enum into strong typed enum.
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 17 |
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; } |