diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-12 21:47:59 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-12 22:01:57 -0600 |
commit | eb2c0cae1cb7a02b72c15de0f4e8f4a68a9fa53a (patch) | |
tree | 8b1fab9acbd0eb568d7f7e0b31f8fd4ac02b18a4 /src/net/tmwa/npchandler.cpp | |
parent | 2293b1c5ef0bb7378140bf73f1fef03a4504bdd2 (diff) | |
download | mana-eb2c0cae1cb7a02b72c15de0f4e8f4a68a9fa53a.tar.gz mana-eb2c0cae1cb7a02b72c15de0f4e8f4a68a9fa53a.tar.bz2 mana-eb2c0cae1cb7a02b72c15de0f4e8f4a68a9fa53a.tar.xz mana-eb2c0cae1cb7a02b72c15de0f4e8f4a68a9fa53a.zip |
Simplify working with the event system
EventManager has been merged into Event, with some new convinience methods
added.
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index b61dc520..e1615fec 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -22,7 +22,7 @@ #include "net/tmwa/npchandler.h" #include "actorspritemanager.h" -#include "eventmanager.h" +#include "event.h" #include "localplayer.h" #include "net/messagein.h" @@ -69,7 +69,7 @@ NpcHandler::NpcHandler() handledMessages = _messages; npcHandler = this; - Mana::EventManager::bind(this, "NPC"); + listen("NPC"); } void NpcHandler::handleMessage(Net::MessageIn &msg) @@ -88,42 +88,42 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) event = new Mana::Event("Menu"); event->setInt("id", npcId); parseMenu(event, msg.readString(msg.getLength() - 8)); - Mana::EventManager::trigger("NPC", *event); + event->trigger("NPC"); break; case SMSG_NPC_MESSAGE: event = new Mana::Event("Message"); event->setInt("id", npcId); event->setString("text", msg.readString(msg.getLength() - 8)); - Mana::EventManager::trigger("NPC", *event); + event->trigger("NPC"); break; case SMSG_NPC_CLOSE: // Show the close button event = new Mana::Event("Close"); event->setInt("id", npcId); - Mana::EventManager::trigger("NPC", *event); + event->trigger("NPC"); break; case SMSG_NPC_NEXT: // Show the next button event = new Mana::Event("Next"); event->setInt("id", npcId); - Mana::EventManager::trigger("NPC", *event); + event->trigger("NPC"); break; case SMSG_NPC_INT_INPUT: // Request for an integer event = new Mana::Event("IntegerInput"); event->setInt("id", npcId); - Mana::EventManager::trigger("NPC", *event); + event->trigger("NPC"); break; case SMSG_NPC_STR_INPUT: // Request for a string event = new Mana::Event("StringInput"); event->setInt("id", npcId); - Mana::EventManager::trigger("NPC", *event); + event->trigger("NPC"); break; } |