diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-08 01:33:53 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-08 01:33:53 +0000 |
commit | ee416a5f3de03a689247a290077e7fdf451e1a23 (patch) | |
tree | f456df99f954919ac7a425606df51f010aa4ef2d /src/gui/login.cpp | |
parent | 4070dda1560bc729c3e272f0a5c03d77391e2661 (diff) | |
download | mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.gz mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.bz2 mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.xz mana-ee416a5f3de03a689247a290077e7fdf451e1a23.zip |
Well improved window container and window widgets a bit, and made a start
on support for modal dialogs. Still some issues to work out. Tell me if you
experience something unsettling.
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r-- | src/gui/login.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 00797917..08276562 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -27,10 +27,11 @@ #include "checkbox.h" #include "textfield.h" #include "passwordfield.h" +#include "ok_dialog.h" #include "../graphic/graphic.h" -LoginDialog::LoginDialog(gcn::Container *parent): - Window(parent, "Login") +LoginDialog::LoginDialog(): + Window("Login") { userLabel = new gcn::Label("Name:"); passLabel = new gcn::Label("Password:"); @@ -129,7 +130,7 @@ void LoginDialog::action(const std::string& eventId) void login() { - LoginDialog *dialog = new LoginDialog(guiTop); + LoginDialog *dialog = new LoginDialog(); while (state == LOGIN) { blit(login_wallpaper, buffer, 0, 0, 0, 0, 800, 600); @@ -181,17 +182,17 @@ void server_login(const std::string& user, const std::string& pass) { while (in_size < RFIFOW(2)) { flush(); } - n_server = (RFIFOW(2)-47)/32; - server_info = (SERVER_INFO*)malloc(sizeof(SERVER_INFO)*n_server); + n_server = (RFIFOW(2) - 47) / 32; + server_info = (SERVER_INFO*)malloc(sizeof(SERVER_INFO) * n_server); account_ID = RFIFOL(8); session_ID1 = RFIFOL(4); session_ID2 = RFIFOL(12); sex = RFIFOB(46); for (int i = 0; i < n_server; i++) { - server_info[i].address = RFIFOL(47+32*i); - memcpy(server_info[i].name, RFIFOP(47+32*i+6), 20); - server_info[i].online_users = RFIFOW(47+32*i+26); - server_info[i].port = RFIFOW(47+32*i+4); + server_info[i].address = RFIFOL(47 + 32 * i); + memcpy(server_info[i].name, RFIFOP(47 + 32 * i + 6), 20); + server_info[i].online_users = RFIFOW(47 + 32 * i + 26); + server_info[i].port = RFIFOW(47 + 32 * i + 4); state = CHAR_SERVER; } log("Network", "Server: %s (%s:%d)", server_info[0].name, @@ -203,17 +204,17 @@ void server_login(const std::string& user, const std::string& pass) { else if (RFIFOW(0) == 0x006a) { switch (RFIFOB(2)) { case 0: - ok("Error", "Unregistered ID"); + new OkDialog("Error", "Unregistered ID"); break; case 1: - ok("Error", "Wrong password"); + new OkDialog("Error", "Wrong password"); break; } state = LOGIN; RFIFOSKIP(23); } else { - ok("Error", "Unknown error"); + new OkDialog("Error", "Unknown error"); } // Todo: add other packets, also encrypted } |