From d1395845cdc678db2a71326f2e6f20253ed14cac Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 14 Jan 2007 16:45:13 +0000 Subject: Merged 0.0 changes from revision 2988 to 3035 to trunk. --- src/game.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 2af13146..40d78248 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -124,9 +124,11 @@ const int MAX_TIME = 10000; * Listener used for exitting handling. */ namespace { - struct ExitListener : public gcn::ActionListener { - void action(const std::string &eventId, gcn::Widget *widget) { - if (eventId == "yes") { + struct ExitListener : public gcn::ActionListener + { + void action(const gcn::ActionEvent &event) + { + if (event.getId() == "yes") { done = true; } exitConfirm = NULL; @@ -386,10 +388,6 @@ void Game::logic() void Game::handleInput() { - // Get the state of the keyboard keys - Uint8* keys; - keys = SDL_GetKeyState(NULL); - if (joystick != NULL) { joystick->update(); @@ -455,7 +453,7 @@ void Game::handleInput() // Close the config window, cancelling changes if opened else if (setupWindow->isVisible()) { - setupWindow->action("cancel", NULL); + setupWindow->action(gcn::ActionEvent(NULL, "cancel")); } // Else, open the chat edit box else @@ -633,7 +631,12 @@ void Game::handleInput() current_npc == 0 && !chatWindow->isFocused()) { + // Get the state of the keyboard keys + Uint8* keys; + keys = SDL_GetKeyState(NULL); + Uint16 x = player_node->mX / 32, y = player_node->mY / 32; + unsigned char direction = 0; // Translate pressed keys to movement and direction -- cgit v1.2.3-70-g09d2