diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-21 20:40:07 +0100 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2010-02-21 17:05:40 -0500 |
commit | c8b0d1e56f27c3141895d28b2fc768afffe7bb2d (patch) | |
tree | 0a03458836badee3e1b0da13a0721c9261e7fa86 /src/gui/charselectdialog.cpp | |
parent | 204a14c91bbe4436eb3b26bebf30cbe5669bdd1a (diff) | |
download | mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.tar.gz mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.tar.bz2 mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.tar.xz mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.zip |
Made tick counter and framerate limiter work during login sequence
Much code was moved from main() to the new Client::exec(). This new
event loop now integrates with the Game class, so that the tick counter
and framerate limiter apply universally.
The Client class is also responsible for some things that used to be
global variables.
Mantis-issue: ...
Diffstat (limited to 'src/gui/charselectdialog.cpp')
-rw-r--r-- | src/gui/charselectdialog.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index ca525285..c2c63248 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -21,9 +21,9 @@ #include "gui/charselectdialog.h" +#include "client.h" #include "game.h" #include "localplayer.h" -#include "main.h" #include "units.h" #include "log.h" @@ -179,7 +179,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event) // Check if a button of a character was pressed const gcn::Widget *sourceParent = event.getSource()->getParent(); int selected = -1; - for (unsigned i = 0; i < MAX_CHARACTER_COUNT; ++i) + for (int i = 0; i < MAX_CHARACTER_COUNT; ++i) if (mCharacterEntries[i] == sourceParent) selected = i; @@ -206,19 +206,19 @@ void CharSelectDialog::action(const gcn::ActionEvent &event) } else if (eventId == "switch") { - state = STATE_SWITCH_LOGIN; + Client::setState(STATE_SWITCH_LOGIN); } else if (eventId == "change_password") { - state = STATE_CHANGEPASSWORD; + Client::setState(STATE_CHANGEPASSWORD); } else if (eventId == "change_email") { - state = STATE_CHANGEEMAIL; + Client::setState(STATE_CHANGEEMAIL); } else if (eventId == "unregister") { - state = STATE_UNREGISTER; + Client::setState(STATE_UNREGISTER); } } @@ -308,7 +308,7 @@ bool CharSelectDialog::selectByName(const std::string &name, if (mLocked) return false; - for (unsigned i = 0; i < MAX_CHARACTER_COUNT; ++i) { + for (int i = 0; i < MAX_CHARACTER_COUNT; ++i) { if (Net::Character *character = mCharacterEntries[i]->getCharacter()) { if (character->dummy->getName() == name) { mCharacterEntries[i]->requestFocus(); |