summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-11 12:16:03 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-11 12:16:03 +0300
commit4a337b7a42d0c92bc2ed26b7e206188dc04c569d (patch)
tree97c59c86246afce0710795c6ba545d40004c6810 /src/gui
parent067410031057ffc9bdb36b976bc2a658b23acb1b (diff)
downloadmanaverse-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.tar.gz
manaverse-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.tar.bz2
manaverse-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.tar.xz
manaverse-4a337b7a42d0c92bc2ed26b7e206188dc04c569d.zip
Add typed bool type Equipm.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/popupmenu.cpp3
-rw-r--r--src/gui/widgets/itemcontainer.cpp10
-rw-r--r--src/gui/windows/equipmentwindow.cpp6
-rw-r--r--src/gui/windows/inventorywindow.cpp3
-rw-r--r--src/gui/windows/itemamountwindow.cpp3
-rw-r--r--src/gui/windows/npcdialog.cpp13
-rw-r--r--src/gui/windows/outfitwindow.cpp2
-rw-r--r--src/gui/windows/tradewindow.cpp26
-rw-r--r--src/gui/windows/tradewindow.h2
9 files changed, 48 insertions, 20 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index e46f4bec4..47334c407 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -2554,7 +2554,8 @@ void PopupMenu::addProtection()
void PopupMenu::addUseDrop(const Item *const item, const bool isProtected)
{
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/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index c557b960d..dfb5a94cf 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -593,10 +593,14 @@ void ItemContainer::mouseReleased(MouseEvent &event)
if (item && !PlayerInfo::isItemProtected(item->getId()))
{
mInventory->addItem(item->getId(), item->getType(),
- 1, 1, item->getColor(),
- item->getIdentified(), item->getDamaged(),
+ 1,
+ 1,
+ item->getColor(),
+ item->getIdentified(),
+ item->getDamaged(),
item->getFavorite(),
- false, false);
+ Equipm_false,
+ false);
}
return;
}
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.