diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-16 16:18:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-16 16:18:29 +0300 |
commit | c94a736ddcf5299b6eacb9cfd5c09c6266dd78aa (patch) | |
tree | 356f87aac5b794fa4e0903a15ec83f55f52f7b00 /src/gui/windows/inventorywindow.cpp | |
parent | e811e48760c7f9a22615f40a0b025d34b9f12eb0 (diff) | |
download | mv-c94a736ddcf5299b6eacb9cfd5c09c6266dd78aa.tar.gz mv-c94a736ddcf5299b6eacb9cfd5c09c6266dd78aa.tar.bz2 mv-c94a736ddcf5299b6eacb9cfd5c09c6266dd78aa.tar.xz mv-c94a736ddcf5299b6eacb9cfd5c09c6266dd78aa.zip |
Move itemamountwindowusage enum into separate file.
Also convert it to strong typed enum.
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index db256b4a1..be38f70ac 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -441,13 +441,13 @@ void InventoryWindow::action(const ActionEvent &event) if (storageWindow) { - ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::StoreAdd, this, item); } #ifdef EATHENA_SUPPORT else if (cartWindow && cartWindow->isWindowVisible()) { - ItemAmountWindow::showWindow(ItemAmountWindow::CartAdd, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::CartAdd, this, item); } #endif @@ -512,27 +512,28 @@ void InventoryWindow::action(const ActionEvent &event) } else { - ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::ItemDrop, this, item); } } } else if (eventId == "split") { - ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::ItemSplit, + this, item, (item->getQuantity() - 1)); } else if (eventId == "retrieve") { if (storageWindow) { - ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::StoreRemove, this, item); } #ifdef EATHENA_SUPPORT else if (cartWindow && cartWindow->isWindowVisible()) { - ItemAmountWindow::showWindow(ItemAmountWindow::CartRemove, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::CartRemove, this, item); } #endif @@ -615,7 +616,8 @@ void InventoryWindow::mouseClicked(MouseEvent &event) { if (event.getButton() == MouseButton::RIGHT) { - ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, + ItemAmountWindow::showWindow( + ItemAmountWindowUsage::StoreAdd, inventoryWindow, item); } @@ -631,8 +633,10 @@ void InventoryWindow::mouseClicked(MouseEvent &event) { if (event.getButton() == MouseButton::RIGHT) { - ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, - inventoryWindow, item); + ItemAmountWindow::showWindow( + ItemAmountWindowUsage::StoreRemove, + inventoryWindow, + item); } else { @@ -649,7 +653,7 @@ void InventoryWindow::mouseClicked(MouseEvent &event) return; if (event.getButton() == MouseButton::RIGHT) { - ItemAmountWindow::showWindow(ItemAmountWindow::TradeAdd, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::TradeAdd, tradeWindow, item); } else @@ -664,14 +668,16 @@ void InventoryWindow::mouseClicked(MouseEvent &event) { if (isStorageActive()) { - ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, + ItemAmountWindow::showWindow( + ItemAmountWindowUsage::StoreAdd, inventoryWindow, item); } else if (tradeWindow && tradeWindow->isWindowVisible()) { if (PlayerInfo::isItemProtected(item->getId())) return; - ItemAmountWindow::showWindow(ItemAmountWindow::TradeAdd, + ItemAmountWindow::showWindow( + ItemAmountWindowUsage::TradeAdd, tradeWindow, item); } else @@ -683,7 +689,8 @@ void InventoryWindow::mouseClicked(MouseEvent &event) { if (isStorageActive()) { - ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, + ItemAmountWindow::showWindow( + ItemAmountWindowUsage::StoreRemove, inventoryWindow, item); } } @@ -754,7 +761,7 @@ void InventoryWindow::valueChanged(const SelectionEvent &event A_UNUSED) if (mSplit && item && inventoryHandler-> canSplit(mItems->getSelectedItem())) { - ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::ItemSplit, this, item, item->getQuantity() - 1); } updateButtons(item); @@ -1085,7 +1092,7 @@ void InventoryWindow::moveItemToCraft(const int craftSlot) if (item->getQuantity() > 1 && !inputManager.isActionActive(InputAction::STOP_ATTACK)) { - ItemAmountWindow::showWindow(ItemAmountWindow::CraftAdd, + ItemAmountWindow::showWindow(ItemAmountWindowUsage::CraftAdd, npcHandler->getCurrentNpcDialog(), item, 0, |