diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-07-17 23:10:05 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-07-18 11:45:33 -0600 |
commit | 81d8168bb5796ccb1704bcce9f5327c35e55d281 (patch) | |
tree | 3e7e111eb956757f49579bb4366c24c94712387d /src/client.cpp | |
parent | 2ae96bdc5517b2147662f19ff6d700657c0d0d42 (diff) | |
download | mana-81d8168bb5796ccb1704bcce9f5327c35e55d281.tar.gz mana-81d8168bb5796ccb1704bcce9f5327c35e55d281.tar.bz2 mana-81d8168bb5796ccb1704bcce9f5327c35e55d281.tar.xz mana-81d8168bb5796ccb1704bcce9f5327c35e55d281.zip |
Move more from LocalPlayer to PlayerInfo
Also cleanup PlayerInfo a bit.
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index ea35f76d..a2f70900 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -25,6 +25,8 @@ #include "chatlog.h" #include "configuration.h" #include "emoteshortcut.h" +#include "event.h" +#include "eventmanager.h" #include "game.h" #include "itemshortcut.h" #include "keyboardconfig.h" @@ -427,6 +429,9 @@ Client::Client(const Options &options): SDL_initFramerate(&mFpsManager); config.addListener("fpslimit", this); optionChanged("fpslimit"); + + // Initialize PlayerInfo + PlayerInfo::init(); } Client::~Client() @@ -587,6 +592,13 @@ int Client::exec() if (mState != mOldState) { + { + Mana::Event event("StateChange"); + event.setInt("oldState", mOldState); + event.setInt("newState", mState); + Mana::EventManager::trigger("Client", event); + } + Net::GeneralHandler *generalHandler = Net::getGeneralHandler(); if (generalHandler) generalHandler->stateChanged(mOldState, mState); |