summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-02-21 23:23:24 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-02-21 23:23:24 +0100
commit458401d64fbe500295cc8e903702638fde0ab934 (patch)
tree3d1c606f118dba2b4f38fa80614bf30fdc12277c /src/localplayer.cpp
parente6cd1f9cb82811d05e08aef0493eeba9cc41a95d (diff)
parentd4bb2d1d0e82ca9d046f9b2346a7893ca11e8d9c (diff)
downloadmana-458401d64fbe500295cc8e903702638fde0ab934.tar.gz
mana-458401d64fbe500295cc8e903702638fde0ab934.tar.bz2
mana-458401d64fbe500295cc8e903702638fde0ab934.tar.xz
mana-458401d64fbe500295cc8e903702638fde0ab934.zip
Merge branch '0.5'
Translation file updates ignored. Conflicts: src/client.cpp src/commandhandler.cpp src/gui/popupmenu.cpp src/localplayer.cpp
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 81fb1cee..3e59e794 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -984,13 +984,32 @@ void LocalPlayer::stopAttack()
mLastTarget = -1;
}
-void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount)
+void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount,
+ unsigned char fail)
{
- if (!amount)
+ if (fail)
{
+ const char* msg;
+ switch (fail)
+ {
+ case PICKUP_BAD_ITEM:
+ msg = N_("Tried to pick up nonexistent item."); break;
+ case PICKUP_TOO_HEAVY: msg = N_("Item is too heavy."); break;
+ case PICKUP_TOO_FAR: msg = N_("Item is too far away"); break;
+ case PICKUP_INV_FULL: msg = N_("Inventory is full."); break;
+ case PICKUP_STACK_FULL: msg = N_("Stack is too big."); break;
+ case PICKUP_DROP_STEAL:
+ msg = N_("Item belongs to someone else."); break;
+ default: msg = N_("Unknown problem picking up item."); break;
+ }
if (config.getValue("showpickupchat", 1))
{
- SERVER_NOTICE(_("Unable to pick up item."))
+ SERVER_NOTICE(_(msg))
+ }
+ if (mMap && config.getValue("showpickupparticle", 0))
+ {
+ // Show pickup notification
+ addMessageToQueue(_(msg), UserPalette::PICKUP_INFO);
}
}
else
@@ -1007,7 +1026,11 @@ void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount)
if (mMap && config.getValue("showpickupparticle", 0))
{
// Show pickup notification
- addMessageToQueue(itemInfo.getName(), UserPalette::PICKUP_INFO);
+ std::string msg = "";
+ if (amount > 1)
+ msg = strprintf("%i ", amount);
+ msg += itemInfo.getName();
+ addMessageToQueue(msg, UserPalette::PICKUP_INFO);
}
}
}