summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/chat.cpp4
-rw-r--r--src/gui/chat.h2
-rw-r--r--src/gui/popupmenu.cpp21
3 files changed, 13 insertions, 14 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index f4d9763b..b53552a6 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -735,10 +735,10 @@ void ChatWindow::setInputText(std::string input_str)
requestChatFocus();
}
-void ChatWindow::addItemText(int itemId, const std::string &item)
+void ChatWindow::addItemText(const std::string &item)
{
std::ostringstream text;
- text << "[@@" << itemId << "|" << item << "@@] ";
+ text << "[" << item << "] ";
mChatInput->setText(mChatInput->getText() + text.str());
requestChatFocus();
}
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 872c0041..2fadb014 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -179,7 +179,7 @@ class ChatWindow : public Window, public gcn::ActionListener,
void setInputText(std::string input_str);
/** Called to add item to chat */
- void addItemText(int itemid, const std::string &item);
+ void addItemText(const std::string &item);
/** Override to reset mTmpVisible */
void setVisible(bool visible);
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index cf6a7188..6c0e6ad6 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -75,27 +75,27 @@ void PopupMenu::showPopup(int x, int y, Being *being)
// Players can be traded with. Later also attack, follow and
// add as buddy will be options in this menu.
const std::string &name = mBeing->getName();
- mBrowserBox->addRow(_("@@trade|Trade With ") + name + "@@");
- mBrowserBox->addRow(_("@@attack|Attack ") + name + "@@");
+ mBrowserBox->addRow(strprintf(_("@@trade|Trade With %s@@"), name.c_str()));
+ mBrowserBox->addRow(strprintf(_("@@attack|Attack %s@@"), name.c_str()));
mBrowserBox->addRow("##3---");
switch (player_relations.getRelation(name)) {
case PlayerRelation::NEUTRAL:
- mBrowserBox->addRow(_("@@friend|Befriend ") + name + "@@");
+ mBrowserBox->addRow(strprintf(_("@@friend|Befriend %s@@"), name.c_str()));
case PlayerRelation::FRIEND:
- mBrowserBox->addRow(_("@@disregard|Disregard ") + name + "@@");
- mBrowserBox->addRow(_("@@ignore|Ignore ") + name + "@@");
+ mBrowserBox->addRow(strprintf(_("@@disregard|Disregard %s@@"), name.c_str()));
+ mBrowserBox->addRow(strprintf(_("@@ignore|Ignore %s@@"), name.c_str()));
break;
case PlayerRelation::DISREGARDED:
- mBrowserBox->addRow(_("@@unignore|Un-Ignore ") + name + "@@");
- mBrowserBox->addRow(_("@@ignore|Completely ignore ") + name + "@@");
+ mBrowserBox->addRow(strprintf(_("@@unignore|Un-Ignore %s@@"), name.c_str()));
+ mBrowserBox->addRow(strprintf(_("@@ignore|Completely ignore %s@@"), name.c_str()));
break;
case PlayerRelation::IGNORED:
- mBrowserBox->addRow(_("@@unignore|Un-Ignore ") + name + "@@");
+ mBrowserBox->addRow(strprintf(_("@@unignore|Un-Ignore %s@@"), name.c_str()));
break;
}
@@ -103,8 +103,7 @@ void PopupMenu::showPopup(int x, int y, Being *being)
//mBrowserBox->addRow(_("@@buddy|Add ") + name + " to Buddy List@@");
mBrowserBox->addRow("##3---");
- mBrowserBox->addRow(_("@@party-invite|Invite ") + name +
- " to party@@");
+ mBrowserBox->addRow(strprintf(_("@@party-invite|Invite %s to party@@"), name.c_str()));
}
break;
@@ -247,7 +246,7 @@ void PopupMenu::handleLink(const std::string& link)
else if (link == "chat")
{
- chatWindow->addItemText(mItem->getId(), mItem->getInfo().getName());
+ chatWindow->addItemText(mItem->getInfo().getName());
}
else if (link == "drop")