summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-11-11 21:55:25 -0500
committerChuck Miller <shadowmil@gmail.com>2010-11-11 22:45:58 -0500
commit5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e (patch)
tree994cdeb1187a94996ca38c5e274aabaa5f1fec76 /src/game.cpp
parent3dd1baab3fb00a3aa99447430f16a431a205c614 (diff)
downloadmana-5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e.tar.gz
mana-5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e.tar.bz2
mana-5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e.tar.xz
mana-5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e.zip
Have the event system channels use enums instead of strings
Reviewed-by: Freeyorp
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 2322d61e..4f2e1430 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -129,7 +129,7 @@ ChatTab *localChatTab = NULL;
*/
static void initEngines()
{
- Mana::Event::trigger("Game", "EnginesInitalizing");
+ Mana::Event::trigger(CHANNEL_GAME, "EnginesInitalizing");
actorSpriteManager = new ActorSpriteManager;
commandHandler = new CommandHandler;
@@ -139,7 +139,7 @@ static void initEngines()
particleEngine = new Particle(NULL);
particleEngine->setupEngine();
- Mana::Event::trigger("Game", "EnginesInitalized");
+ Mana::Event::trigger(CHANNEL_GAME, "EnginesInitalized");
}
/**
@@ -147,7 +147,7 @@ static void initEngines()
*/
static void createGuiWindows()
{
- Mana::Event::trigger("Game", "GuiWindowsLoading");
+ Mana::Event::trigger(CHANNEL_GAME, "GuiWindowsLoading");
setupWindow->clearWindowsForReset();
@@ -174,7 +174,7 @@ static void createGuiWindows()
NpcDialog::setup();
- Mana::Event::trigger("Game", "GuiWindowsLoaded");
+ Mana::Event::trigger(CHANNEL_GAME, "GuiWindowsLoaded");
}
#define del_0(X) { delete X; X = 0; }
@@ -184,7 +184,7 @@ static void createGuiWindows()
*/
static void destroyGuiWindows()
{
- Mana::Event::trigger("Game", "GuiWindowsUnloading");
+ Mana::Event::trigger(CHANNEL_GAME, "GuiWindowsUnloading");
del_0(localChatTab) // Need to do this first, so it can remove itself
del_0(chatWindow)
@@ -203,9 +203,9 @@ static void destroyGuiWindows()
del_0(specialsWindow)
del_0(socialWindow)
- Mana::Event::trigger("NPC", "CloseAll"); // Cleanup remaining NPC dialogs
+ Mana::Event::trigger(CHANNEL_NPC, "CloseAll"); // Cleanup remaining NPC dialogs
- Mana::Event::trigger("Game", "GuiWindowsUnloaded");
+ Mana::Event::trigger(CHANNEL_GAME, "GuiWindowsUnloaded");
}
Game *Game::mInstance = 0;
@@ -257,12 +257,12 @@ Game::Game():
setupWindow->setInGame(true);
- Mana::Event::trigger("Game", "Constructed");
+ Mana::Event::trigger(CHANNEL_GAME, "Constructed");
}
Game::~Game()
{
- Mana::Event::trigger("Game", "Destructing");
+ Mana::Event::trigger(CHANNEL_GAME, "Destructing");
delete mWindowMenu;
@@ -280,7 +280,7 @@ Game::~Game()
mInstance = 0;
- Mana::Event::trigger("Game", "Destructed");
+ Mana::Event::trigger(CHANNEL_GAME, "Destructed");
}
static bool saveScreenshot()
@@ -982,5 +982,5 @@ void Game::changeMap(const std::string &mapPath)
Mana::Event event("MapLoaded");
event.setString("mapPath", mapPath);
- event.trigger("Game");
+ event.trigger(CHANNEL_GAME);
}