diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-06 17:38:12 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-06 17:38:12 -0700 |
commit | 1458c6b808afaf3af2f1f50f1988427edf64826c (patch) | |
tree | 711b48bb56ff05fa333cc4ef984a37839045cfe9 /src/gui/popupmenu.cpp | |
parent | b7c33d7ec26735bade5c6e8a2ff9d06586cc7d0c (diff) | |
download | mana-1458c6b808afaf3af2f1f50f1988427edf64826c.tar.gz mana-1458c6b808afaf3af2f1f50f1988427edf64826c.tar.bz2 mana-1458c6b808afaf3af2f1f50f1988427edf64826c.tar.xz mana-1458c6b808afaf3af2f1f50f1988427edf64826c.zip |
Sanitized item links so that at no point is the internal representation
of the item link shown. This should help make it easier for people to
represent the square brackets with item links, and prevent people from
forging item links when they never see the internal representation of an
item link. Should also reduce confusion from people who haven't upgraded
their clients as well, as they wonder what all the junk is around the
item name.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
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") |