summaryrefslogtreecommitdiff
path: root/src/gui/itemamount.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-15 21:28:10 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-16 13:19:09 -0600
commitd8d9232a67a03548b827bdb0515fe7a620a488f8 (patch)
treed6e0644f99e0ff89f9b320c0b479ba5a4e398125 /src/gui/itemamount.cpp
parenta6c2b90c2dabac18ad8052d948bc540406b3a613 (diff)
downloadmana-d8d9232a67a03548b827bdb0515fe7a620a488f8.tar.gz
mana-d8d9232a67a03548b827bdb0515fe7a620a488f8.tar.bz2
mana-d8d9232a67a03548b827bdb0515fe7a620a488f8.tar.xz
mana-d8d9232a67a03548b827bdb0515fe7a620a488f8.zip
Move more to the event system
Most of Net::InventoryHandler is now done through events. The ActorSpriteManager was also replaced by events. A few odds and ends were taken care of too. Reviewed-by: Bertram
Diffstat (limited to 'src/gui/itemamount.cpp')
-rw-r--r--src/gui/itemamount.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp
index a98a67ab..aed8d11d 100644
--- a/src/gui/itemamount.cpp
+++ b/src/gui/itemamount.cpp
@@ -47,20 +47,30 @@ void ItemAmountWindow::finish(Item *item, int amount, Usage usage)
tradeWindow->tradeItem(item, amount);
break;
case ItemDrop:
- Net::getInventoryHandler()->dropItem(item, amount);
+ item->doEvent("doDrop", amount);
break;
case ItemSplit:
- Net::getInventoryHandler()->splitItem(item, amount);
+ item->doEvent("doSplit", amount);
break;
case StoreAdd:
- Net::getInventoryHandler()->moveItem(Inventory::INVENTORY,
- item->getInvIndex(), amount,
- Inventory::STORAGE);
+ {
+ Mana::Event event("doMove");
+ event.setItem("item", item);
+ event.setInt("amount", amount);
+ event.setInt("source", Inventory::INVENTORY);
+ event.setInt("destination", Inventory::STORAGE);
+ event.trigger("Item");
+ }
break;
case StoreRemove:
- Net::getInventoryHandler()->moveItem(Inventory::STORAGE,
- item->getInvIndex(), amount,
- Inventory::INVENTORY);
+ {
+ Mana::Event event("doMove");
+ event.setItem("item", item);
+ event.setInt("amount", amount);
+ event.setInt("source", Inventory::STORAGE);
+ event.setInt("destination", Inventory::INVENTORY);
+ event.trigger("Item");
+ }
break;
default:
break;