diff options
author | Majin Sniper <majinsniper@gmx.de> | 2009-02-20 00:19:52 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-20 08:35:25 -0700 |
commit | b2eb8daa8c39bcfd5fbd3a76dbbc432b43c561a9 (patch) | |
tree | b7583428f7462c5a6711dfa7d92b43076ea8f29b /src/net | |
parent | 00bbc2186302fe4365f08903a209e03bb8feb4c5 (diff) | |
download | mana-b2eb8daa8c39bcfd5fbd3a76dbbc432b43c561a9.tar.gz mana-b2eb8daa8c39bcfd5fbd3a76dbbc432b43c561a9.tar.bz2 mana-b2eb8daa8c39bcfd5fbd3a76dbbc432b43c561a9.tar.xz mana-b2eb8daa8c39bcfd5fbd3a76dbbc432b43c561a9.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')
-rw-r--r-- | src/net/inventoryhandler.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp index 8ea0071d..be128609 100644 --- a/src/net/inventoryhandler.cpp +++ b/src/net/inventoryhandler.cpp @@ -26,6 +26,7 @@ #include "messagein.h" #include "protocol.h" +#include "../configuration.h" #include "../inventory.h" #include "../item.h" #include "../itemshortcut.h" @@ -142,13 +143,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); |