diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 00:03:44 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 17:54:12 +0200 |
commit | 30d4b0adf4f17f05d1d62fc3428c896ef1079b6b (patch) | |
tree | acc6dab5d6894a949df3ab4d913ef72a1b1ebdca /src/net/tmwa | |
parent | b499cf0c03f2589d36a1df14c81530347243940a (diff) | |
download | mana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.tar.gz mana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.tar.bz2 mana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.tar.xz mana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.zip |
Moved Events to Mana::Event::Type
Acked-by: Jared Adams
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 12 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 24 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.cpp | 2 |
7 files changed, 30 insertions, 30 deletions
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 33826762..5dc1206f 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -82,7 +82,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) break; case 0x01: { - Mana::Event event(EVENT_WHISPERERROR); + Mana::Event event(Mana::Event::WhisperError); event.setString("nick", nick); event.setString("error", strprintf(_("Whisper could " "not be sent, %s is offline."), nick.c_str())); @@ -91,7 +91,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) break; case 0x02: { - Mana::Event event(EVENT_WHISPERERROR); + Mana::Event event(Mana::Event::WhisperError); event.setString("nick", nick); event.setString("error", strprintf(_("Whisper could " "not be sent, ignored by %s."), nick.c_str())); @@ -115,7 +115,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) { if (player_relations.hasPermission(nick, PlayerRelation::WHISPER)) { - Mana::Event event(EVENT_WHISPER); + Mana::Event event(Mana::Event::Whisper); event.setString("nick", nick); event.setString("message", chatMsg); event.trigger(CHANNEL_CHAT); @@ -174,7 +174,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) std::string reducedMessage = chatMsg; chatMsg = removeColors(sender_name) + " : " + reducedMessage; - Mana::Event event(EVENT_BEING); + Mana::Event event(Mana::Event::Being); event.setString("message", chatMsg); event.setString("text", reducedMessage); event.setString("nick", sender_name); @@ -205,7 +205,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) trim(chatMsg); - Mana::Event event(EVENT_PLAYER); + Mana::Event event(Mana::Event::Player); event.setString("message", mes); event.setString("text", chatMsg); event.setString("nick", player_node->getName()); @@ -217,7 +217,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) } else { - Mana::Event event(EVENT_ANNOUNCEMENT); + Mana::Event event(Mana::Event::Announcement); event.setString("message", chatMsg); event.trigger(CHANNEL_CHAT); } diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 63f5fcec..3063c044 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -109,11 +109,11 @@ void GameHandler::event(Channels channel, const Mana::Event &event) { if (channel == CHANNEL_GAME) { - if (event.getName() == EVENT_ENGINESINITALIZED) + if (event.getType() == Mana::Event::EnginesInitialized) { Game::instance()->changeMap(mMap); } - else if (event.getName() == EVENT_MAPLOADED) + else if (event.getType() == Mana::Event::MapLoaded) { MessageOut outMsg(CMSG_MAP_LOADED); } diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 1935ad72..7000c96c 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -222,7 +222,7 @@ void GeneralHandler::event(Channels channel, { if (channel == CHANNEL_GAME) { - if (event.getName() == EVENT_GUIWINDOWSLOADED) + if (event.getType() == Mana::Event::GuiWindowsLoaded) { inventoryWindow->setSplitAllowed(false); skillDialog->loadSkills("ea-skills.xml"); @@ -242,7 +242,7 @@ void GeneralHandler::event(Channels channel, statusWindow->addAttribute(FLEE, _("% Evade"), false, ""); statusWindow->addAttribute(CRIT, _("% Critical"), false, ""); } - else if (event.getName() == EVENT_GUIWINDOWSUNLOADING) + else if (event.getType() == Mana::Event::GuiWindowsUnloading) { socialWindow->removeTab(taGuild); socialWindow->removeTab(taParty); diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 1d99eca4..5ab6af08 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -436,7 +436,7 @@ void InventoryHandler::event(Channels channel, { if (channel == CHANNEL_ITEM) { - if (event.getName() == EVENT_DOCLOSEINVENTORY) + if (event.getType() == Mana::Event::DoCloseInventory) { // No need to worry about type MessageOut outMsg(CMSG_CLOSE_STORAGE); @@ -450,24 +450,24 @@ void InventoryHandler::event(Channels channel, int index = item->getInvIndex() + INVENTORY_OFFSET; - if (event.getName() == EVENT_DOEQUIP) + if (event.getType() == Mana::Event::DoEquip) { MessageOut outMsg(CMSG_PLAYER_EQUIP); outMsg.writeInt16(index); outMsg.writeInt16(0); } - else if (event.getName() == EVENT_DOUNEQUIP) + else if (event.getType() == Mana::Event::DoUnequip) { MessageOut outMsg(CMSG_PLAYER_UNEQUIP); outMsg.writeInt16(index); } - else if (event.getName() == EVENT_DOUSE) + else if (event.getType() == Mana::Event::DoUse) { MessageOut outMsg(CMSG_PLAYER_INVENTORY_USE); outMsg.writeInt16(index); outMsg.writeInt32(item->getId()); // unused } - else if (event.getName() == EVENT_DODROP) + else if (event.getType() == Mana::Event::DoDrop) { int amount = event.getInt("amount", 1); @@ -477,7 +477,7 @@ void InventoryHandler::event(Channels channel, outMsg.writeInt16(index); outMsg.writeInt16(amount); } - else if (event.getName() == EVENT_DOMOVE) + else if (event.getType() == Mana::Event::DoMove) { int newIndex = event.getInt("newIndex", -1); diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 337226a9..85b3b284 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -83,14 +83,14 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) switch (msg.getId()) { case SMSG_NPC_CHOICE: - event = new Mana::Event(EVENT_MENU); + event = new Mana::Event(Mana::Event::Menu); event->setInt("id", npcId); parseMenu(event, msg.readString(msg.getLength() - 8)); event->trigger(CHANNEL_NPC); break; case SMSG_NPC_MESSAGE: - event = new Mana::Event(EVENT_MESSAGE); + event = new Mana::Event(Mana::Event::Message); event->setInt("id", npcId); event->setString("text", msg.readString(msg.getLength() - 8)); event->trigger(CHANNEL_NPC); @@ -98,28 +98,28 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) case SMSG_NPC_CLOSE: // Show the close button - event = new Mana::Event(EVENT_CLOSE); + event = new Mana::Event(Mana::Event::Close); event->setInt("id", npcId); event->trigger(CHANNEL_NPC); break; case SMSG_NPC_NEXT: // Show the next button - event = new Mana::Event(EVENT_NEXT); + event = new Mana::Event(Mana::Event::Next); event->setInt("id", npcId); event->trigger(CHANNEL_NPC); break; case SMSG_NPC_INT_INPUT: // Request for an integer - event = new Mana::Event(EVENT_INTEGERINPUT); + event = new Mana::Event(Mana::Event::IntegerInput); event->setInt("id", npcId); event->trigger(CHANNEL_NPC); break; case SMSG_NPC_STR_INPUT: // Request for a string - event = new Mana::Event(EVENT_STRINGINPUT); + event = new Mana::Event(Mana::Event::StringInput); event->setInt("id", npcId); event->trigger(CHANNEL_NPC); break; @@ -177,7 +177,7 @@ void NpcHandler::talk(int npcId) outMsg.writeInt32(npcId); outMsg.writeInt8(0); // Unused - Mana::Event event(EVENT_TALKSENT); + Mana::Event event(Mana::Event::TalkSent); event.setInt("npcId", npcId); event.trigger(CHANNEL_NPC); } @@ -187,7 +187,7 @@ void NpcHandler::nextDialog(int npcId) MessageOut outMsg(CMSG_NPC_NEXT_REQUEST); outMsg.writeInt32(npcId); - Mana::Event event(EVENT_NEXTSENT); + Mana::Event event(Mana::Event::NextSent); event.setInt("npcId", npcId); event.trigger(CHANNEL_NPC); } @@ -197,7 +197,7 @@ void NpcHandler::closeDialog(int npcId) MessageOut outMsg(CMSG_NPC_CLOSE); outMsg.writeInt32(npcId); - Mana::Event event(EVENT_CLOSESENT); + Mana::Event event(Mana::Event::CloseSent); event.setInt("npcId", npcId); event.trigger(CHANNEL_NPC); } @@ -208,7 +208,7 @@ void NpcHandler::menuSelect(int npcId, int choice) outMsg.writeInt32(npcId); outMsg.writeInt8(choice); - Mana::Event event(EVENT_MENUSENT); + Mana::Event event(Mana::Event::MenuSent); event.setInt("npcId", npcId); event.setInt("choice", choice); event.trigger(CHANNEL_NPC); @@ -220,7 +220,7 @@ void NpcHandler::integerInput(int npcId, int value) outMsg.writeInt32(npcId); outMsg.writeInt32(value); - Mana::Event event(EVENT_INTEGERINPUTSENT); + Mana::Event event(Mana::Event::IntegerInputSent); event.setInt("npcId", npcId); event.setInt("value", value); event.trigger(CHANNEL_NPC); @@ -234,7 +234,7 @@ void NpcHandler::stringInput(int npcId, const std::string &value) outMsg.writeString(value, value.length()); outMsg.writeInt8(0); // Prevent problems with string reading - Mana::Event event(EVENT_STRINGINPUTSENT); + Mana::Event event(Mana::Event::StringInputSent); event.setInt("npcId", npcId); event.setString("value", value); event.trigger(CHANNEL_NPC); diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 725a00cc..64dda9d4 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -81,7 +81,7 @@ namespace { viewport->closePopupMenu(); - Mana::Event::trigger(CHANNEL_NPC, EVENT_CLOSEALL); + Mana::Event::trigger(CHANNEL_NPC, Mana::Event::CloseAll); } } deathListener; diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 034b959d..80249784 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -191,7 +191,7 @@ void TradeHandler::handleMessage(Net::MessageIn &msg) // Successfully added item if (item->isEquippable() && item->isEquipped()) { - item->doEvent(EVENT_DOUNEQUIP); + item->doEvent(Mana::Event::DoUnequip); } tradeWindow->addItem(item->getId(), true, quantity); |