summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-22 00:23:08 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-22 04:19:02 +0300
commit7c34adebb068549ca6a56bdf1b211398a0b1de11 (patch)
tree04a1e1ba87fa2005fc32c2358b2747390d1cd9d0 /src/gui/popupmenu.cpp
parent54f8367afe9d30c21bcda057872439199c7dd9c1 (diff)
downloadplus-7c34adebb068549ca6a56bdf1b211398a0b1de11.tar.gz
plus-7c34adebb068549ca6a56bdf1b211398a0b1de11.tar.bz2
plus-7c34adebb068549ca6a56bdf1b211398a0b1de11.tar.xz
plus-7c34adebb068549ca6a56bdf1b211398a0b1de11.zip
Allow show equipment from other players from context menu "show items".
Also allow undress separate items from players locally.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 9577d6107..7063d9ce4 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -40,6 +40,7 @@
#include "gui/buydialog.h"
#include "gui/chatwindow.h"
+#include "gui/equipmentwindow.h"
#include "gui/inventorywindow.h"
#include "gui/itemamountwindow.h"
#include "gui/ministatus.h"
@@ -233,6 +234,8 @@ void PopupMenu::showPopup(int x, int y, Being *being)
}
mBrowserBox->addRow(strprintf("@@nuke|%s@@", _("Nuke")));
mBrowserBox->addRow(strprintf("@@move|%s@@", _("Move")));
+ mBrowserBox->addRow(strprintf("@@items|%s@@",
+ _("Show Items")));
mBrowserBox->addRow(strprintf("@@undress|%s@@", _("Undress")));
if (player_relations.getDefault() & PlayerRelation::TRADE)
@@ -633,6 +636,7 @@ void PopupMenu::showChatPopup(int x, int y, ChatTab *tab)
mBrowserBox->addRow(strprintf("@@follow|%s@@", _("Follow")));
mBrowserBox->addRow(strprintf("@@imitation|%s@@", _("Imitation")));
mBrowserBox->addRow(strprintf("@@move|%s@@", _("Move")));
+ mBrowserBox->addRow(strprintf("@@items|%s@@", _("Show Items")));
mBrowserBox->addRow(strprintf("@@undress|%s@@", _("Undress")));
if (player_relations.getDefault() & PlayerRelation::TRADE)
@@ -1380,7 +1384,29 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "reset yellow")
{
- player_node->resetYellowBar();
+ if (player_node)
+ player_node->resetYellowBar();
+ }
+ else if (link == "items" && being)
+ {
+ if (being == player_node)
+ {
+ if (equipmentWindow && !equipmentWindow->isVisible())
+ equipmentWindow->setVisible(true);
+ }
+ else
+ {
+ Equipment *eq = being->getEquipment();
+ if (eq && beingEquipmentWindow)
+ {
+ beingEquipmentWindow->setBeing(being);
+ beingEquipmentWindow->setVisible(true);
+ }
+ }
+ }
+ else if (link == "undress item" && being && mItemId)
+ {
+ being->undressItemById(mItemId);
}
else if (link == "guild-pos" && !mNick.empty())
{
@@ -1788,6 +1814,26 @@ void PopupMenu::showAttackMonsterPopup(int x, int y, std::string name,
showPopup(x, y);
}
+void PopupMenu::showUndressPopup(int x, int y, Being *being, Item *item)
+{
+ if (!being || !item)
+ return;
+
+ mBeingId = being->getId();
+ mItem = item;
+ mItemId = item->getId();
+
+ mBrowserBox->clearRows();
+
+ mBrowserBox->addRow(strprintf("@@undress item|%s@@", _("Undress")));
+
+ mBrowserBox->addRow("##3---");
+ mBrowserBox->addRow(strprintf("@@cancel|%s@@", _("Cancel")));
+
+ showPopup(x, y);
+
+}
+
void PopupMenu::showPopup(int x, int y)
{
setContentSize(mBrowserBox->getWidth() + 8, mBrowserBox->getHeight() + 8);