diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-05 20:58:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-05 20:58:21 +0300 |
commit | a87db81b6b7551a248e31e2850577aefda092538 (patch) | |
tree | f47c20512183113face758cf58ec71369c82806c /src/gui/windows | |
parent | 92c019dad798f1a84c5d3e8e8331a885f6458133 (diff) | |
download | manaverse-a87db81b6b7551a248e31e2850577aefda092538.tar.gz manaverse-a87db81b6b7551a248e31e2850577aefda092538.tar.bz2 manaverse-a87db81b6b7551a248e31e2850577aefda092538.tar.xz manaverse-a87db81b6b7551a248e31e2850577aefda092538.zip |
Replace most bools usage in playerinfo to strong typed bools.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/windows/itemamountwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/outfitwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/shopwindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/windows/tradewindow.cpp | 2 |
6 files changed, 17 insertions, 15 deletions
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index cc2d34991..44cb01bc1 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -292,7 +292,7 @@ void EquipmentWindow::action(const ActionEvent &event) return; const Item *const item = mEquipment->getEquipment(mSelected); - PlayerInfo::unequipItem(item, true); + PlayerInfo::unequipItem(item, Sfx_true); setSelected(-1); } else if (!eventId.find("tab_")) @@ -325,7 +325,7 @@ void EquipmentWindow::action(const ActionEvent &event) if (item->isEquipment() == Equipm_true) { if (item->isEquipped() == Equipped_false) - PlayerInfo::equipItem(item, true); + PlayerInfo::equipItem(item, Sfx_true); } } } @@ -469,7 +469,7 @@ void EquipmentWindow::mouseReleased(MouseEvent &event) if (item->isEquipment() == Equipm_true) { if (item->isEquipped() == Equipped_false) - PlayerInfo::equipItem(item, true); + PlayerInfo::equipItem(item, Sfx_true); } } else if (dragDrop.getSource() == DRAGDROP_SOURCE_EQUIPMENT) @@ -493,7 +493,7 @@ void EquipmentWindow::mouseReleased(MouseEvent &event) } if (item->isEquipped() == Equipped_true) - PlayerInfo::unequipItem(item, true); + PlayerInfo::unequipItem(item, Sfx_true); } } dragDrop.clear(); diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 65e89bbb3..c87fe3ebc 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -461,11 +461,11 @@ void InventoryWindow::action(const ActionEvent &event) if (eventId == "use") { - PlayerInfo::useEquipItem(item, true); + PlayerInfo::useEquipItem(item, Sfx_true); } if (eventId == "equip") { - PlayerInfo::useEquipItem2(item, true); + PlayerInfo::useEquipItem2(item, Sfx_true); } else if (eventId == "drop") { @@ -491,7 +491,7 @@ void InventoryWindow::action(const ActionEvent &event) if (inputManager.isActionActive(static_cast<int>( InputAction::STOP_ATTACK))) { - PlayerInfo::dropItem(item, item->getQuantity(), true); + PlayerInfo::dropItem(item, item->getQuantity(), Sfx_true); } else { @@ -647,7 +647,7 @@ void InventoryWindow::mouseClicked(MouseEvent &event) } else { - PlayerInfo::useEquipItem(item, true); + PlayerInfo::useEquipItem(item, Sfx_true); } } else diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 2c6280ca7..c3eb60b89 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -65,7 +65,7 @@ void ItemAmountWindow::finish(const Item *const item, tradeWindow->tradeItem(item, amount); break; case ItemDrop: - PlayerInfo::dropItem(item, amount, true); + PlayerInfo::dropItem(item, amount, Sfx_true); break; case ItemSplit: inventoryHandler->splitItem(item, amount); diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 7080ee133..896136bb3 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -282,7 +282,7 @@ void OutfitWindow::wearOutfit(const int outfit, const bool unwearEmpty, { if (item->isEquipment() == Equipm_true) { - PlayerInfo::equipItem(item, false); + PlayerInfo::equipItem(item, Sfx_false); isEmpty = false; } } @@ -525,7 +525,7 @@ void OutfitWindow::unequipNotInOutfit(const int outfit) const } } if (!found) - PlayerInfo::unequipItem(item, false); + PlayerInfo::unequipItem(item, Sfx_false); } } } diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 529b8131e..ca82c03c1 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -865,9 +865,11 @@ void ShopWindow::showList(const std::string &nick, std::string data) void ShopWindow::processRequest(const std::string &nick, std::string data, const int mode) { - if (!localPlayer || !mTradeNick.empty() || PlayerInfo::isTrading() - || !actorManager - || !actorManager->findBeingByName(nick, ActorType::Player)) + if (!localPlayer || + !mTradeNick.empty() || + PlayerInfo::isTrading() == Trading_true || + !actorManager || + !actorManager->findBeingByName(nick, ActorType::Player)) { return; } diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 7dadbb18c..dfa5b1339 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -394,7 +394,7 @@ void TradeWindow::action(const ActionEvent &event) { setVisible(false); reset(); - PlayerInfo::setTrading(false); + PlayerInfo::setTrading(Trading_false); tradeHandler->cancel(); } else if (eventId == "ok") |