summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a91fdc23..b04d1990 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -85,7 +85,7 @@
#include <guichan/exception.hpp>
#include <guichan/focushandler.hpp>
-#include "physfs.h"
+#include <physfs.h>
#include <sys/stat.h>
@@ -151,23 +151,6 @@ const int MAX_TICK_VALUE = 10000;
const int MILLISECONDS_IN_A_TICK = 10;
/**
- * Listener used for exiting handling.
- */
-namespace {
- class ExitListener : public gcn::ActionListener
- {
- public:
- void action(const gcn::ActionEvent &event)
- {
- if (event.getId() == "yes" || event.getId() == "ok")
- state = STATE_EXIT;
-
- disconnectedDialog = NULL;
- }
- } exitListener;
-}
-
-/**
* Advances game logic counter.
* Called every 10 milliseconds by SDL_AddTimer()
* @see MILLISECONDS_IN_A_TICK value
@@ -302,6 +285,8 @@ Game::Game():
mLastTarget(Being::UNKNOWN),
mLogicCounterId(0), mSecondsCounterId(0)
{
+ disconnectedDialog = NULL;
+
createGuiWindows();
mWindowMenu = new WindowMenu;
@@ -498,14 +483,13 @@ void Game::logic()
{
if (state != STATE_ERROR)
{
- errorMessage = _("The connection to the server was lost, "
- "the program will now quit");
+ errorMessage = _("The connection to the server was lost.");
}
if (!disconnectedDialog)
{
disconnectedDialog = new OkDialog(_("Network Error"), errorMessage);
- disconnectedDialog->addActionListener(&exitListener);
+ disconnectedDialog->addActionListener(&errorListener);
disconnectedDialog->requestMoveToTop();
}
}