summaryrefslogtreecommitdiff
path: root/src/gui/char_select.cpp
diff options
context:
space:
mode:
authorRogier Polak <rogier.l.a.polak@gmail.com>2007-02-23 19:18:28 +0000
committerRogier Polak <rogier.l.a.polak@gmail.com>2007-02-23 19:18:28 +0000
commit775404c84c3250225d43f10c4a5363e997618cb2 (patch)
tree38393287d1554d8e19471f24bc65525c79efeccb /src/gui/char_select.cpp
parentfee8461a594770f8ef2bd826868a4ae81270a666 (diff)
downloadmana-775404c84c3250225d43f10c4a5363e997618cb2.tar.gz
mana-775404c84c3250225d43f10c4a5363e997618cb2.tar.bz2
mana-775404c84c3250225d43f10c4a5363e997618cb2.tar.xz
mana-775404c84c3250225d43f10c4a5363e997618cb2.zip
Added unregistering, logout_then_exit, switch_character and switch_accountserver.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r--src/gui/char_select.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 4c4b99e5..5e329598 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -33,9 +33,12 @@
#include "playerbox.h"
#include "textfield.h"
+#include "unregisterdialog.h"
+
#include "../game.h"
#include "../localplayer.h"
#include "../main.h"
+#include "../logindata.h"
#include "../net/accountserver/account.h"
@@ -54,8 +57,8 @@ class CharDeleteConfirm : public ConfirmDialog
};
CharDeleteConfirm::CharDeleteConfirm(CharSelectDialog *m):
- ConfirmDialog("Confirm", "Are you sure you want to delete this character?",
- m),
+ ConfirmDialog("Confirm",
+ "Are you sure you want to delete this character?", m),
master(m)
{
}
@@ -69,16 +72,19 @@ void CharDeleteConfirm::action(const gcn::ActionEvent &event)
ConfirmDialog::action(event);
}
-CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo):
+CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo,
+ LoginData *loginData):
Window("Select Character"),
- mCharInfo(charInfo), mCharSelected(false)
+ mCharInfo(charInfo), mCharSelected(false), mLoginData(loginData)
{
+
mSelectButton = new Button("Ok", "ok", this);
mCancelButton = new Button("Cancel", "cancel", this);
mNewCharButton = new Button("New", "new", this);
mDelCharButton = new Button("Delete", "delete", this);
mPreviousButton = new Button("Previous", "previous", this);
mNextButton = new Button("Next", "next", this);
+ mUnRegisterButton = new Button("Unregister", "unregister", this);
mNameLabel = new gcn::Label("Name");
mLevelLabel = new gcn::Label("Level");
@@ -104,10 +110,14 @@ CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo):
mSelectButton->setPosition(
mCancelButton->getX() - 5 - mSelectButton->getWidth(),
mNewCharButton->getY());
+ mUnRegisterButton->setPosition(
+ w - 5 - mUnRegisterButton->getWidth(),
+ mCancelButton->getY() - 5 - mUnRegisterButton->getHeight());
add(mPlayerBox);
add(mSelectButton);
add(mCancelButton);
+ add(mUnRegisterButton);
add(mNewCharButton);
add(mDelCharButton);
add(mPreviousButton);
@@ -130,6 +140,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
mNewCharButton->setEnabled(false);
mDelCharButton->setEnabled(false);
mSelectButton->setEnabled(false);
+ mUnRegisterButton->setEnabled(false);
mPreviousButton->setEnabled(false);
mNextButton->setEnabled(false);
mCharSelected = true;
@@ -166,6 +177,10 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
{
mCharInfo->next();
}
+ else if (event.getId() == "unregister")
+ {
+ new UnRegisterDialog(this, mLoginData);
+ }
}
void CharSelectDialog::updatePlayerInfo()