summaryrefslogtreecommitdiff
path: root/src/gui/char_select.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 01:33:53 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 01:33:53 +0000
commitee416a5f3de03a689247a290077e7fdf451e1a23 (patch)
treef456df99f954919ac7a425606df51f010aa4ef2d /src/gui/char_select.cpp
parent4070dda1560bc729c3e272f0a5c03d77391e2661 (diff)
downloadmana-client-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.gz
mana-client-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.bz2
mana-client-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.xz
mana-client-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/char_select.cpp')
-rw-r--r--src/gui/char_select.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 537a33ad..d54b8ca7 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -23,11 +23,13 @@
#include "char_select.h"
#include "textfield.h"
+#include "button.h"
+#include "ok_dialog.h"
#include "../graphic/graphic.h"
#include "../main.h"
-CharSelectDialog::CharSelectDialog(gcn::Container *parent)
- : Window(parent, "Select Character")
+CharSelectDialog::CharSelectDialog():
+ Window("Select Character")
{
selectButton = new Button(" OK ");
cancelButton = new Button("Cancel");
@@ -112,8 +114,8 @@ int curHairColor = 0;
int curHairStyle = 0;
std::string curName;
-CharCreateDialog::CharCreateDialog(gcn::Container *parent)
- : Window(parent, "Create Character")
+CharCreateDialog::CharCreateDialog():
+ Window("Create Character")
{
nameField = new TextField("");
nameLabel = new gcn::Label("Name:");
@@ -208,7 +210,7 @@ void CharCreateDialog::action(const std::string& eventId)
void charSelect()
{
CharSelectDialog *sel;
- sel = new CharSelectDialog(guiTop);
+ sel = new CharSelectDialog();
state = LOGIN;
@@ -306,7 +308,7 @@ void serverCharSelect()
void charCreate()
{
- CharCreateDialog *create = new CharCreateDialog(guiTop);
+ CharCreateDialog *create = new CharCreateDialog();
state = LOGIN;
while (!key[KEY_ESC] && !key[KEY_ENTER] && state != EXIT &&
@@ -344,7 +346,7 @@ void charCreate()
void serverCharDelete() {
state = CHAR_SELECT;
// Delete a character
- if (yes_no("Confirm", "Are you sure?")==0) {
+ if (yes_no("Confirm", "Are you sure?") == 0) {
// Request character deletion
WFIFOW(0) = net_w_value(0x0068);
WFIFOL(2) = net_l_value(char_info->id);
@@ -353,10 +355,11 @@ void serverCharDelete() {
while ((in_size < 2) || (out_size > 0)) flush();
if (RFIFOW(0) == 0x006f) {
RFIFOSKIP(2);
- ok("Info", "Player deleted");
free(char_info);
n_character = 0;
- } else if (RFIFOW(0) == 0x006c) {
+ ok("Info", "Player deleted");
+ }
+ else if (RFIFOW(0) == 0x006c) {
switch (RFIFOB(2)) {
case 0:
ok("Error", "Access denied");
@@ -366,7 +369,10 @@ void serverCharDelete() {
break;
}
RFIFOSKIP(3);
- } else ok("Error", "Unknown error");
+ }
+ else {
+ ok("Error", "Unknown error");
+ }
}
}