summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
commitf842e0b40d8382011f0bc46b1446945d99ac0425 (patch)
tree5ddbb7c146a8ece28a4260d788350b1c2cf0dbed /src/game.cpp
parentcbbcc5489e2f72a76b66ae849cbe8f1dc44246ca (diff)
downloadmana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.gz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.bz2
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.xz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.zip
Upgraded to Guichan 0.6.0 (merge from guichan-0.6.0 branch).
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;