From 958b06cd741311d42c03c6b91c64ea01c713f516 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 8 Mar 2011 23:37:30 +0200 Subject: Replace also color constants in pickup messages. --- src/gui/popupmenu.cpp | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'src/gui/popupmenu.cpp') diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 799b61374..4c970ed19 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -388,9 +388,14 @@ void PopupMenu::showPopup(int x, int y, FloorItem *floorItem) mFloorItem = floorItem; ItemInfo info = floorItem->getInfo(); mBrowserBox->clearRows(); + std::string name; // Floor item can be picked up (single option, candidate for removal) - std::string name = info.getName(); + if (serverVersion > 0) + name = info.getName(floorItem->getColor()); + else + name = info.getName(); + mBrowserBox->addRow(name); mBrowserBox->addRow(_("@@pickup|Pick up@@")); mBrowserBox->addRow(_("@@chat|Add to chat@@")); @@ -821,9 +826,29 @@ void PopupMenu::handleLink(const std::string &link, if (chatWindow) { if (mItem) - chatWindow->addItemText(mItem->getInfo().getName()); + { + if (serverVersion > 0) + { + chatWindow->addItemText(mItem->getInfo().getName( + mItem->getColor())); + } + else + { + chatWindow->addItemText(mItem->getInfo().getName()); + } + } else if (mFloorItem) - chatWindow->addItemText(mFloorItem->getInfo().getName()); + { + if (serverVersion > 0) + { + chatWindow->addItemText(mFloorItem->getInfo().getName( + mFloorItem->getColor())); + } + else + { + chatWindow->addItemText(mFloorItem->getInfo().getName()); + } + } } } else if (link == "whisper" && !mNick.empty() && chatWindow) -- cgit v1.2.3-70-g09d2