summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-04-15 20:36:46 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-15 20:48:48 +0200
commit3d85a00ff2a33e22ba63d0b7dfc156d8076933e1 (patch)
tree13ae3acfe5ce27ab2edd1be60bdc95f30ff9b471 /src/gui/popupmenu.cpp
parentea376c0559c97400e0d875b0ae6cd4cc093d4dee (diff)
downloadmana-client-3d85a00ff2a33e22ba63d0b7dfc156d8076933e1.tar.gz
mana-client-3d85a00ff2a33e22ba63d0b7dfc156d8076933e1.tar.bz2
mana-client-3d85a00ff2a33e22ba63d0b7dfc156d8076933e1.tar.xz
mana-client-3d85a00ff2a33e22ba63d0b7dfc156d8076933e1.zip
Trim out (npc) tag from NPC names in PopupMenu
Generally, it's good to tack on this tag onto nearly everything, but for popup options, it looks a tad tacky. Signed-off-by: Tametomo <irarice@gmail.com> Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index ef1990f8..5142482f 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -78,7 +78,10 @@ void PopupMenu::showPopup(int x, int y, Being *being)
if (being->getType() != Being::UNKNOWN)
mBrowserBox->addRow(_("@@name|Add name to chat@@"));
- const std::string &name = being->getName();
+ const std::string &name = being->getType() == Being::NPC ?
+ being->getName().substr(0, being->getName().size()
+ - 6) : being->getName();
+
switch (being->getType())
{
case Being::PLAYER:
@@ -304,7 +307,10 @@ void PopupMenu::handleLink(const std::string &link)
else if (link == "name" && being)
{
- chatWindow->addInputText(being->getName());
+ const std::string &name = being->getType() == Being::NPC ?
+ being->getName().substr(0,
+ being->getName().size() - 6) : being->getName();
+ chatWindow->addInputText(name);
}
else if (link == "admin-kick" &&