summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-23 22:20:52 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-23 22:20:52 +0300
commitea721a7170da66bac40f8dfdb8a4de659ccde374 (patch)
tree1e79b9c393d0279251e103ddcfb02f6af1ac1508 /src/gui
parent62d0365986f1a273c276cacac7b3eada9cbf2ae3 (diff)
downloadmanaverse-ea721a7170da66bac40f8dfdb8a4de659ccde374.tar.gz
manaverse-ea721a7170da66bac40f8dfdb8a4de659ccde374.tar.bz2
manaverse-ea721a7170da66bac40f8dfdb8a4de659ccde374.tar.xz
manaverse-ea721a7170da66bac40f8dfdb8a4de659ccde374.zip
Add basic support for gm commands for items context menu.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/popupmenu.cpp23
-rw-r--r--src/gui/popups/popupmenu.h4
2 files changed, 25 insertions, 2 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 14305f485..8098799fa 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -614,6 +614,8 @@ void PopupMenu::showPopup(const int x, const int y,
// TRANSLATORS: add item name to chat
mBrowserBox->addRow("/addchat 'FLOORID''CARDS'", _("Add to chat"));
mBrowserBox->addRow("##3---");
+ addGmCommands();
+
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu
mBrowserBox->addRow("cancel", _("Cancel"));
@@ -1763,6 +1765,7 @@ void PopupMenu::showItemPopup(const int x, const int y,
mBrowserBox->addRow("/use 'ITEMID'", _("Use"));
}
addProtection();
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu
@@ -1819,6 +1822,7 @@ void PopupMenu::showItemPopup(const int x, const int y,
}
}
addProtection();
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu
@@ -1862,6 +1866,7 @@ void PopupMenu::showDropPopup(const int x,
addPickupFilter(mNick);
}
}
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
mBrowserBox->addRow("/cleardrops", _("Clear drop window"));
@@ -2119,6 +2124,7 @@ void PopupMenu::showUndressPopup(const int x, const int y,
// TRANSLATORS: popup menu item
// TRANSLATORS: undress item from player
mBrowserBox->addRow("undress item", _("Undress"));
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu
@@ -2741,6 +2747,14 @@ void PopupMenu::showMonsterGMCommands()
}
}
+void PopupMenu::showFloorItemGMCommands()
+{
+}
+
+void PopupMenu::showItemGMCommands()
+{
+}
+
void PopupMenu::showGMPopup()
{
mBrowserBox->clearRows();
@@ -2757,11 +2771,16 @@ void PopupMenu::showGMPopup()
showNpcGMCommands();
break;
case ActorType::Monster:
- showMonsterGMCommands();
+ showMonsterGMCommands();
+ break;
+ case ActorType::FloorItem:
+ showFloorItemGMCommands();
break;
default:
+ if (mItemId != 0)
+ showItemGMCommands();
+ break;
case ActorType::Unknown:
- case ActorType::FloorItem:
case ActorType::Portal:
case ActorType::LocalPet:
case ActorType::Avatar:
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index c8ab6e6a0..b9e209977 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -207,6 +207,10 @@ class PopupMenu final : public Popup, public LinkHandler
void addGmCommands();
+ void showFloorItemGMCommands();
+
+ void showItemGMCommands();
+
void addNormalRelations();
void addWindowMenu(const Window *const window);