diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-08 23:37:30 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-08 23:37:30 +0200 |
commit | 958b06cd741311d42c03c6b91c64ea01c713f516 (patch) | |
tree | b309d316087f85cdf57d266bf678f9923007899b /src/localplayer.cpp | |
parent | ee1a1c0e14058fb1a31904a6e2cf0c0ce90bc26b (diff) | |
download | mv-958b06cd741311d42c03c6b91c64ea01c713f516.tar.gz mv-958b06cd741311d42c03c6b91c64ea01c713f516.tar.bz2 mv-958b06cd741311d42c03c6b91c64ea01c713f516.tar.xz mv-958b06cd741311d42c03c6b91c64ea01c713f516.zip |
Replace also color constants in pickup messages.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index a7fa5155a..3bd075f45 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -1310,7 +1310,7 @@ void LocalPlayer::stopAttack() } void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount, - unsigned char fail) + unsigned char color, unsigned char fail) { if (fail) { @@ -1346,13 +1346,20 @@ void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount, } else { + std::string str; + if (serverVersion > 0) + str = itemInfo.getName(color); + else + str = itemInfo.getName(); + if (config.getBoolValue("showpickupchat") && localChatTab) { // TRANSLATORS: This sentence may be translated differently // for different grammatical numbers (singular, plural, ...) + localChatTab->chatLog(strprintf(ngettext("You picked up %d " "[@@%d|%s@@].", "You picked up %d [@@%d|%s@@].", amount), - amount, itemInfo.getId(), itemInfo.getName().c_str()), + amount, itemInfo.getId(), str.c_str()), BY_SERVER); } @@ -1362,12 +1369,11 @@ void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount, if (amount > 1) { addMessageToQueue(strprintf("%d x %s", amount, - itemInfo.getName().c_str()), UserPalette::PICKUP_INFO); + str.c_str()), UserPalette::PICKUP_INFO); } else { - addMessageToQueue(itemInfo.getName(), - UserPalette::PICKUP_INFO); + addMessageToQueue(str, UserPalette::PICKUP_INFO); } } } |