summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a424320e..6052cf48 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;
@@ -390,10 +392,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();
@@ -459,7 +457,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
@@ -626,6 +624,10 @@ 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;
Uint16 y = player_node->mY;
unsigned char direction = 0;