summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/popupmenu.cpp2
-rw-r--r--src/gui/windows/equipmentwindow.cpp6
-rw-r--r--src/gui/windows/inventorywindow.cpp18
-rw-r--r--src/gui/windows/outfitwindow.cpp4
4 files changed, 9 insertions, 21 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 459925bd0..63da24ccf 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1012,7 +1012,7 @@ void PopupMenu::handleLink(const std::string &link,
if (inv)
{
const Item *const item = inv->findItem(mItemId, mItemColor);
- PlayerInfo::useEquipItem(item);
+ PlayerInfo::useEquipItem(item, true);
}
}
else if (mItemId < SKILL_MIN_ID && spellManager)
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 5f214cebe..cf8484555 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -257,7 +257,7 @@ void EquipmentWindow::action(const gcn::ActionEvent &event)
if (event.getId() == "unequip" && mSelected > -1)
{
const Item *const item = mEquipment->getEquipment(mSelected);
- PlayerInfo::unequipItem(item);
+ PlayerInfo::unequipItem(item, true);
setSelected(-1);
}
}
@@ -377,7 +377,7 @@ void EquipmentWindow::mouseReleased(gcn::MouseEvent &mouseEvent)
if (item->isEquipment())
{
if (!item->isEquipped())
- PlayerInfo::equipItem(item);
+ PlayerInfo::equipItem(item, true);
}
}
else if (dragDrop.getSource() == DRAGDROP_SOURCE_EQUIPMENT)
@@ -401,7 +401,7 @@ void EquipmentWindow::mouseReleased(gcn::MouseEvent &mouseEvent)
}
if (item->isEquipped())
- PlayerInfo::unequipItem(item);
+ PlayerInfo::unequipItem(item, true);
}
}
dragDrop.clear();
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 99d4d4954..0cc9b4e0e 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -358,11 +358,11 @@ void InventoryWindow::action(const gcn::ActionEvent &event)
if (eventId == "use")
{
- PlayerInfo::useEquipItem(item);
+ PlayerInfo::useEquipItem(item, true);
}
if (eventId == "equip")
{
- PlayerInfo::useEquipItem2(item);
+ PlayerInfo::useEquipItem2(item, true);
}
else if (eventId == "drop")
{
@@ -524,19 +524,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
}
else
{
- if (item->isEquipment())
- {
- if (item->isEquipped())
- PlayerInfo::unequipItem(item);
- else
- PlayerInfo::equipItem(item);
- }
- else
- {
- if (PlayerInfo::isItemProtected(item->getId()))
- return;
- PlayerInfo::useItem(item);
- }
+ PlayerInfo::useEquipItem(item, true);
}
}
else
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index 73acf475a..ff1088071 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -279,7 +279,7 @@ void OutfitWindow::wearOutfit(const int outfit, const bool unwearEmpty,
{
if (item->isEquipment())
{
- PlayerInfo::equipItem(item);
+ PlayerInfo::equipItem(item, false);
isEmpty = false;
}
}
@@ -522,7 +522,7 @@ void OutfitWindow::unequipNotInOutfit(const int outfit) const
}
}
if (!found)
- PlayerInfo::unequipItem(item);
+ PlayerInfo::unequipItem(item, false);
}
}
}