summaryrefslogtreecommitdiff
path: root/src/gui/char_server.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-13 01:08:06 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-13 01:08:06 +0000
commit6a8f1f5914721d1e8b8f9688b1d6ab71c0ed9bce (patch)
tree1a846219c3fdf6b3a0b2f17f15c4da4fec406845 /src/gui/char_server.cpp
parent07b3632e605488221f34bff48f298b394af7083a (diff)
downloadmana-client-6a8f1f5914721d1e8b8f9688b1d6ab71c0ed9bce.tar.gz
mana-client-6a8f1f5914721d1e8b8f9688b1d6ab71c0ed9bce.tar.bz2
mana-client-6a8f1f5914721d1e8b8f9688b1d6ab71c0ed9bce.tar.xz
mana-client-6a8f1f5914721d1e8b8f9688b1d6ab71c0ed9bce.zip
Unified the loops for the various dialogs that are shown before the actual game starts.
Diffstat (limited to 'src/gui/char_server.cpp')
-rw-r--r--src/gui/char_server.cpp48
1 files changed, 6 insertions, 42 deletions
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 24e58c5c..b4b01350 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -23,15 +23,13 @@
#include "char_server.h"
-#include <guichan/sdl/sdlinput.hpp>
+#include <SDL.h>
#include "button.h"
-#include "gui.h"
#include "listbox.h"
#include "ok_dialog.h"
#include "scrollarea.h"
-#include "../graphics.h"
#include "../log.h"
#include "../main.h"
#include "../playerinfo.h"
@@ -39,10 +37,7 @@
#include "../net/network.h"
-extern Graphics *graphics;
-
char server[30];
-int showServerList = 1;
ServerSelectDialog::ServerSelectDialog():
@@ -107,8 +102,8 @@ void ServerSelectDialog::action(const std::string& eventId)
server_char_server(serverList->getSelected());
}
else if (eventId == "cancel") {
+ state = LOGIN;
}
- showServerList = 0;
}
@@ -123,43 +118,12 @@ std::string ServerListModel::getElementAt(int i) {
return buffer;
}
-
-void char_server() {
- ServerSelectDialog *dialog = new ServerSelectDialog();
-
- state = LOGIN;
-
- showServerList = 1;
- while (showServerList)
+void charServerInputHandler(SDL_KeyboardEvent *keyEvent)
+{
+ if (keyEvent->keysym.sym == SDLK_ESCAPE)
{
- // Handle SDL events
- SDL_Event event;
- while (SDL_PollEvent(&event)) {
- switch (event.type) {
- case SDL_QUIT:
- state = EXIT;
- showServerList = false;
- break;
-
- case SDL_KEYDOWN:
- if (event.key.keysym.sym == SDLK_ESCAPE)
- {
- showServerList = false;
- }
- break;
- }
-
- guiInput->pushInput(event);
- }
-
- gui->logic();
-
- graphics->drawImage(login_wallpaper, 0, 0);
- gui->draw();
- graphics->updateScreen();
+ state = LOGIN;
}
-
- delete dialog;
}
void server_char_server(int serverIndex)