From 7c34adebb068549ca6a56bdf1b211398a0b1de11 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 May 2011 00:23:08 +0300 Subject: Allow show equipment from other players from context menu "show items". Also allow undress separate items from players locally. --- src/gui/popupmenu.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'src/gui/popupmenu.cpp') 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); -- cgit v1.2.3-60-g2f50