diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2011-02-17 20:32:49 -0800 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2011-02-17 22:30:20 -0700 |
commit | 85bf2ed70685a29b6a47279deeb61905c6d375b0 (patch) | |
tree | 8d2ff19afbcda92b49894262752af2ee8c5b289c /src/localplayer.cpp | |
parent | b74616db888fb69b81d49792ca3d68af3bdeaefe (diff) | |
download | mana-85bf2ed70685a29b6a47279deeb61905c6d375b0.tar.gz mana-85bf2ed70685a29b6a47279deeb61905c6d375b0.tar.bz2 mana-85bf2ed70685a29b6a47279deeb61905c6d375b0.tar.xz mana-85bf2ed70685a29b6a47279deeb61905c6d375b0.zip |
Specific messages for each pickup failure reason.
Reviewed-by: Jaxad0127
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 |