diff options
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index cd1bb561..62b45f62 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -1239,19 +1239,32 @@ void LocalPlayer::setMoney(int value) statusWindow->update(StatusWindow::MONEY); } -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)) { - localChatTab->chatLog(_("Unable to pick up item."), BY_SERVER); + localChatTab->chatLog(_(msg), BY_SERVER); } if (mMap && config.getValue("showpickupparticle", 0)) { // Show pickup notification - addMessageToQueue(_("Unable to pick up item."), - UserPalette::PICKUP_INFO); + addMessageToQueue(_(msg), UserPalette::PICKUP_INFO); } } else |