From 97cac06ae12026f4be3765f68b0aea3caf02d8f0 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 15 Jul 2005 23:17:00 +0000 Subject: Initialize joystick to NULL and allow right shift and control keys to be used. --- src/game.cpp | 6 +++--- src/gui/box.cpp | 5 ++--- src/gui/box.h | 42 +++++++++++++++++++++--------------------- src/gui/char_server.h | 2 ++ src/gui/updatewindow.cpp | 5 +++-- 5 files changed, 31 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/game.cpp b/src/game.cpp index 00b875f7..f6d569b1 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -71,7 +71,7 @@ int startX = 0, startY = 0; int gameTime = 0; Being *autoTarget = NULL; Engine *engine = NULL; -SDL_Joystick *joypad; /**< Joypad object */ +SDL_Joystick *joypad = NULL; /**< Joypad object */ OkDialog *deathNotice = NULL; ConfirmDialog *exitConfirm = NULL; @@ -491,7 +491,7 @@ void do_input() // XXX Is this too hackish? I'm not sure if making the Gui // class a KeyListener is a good idea and works as expected // at all... - if (keys[SDLK_LSHIFT]) { + if (keys[SDLK_LSHIFT] || keys[SDLK_RSHIFT]) { used = true; } @@ -707,7 +707,7 @@ void do_input() // Attacking monsters if (player_node->action == STAND) { - if (keys[SDLK_LCTRL] || joy[JOY_BTN0]) + if (keys[SDLK_LCTRL] || keys[SDLK_RCTRL] || joy[JOY_BTN0]) { Being *monster = attack(x, y, player_node->direction); if (monster == NULL && autoTarget != NULL) diff --git a/src/gui/box.cpp b/src/gui/box.cpp index 183eabc3..6af3ae3e 100644 --- a/src/gui/box.cpp +++ b/src/gui/box.cpp @@ -23,9 +23,8 @@ #include "box.h" -Box::Box() - : padding(0), - gcn::Container() +Box::Box(): + padding(0) { setOpaque(false); } diff --git a/src/gui/box.h b/src/gui/box.h index fc6b91ae..d65a6ac3 100644 --- a/src/gui/box.h +++ b/src/gui/box.h @@ -29,27 +29,27 @@ class Box : public gcn::Container { - protected: - Box(); - virtual ~Box(); - - /* - * Spacing between client widgets - */ - unsigned int padding; - - virtual void draw(gcn::Graphics *) = 0; - - public: - /* - * Returns padding - */ - unsigned int getPadding(); - - /* - * Sets padding between widgets - */ - void setPadding(unsigned int); + protected: + Box(); + virtual ~Box(); + + /* + * Spacing between client widgets + */ + unsigned int padding; + + virtual void draw(gcn::Graphics *) = 0; + + public: + /* + * Returns padding + */ + unsigned int getPadding(); + + /* + * Sets padding between widgets + */ + void setPadding(unsigned int); }; #endif diff --git a/src/gui/char_server.h b/src/gui/char_server.h index 42627b9c..bd41a479 100644 --- a/src/gui/char_server.h +++ b/src/gui/char_server.h @@ -32,6 +32,8 @@ */ class ServerListModel : public gcn::ListModel { public: + virtual ~ServerListModel() {}; + int getNumberOfElements(); std::string getElementAt(int i); }; diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 7ee84016..75f94b4b 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -282,8 +282,9 @@ void updateData() case UPDATE_ERROR: SDL_WaitThread(thread, NULL); new OkDialog( - "Error", ("The update process is incomplete. ", - "It is strongly recommended that you try again later"), + "Error", + "The update process is incomplete.\n" + "It is strongly recommended that you try again later", updaterWindow); logger->log("Error during the update process"); downloadStatus = UPDATE_IDLE; -- cgit v1.2.3-70-g09d2