summaryrefslogtreecommitdiff
path: root/src/net/inventoryhandler.cpp
diff options
context:
space:
mode:
authorMajin Sniper <majinsniper@gmx.de>2009-02-20 00:19:52 +0100
committerJared Adams <jaxad0127@gmail.com>2009-02-19 18:27:45 -0700
commit1713f33dbd71b6378c8a4e58452fb16147f320d7 (patch)
tree19edc1a3291b06bf1680394bb1a68986ddca6f0c /src/net/inventoryhandler.cpp
parentfcc8e48e96f017e4d7551ce7e686dd2e2a1bbcb9 (diff)
downloadmana-1713f33dbd71b6378c8a4e58452fb16147f320d7.tar.gz
mana-1713f33dbd71b6378c8a4e58452fb16147f320d7.tar.bz2
mana-1713f33dbd71b6378c8a4e58452fb16147f320d7.tar.xz
mana-1713f33dbd71b6378c8a4e58452fb16147f320d7.zip
Added a pickup notification as particle effect. Also make a ui option to enable/disable this effect (default is off) and another option to disable the pickup notification in the chat log (default is on).
Diffstat (limited to 'src/net/inventoryhandler.cpp')
-rw-r--r--src/net/inventoryhandler.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp
index d5ac0c29..a227701e 100644
--- a/src/net/inventoryhandler.cpp
+++ b/src/net/inventoryhandler.cpp
@@ -25,6 +25,7 @@
#include "messagein.h"
#include "protocol.h"
+#include "../configuration.h"
#include "../inventory.h"
#include "../item.h"
#include "../itemshortcut.h"
@@ -141,13 +142,21 @@ void InventoryHandler::handleMessage(MessageIn *msg)
itemType = msg->readInt8();
if (msg->readInt8() > 0) {
- chatWindow->chatLog(_("Unable to pick up item"), BY_SERVER);
+ if (config.getValue("showpickupchat", true)) {
+ chatWindow->chatLog(_("Unable to pick up item"), BY_SERVER);
+ }
} else {
const ItemInfo &itemInfo = ItemDB::get(itemId);
const std::string amountStr =
(amount > 1) ? toString(amount) : "a";
- chatWindow->chatLog(strprintf(_("You picked up %s %s"),
- amountStr.c_str(), itemInfo.getName().c_str()), BY_SERVER);
+ if (config.getValue("showpickupchat", true)) {
+ chatWindow->chatLog(strprintf(_("You picked up %s %s"),
+ amountStr.c_str(), itemInfo.getName().c_str()),
+ BY_SERVER);
+ }
+ if (config.getValue("showpickupparticle", false)) {
+ player_node->pickedUp(itemInfo.getName());
+ }
if (Item *item = inventory->getItem(index)) {
item->setId(itemId);