diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-11 12:16:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-11 12:16:03 +0300 |
commit | 4a337b7a42d0c92bc2ed26b7e206188dc04c569d (patch) | |
tree | 97c59c86246afce0710795c6ba545d40004c6810 /src/gui/windows | |
parent | 067410031057ffc9bdb36b976bc2a658b23acb1b (diff) | |
download | mv-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.tar.gz mv-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.tar.bz2 mv-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.tar.xz mv-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.zip |
Add typed bool type Equipm.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/itemamountwindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/npcdialog.cpp | 13 | ||||
-rw-r--r-- | src/gui/windows/outfitwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/tradewindow.cpp | 26 | ||||
-rw-r--r-- | src/gui/windows/tradewindow.h | 2 |
7 files changed, 39 insertions, 16 deletions
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 24bda1f0d..74bcaaafb 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -322,7 +322,7 @@ void EquipmentWindow::action(const ActionEvent &event) if (dragDrop.getSource() == DRAGDROP_SOURCE_INVENTORY) { - if (item->isEquipment()) + if (item->isEquipment() == Equipm_true) { if (!item->isEquipped()) PlayerInfo::equipItem(item, true); @@ -466,7 +466,7 @@ void EquipmentWindow::mouseReleased(MouseEvent &event) if (dragDrop.getSource() == DRAGDROP_SOURCE_INVENTORY) { - if (item->isEquipment()) + if (item->isEquipment() == Equipm_true) { if (!item->isEquipped()) PlayerInfo::equipItem(item, true); @@ -474,7 +474,7 @@ void EquipmentWindow::mouseReleased(MouseEvent &event) } else if (dragDrop.getSource() == DRAGDROP_SOURCE_EQUIPMENT) { - if (item->isEquipment()) + if (item->isEquipment() == Equipm_true) { const int x = event.getX(); const int y = event.getY(); diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 7bd21e258..b788039a9 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -741,7 +741,8 @@ void InventoryWindow::updateButtons(const Item *item) if (mUseButton) { const ItemInfo &info = item->getInfo(); - const std::string &str = (item->isEquipment() && item->isEquipped()) + const std::string &str + = (item->isEquipment() == Equipm_true && item->isEquipped()) ? info.getUseButton2() : info.getUseButton(); if (str.empty()) { diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index f4203092f..6ffd857bc 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -338,7 +338,8 @@ void ItemAmountWindow::action(const ActionEvent &event) Identified_true, Damaged_true, Favorite_false, - false, false); + Equipm_false, + false); if (mUsage == ShopBuyAdd) mMax = 10000; diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index fa5cb21d7..9c93b7474 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -470,11 +470,16 @@ void NpcDialog::action(const ActionEvent &event) const Item *const item = inventoryWindow->getSelectedItem(); if (item) { - mInventory->addItem(item->getId(), item->getType(), - 1, 1, item->getColor(), - item->getIdentified(), item->getDamaged(), + mInventory->addItem(item->getId(), + item->getType(), + 1, + 1, + item->getColor(), + item->getIdentified(), + item->getDamaged(), item->getFavorite(), - false, false); + Equipm_false, + false); } } } diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 3393a1337..d73f86a05 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -283,7 +283,7 @@ void OutfitWindow::wearOutfit(const int outfit, const bool unwearEmpty, mItems[outfit][i], mItemColors[outfit][i]); if (item && !item->isEquipped() && item->getQuantity()) { - if (item->isEquipment()) + if (item->isEquipment() == Equipm_true) { PlayerInfo::equipItem(item, false); isEmpty = false; diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 41bde7c19..1dc1a9882 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -205,8 +205,16 @@ void TradeWindow::addItem(const int id, const Favorite favorite) const { Inventory *inv = own ? mMyInventory : mPartnerInventory; - inv->addItem(id, type, quantity, refine, color, - identified, damaged, favorite, false, false); + inv->addItem(id, + type, + quantity, + refine, + color, + identified, + damaged, + favorite, + Equipm_false, + false); } void TradeWindow::addItem2(const int id, @@ -220,11 +228,19 @@ void TradeWindow::addItem2(const int id, const Identified identified, const Damaged damaged, const Favorite favorite, - const bool equipment) const + const Equipm equipment) const { Inventory *inv = own ? mMyInventory : mPartnerInventory; - const int slot = inv->addItem(id, type, quantity, refine, color, - identified, damaged, favorite, equipment, false); + const int slot = inv->addItem(id, + type, + quantity, + refine, + color, + identified, + damaged, + favorite, + equipment, + false); if (slot >= 0) inv->setCards(slot, cards, sz); } diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h index 89cf36a6a..c774d521d 100644 --- a/src/gui/windows/tradewindow.h +++ b/src/gui/windows/tradewindow.h @@ -98,7 +98,7 @@ class TradeWindow final : public Window, const Identified identified, const Damaged damaged, const Favorite favorite, - const bool equipment) const; + const Equipm equipment) const; /** * Change quantity of an item. |