diff options
author | Chuck Miller <shadowmil@gmail.com> | 2010-11-11 23:12:29 -0500 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2010-11-11 23:12:29 -0500 |
commit | a4640305fd0d88c6332112712aa69e496368e01b (patch) | |
tree | 0f039b331026ca2b9718a920b24e2344f9e56b25 /src/gui/inventorywindow.cpp | |
parent | 5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e (diff) | |
download | mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.gz mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.bz2 mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.xz mana-a4640305fd0d88c6332112712aa69e496368e01b.zip |
Replace Event names with enums instead of strings
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r-- | src/gui/inventorywindow.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index fab87844..31743c57 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -186,19 +186,19 @@ void InventoryWindow::action(const gcn::ActionEvent &event) return; if (event.getId() == "activate") - item->doEvent("doUse"); + item->doEvent(EVENT_DOUSE); else if (event.getId() == "equip") { if (item->isEquippable()) { if (item->isEquipped()) - item->doEvent("doUnequip"); + item->doEvent(EVENT_DOUNEQUIP); else - item->doEvent("doEquip"); + item->doEvent(EVENT_DOEQUIP); } else { - item->doEvent("doUse"); + item->doEvent(EVENT_DOUSE); } } else if (event.getId() == "drop") @@ -256,7 +256,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) return; if (mInventory->isMainInventory()) { - Mana::Event event("doMove"); + Mana::Event event(EVENT_DOMOVE); event.setItem("item", item); event.setInt("amount", item->getQuantity()); event.setInt("source", Inventory::INVENTORY); @@ -265,7 +265,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) } else { - Mana::Event event("doMove"); + Mana::Event event(EVENT_DOMOVE); event.setItem("item", item); event.setInt("amount", item->getQuantity()); event.setInt("source", Inventory::STORAGE); @@ -368,7 +368,7 @@ void InventoryWindow::close() } else { - Mana::Event event("doCloseInventory"); + Mana::Event event(EVENT_DOCLOSEINVENTORY); event.setInt("type", mInventory->getType()); event.trigger(CHANNEL_ITEM); scheduleDelete(); @@ -377,7 +377,7 @@ void InventoryWindow::close() void InventoryWindow::event(Channels channel, const Mana::Event &event) { - if (event.getName() == "UpdateAttribute") + if (event.getName() == EVENT_UPDATEATTRIBUTE) { int id = event.getInt("id"); if (id == TOTAL_WEIGHT || |