diff options
author | Dennis Friis <peavey@inspircd.org> | 2009-05-24 21:49:09 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-25 23:18:40 +0200 |
commit | a3c66a09efc7f3683f0c247f4a2c5035bff83651 (patch) | |
tree | 1d196524cd791afaa74110456a9910c430bb0a43 /src/gui | |
parent | a36909f5c3408153c9b5f9477adde9b27d8c7482 (diff) | |
download | mana-a3c66a09efc7f3683f0c247f4a2c5035bff83651.tar.gz mana-a3c66a09efc7f3683f0c247f4a2c5035bff83651.tar.bz2 mana-a3c66a09efc7f3683f0c247f4a2c5035bff83651.tar.xz mana-a3c66a09efc7f3683f0c247f4a2c5035bff83651.zip |
Add change password dialog to athena client
(cherry picked from commit 050103b8d2e3eb23e7aea188a1a269feb7c181ab)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/charselectdialog.cpp | 43 | ||||
-rw-r--r-- | src/gui/charselectdialog.h | 12 |
2 files changed, 23 insertions, 32 deletions
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index 4df0243b..dd91af5c 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -25,17 +25,16 @@ #include "gui/confirmdialog.h" #include "gui/okdialog.h" #include "gui/playerbox.h" +#include "gui/changepassworddialog.h" +#include "net/logindata.h" #ifdef TMWSERV_SUPPORT #include "gui/widgets/radiobutton.h" #include "gui/widgets/slider.h" #include "gui/unregisterdialog.h" -#include "gui/changepassworddialog.h" #include "gui/changeemaildialog.h" -#include "net/logindata.h" - #include "net/tmwserv/accountserver/account.h" #endif @@ -91,36 +90,30 @@ void CharDeleteConfirm::action(const gcn::ActionEvent &event) ConfirmDialog::action(event); } -#ifdef TMWSERV_SUPPORT CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo, LoginData *loginData): Window(_("Account and Character Management")), mCharInfo(charInfo), mCharSelected(false), - mLoginData(loginData) -#else -CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo, - Gender gender): - Window(_("Select Character")), - mCharInfo(charInfo), - mCharSelected(false), - mGender(gender) +#ifdef EATHENA_SUPPORT + mGender(loginData->sex), #endif + mLoginData(loginData) { mSelectButton = new Button(_("OK"), "ok", this); mCancelButton = new Button(_("Cancel"), "cancel", this); mPreviousButton = new Button(_("Previous"), "previous", this); mNextButton = new Button(_("Next"), "next", this); + mAccountNameLabel = new Label(strprintf(_("Account: %s"), mLoginData->username.c_str())); mNameLabel = new Label(strprintf(_("Name: %s"), "")); mLevelLabel = new Label(strprintf(_("Level: %d"), 0)); + mChangePasswordButton = new Button(_("Change Password"), "change_password", this); #ifdef TMWSERV_SUPPORT mNewCharButton = new Button(_("New"), "new", this); mDelCharButton = new Button(_("Delete"), "delete", this); mUnRegisterButton = new Button(_("Unregister"), "unregister", this); - mChangePasswordButton = new Button(_("Change Password"), "change_password", this); mChangeEmailButton = new Button(_("Change Email Address"), "change_email", this); - mAccountNameLabel = new Label(strprintf(_("Account: %s"), mLoginData->username.c_str())); mNameLabel = new Label(strprintf(_("Name: %s"), "")); mLevelLabel = new Label(strprintf(_("Level: %d"), 0)); mMoneyLabel = new Label(strprintf(_("Money: %d"), 0)); @@ -169,13 +162,15 @@ CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo, ContainerPlacer place; place = getPlacer(0, 0); - + place(0, 0, mAccountNameLabel); + place(0, 1, mChangePasswordButton); + place = getPlacer(0, 1); place(0, 0, mPlayerBox, 1, 6).setPadding(3); - place(1, 0, mNewDelCharButton); - place(1, 1, mNameLabel, 5); - place(1, 2, mLevelLabel, 5); - place(1, 3, mJobLevelLabel, 5); - place(1, 4, mMoneyLabel, 5); + place(1, 0, mNameLabel, 5); + place(1, 1, mLevelLabel, 5); + place(1, 2, mJobLevelLabel, 5); + place(1, 3, mMoneyLabel, 5); + place(1, 4, mNewDelCharButton); place.getCell().matchColWidth(1, 4); place = getPlacer(0, 2); place(0, 0, mPreviousButton); @@ -276,15 +271,15 @@ void CharSelectDialog::action(const gcn::ActionEvent &event) if (pi) mMoney = Units::formatCurrency(pi->getMoney()); } + else if (event.getId() == "change_password") + { + new ChangePasswordDialog(this, mLoginData); + } #ifdef TMWSERV_SUPPORT else if (event.getId() == "unregister") { new UnRegisterDialog(this, mLoginData); } - else if (event.getId() == "change_password") - { - new ChangePasswordDialog(this, mLoginData); - } else if (event.getId() == "change_email") { new ChangeEmailDialog(this, mLoginData); diff --git a/src/gui/charselectdialog.h b/src/gui/charselectdialog.h index adbf3de1..06ce4b55 100644 --- a/src/gui/charselectdialog.h +++ b/src/gui/charselectdialog.h @@ -47,13 +47,8 @@ class CharSelectDialog : public Window, public gcn::ActionListener /** * Constructor. */ -#ifdef TMWSERV_SUPPORT CharSelectDialog(LockedArray<LocalPlayer*> *charInfo, LoginData *loginData); -#else - CharSelectDialog(LockedArray<LocalPlayer*> *charInfo, - Gender gender); -#endif void action(const gcn::ActionEvent &event); @@ -70,12 +65,16 @@ class CharSelectDialog : public Window, public gcn::ActionListener gcn::Button *mCancelButton; gcn::Button *mPreviousButton; gcn::Button *mNextButton; + gcn::Button *mChangePasswordButton; gcn::Label *mNameLabel; gcn::Label *mLevelLabel; gcn::Label *mMoneyLabel; + gcn::Label *mAccountNameLabel; std::string mMoney; + LoginData *mLoginData; + PlayerBox *mPlayerBox; bool mCharSelected; @@ -84,11 +83,8 @@ class CharSelectDialog : public Window, public gcn::ActionListener gcn::Button *mNewCharButton; gcn::Button *mDelCharButton; gcn::Button *mUnRegisterButton; - gcn::Button *mChangePasswordButton; gcn::Button *mChangeEmailButton; - gcn::Label *mAccountNameLabel; - LoginData *mLoginData; #else gcn::Button *mNewDelCharButton; gcn::Label *mJobLevelLabel; |