diff options
-rw-r--r-- | src/gui/char_select.cpp | 52 | ||||
-rw-r--r-- | src/gui/login.cpp | 14 | ||||
-rw-r--r-- | src/gui/updatewindow.cpp | 4 |
3 files changed, 38 insertions, 32 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index c15f3359..7bfa3c7a 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -68,7 +68,8 @@ CharDeleteConfirm::CharDeleteConfirm(CharSelectDialog *m): void CharDeleteConfirm::action(const gcn::ActionEvent &event) { //ConfirmDialog::action(event); - if (event.getId() == "yes") { + if (event.getId() == "yes") + { master->attemptCharDelete(); } ConfirmDialog::action(event); @@ -110,8 +111,8 @@ CharSelectDialog::CharSelectDialog(Network *network, place = getPlacer(0, 2); place(0, 0, mPreviousButton); place(1, 0, mNextButton); - place(4, 0, mSelectButton); - place(5, 0, mCancelButton); + place(4, 0, mCancelButton); + place(5, 0, mSelectButton); reflowLayout(250, 0); @@ -180,7 +181,8 @@ void CharSelectDialog::updatePlayerInfo() mSelectButton->setEnabled(true); } } - else { + else + { mNameLabel->setCaption(strprintf(_("Name: %s"), "")); mLevelLabel->setCaption(strprintf(_("Level: %d"), 0)); mJobLevelLabel->setCaption(strprintf(_("Job Level: %d"), 0)); @@ -282,8 +284,8 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot, Network *network, place(3, 2, mNextHairColorButton); place.getCell().matchColWidth(0, 2); place = getPlacer(0, 2); - place(4, 0, mCreateButton); - place(5, 0, mCancelButton); + place(4, 0, mCancelButton); + place(5, 0, mCreateButton); reflowLayout(225, 0); @@ -303,32 +305,36 @@ CharCreateDialog::~CharCreateDialog() void CharCreateDialog::action(const gcn::ActionEvent &event) { int numberOfColors = ColorDB::size(); - if (event.getId() == "create") { - if (getName().length() >= 4) { + if (event.getId() == "create") + { + if (getName().length() >= 4) + { // Attempt to create the character mCreateButton->setEnabled(false); attemptCharCreate(); } - else { + else + { new OkDialog("Error", "Your name needs to be at least 4 characters.", this); } } - else if (event.getId() == "cancel") { + else if (event.getId() == "cancel") scheduleDelete(); - } - else if (event.getId() == "nextcolor") { - mPlayer->setHairStyle(mPlayer->getHairStyle(), (mPlayer->getHairColor() + 1) % numberOfColors); - } - else if (event.getId() == "prevcolor") { - mPlayer->setHairStyle(mPlayer->getHairStyle(), (mPlayer->getHairColor() + numberOfColors - 1) % numberOfColors); - } - else if (event.getId() == "nextstyle") { - mPlayer->setHairStyle(mPlayer->getHairStyle() + 1, mPlayer->getHairColor()); - } - else if (event.getId() == "prevstyle") { - mPlayer->setHairStyle(mPlayer->getHairStyle() + mPlayer->getNumOfHairstyles() - 1, mPlayer->getHairColor()); - } + else if (event.getId() == "nextcolor") + mPlayer->setHairStyle(mPlayer->getHairStyle(), + (mPlayer->getHairColor() + 1) % numberOfColors); + else if (event.getId() == "prevcolor") + mPlayer->setHairStyle(mPlayer->getHairStyle(), + (mPlayer->getHairColor() + numberOfColors - 1) % + numberOfColors); + else if (event.getId() == "nextstyle") + mPlayer->setHairStyle(mPlayer->getHairStyle() + 1, + mPlayer->getHairColor()); + else if (event.getId() == "prevstyle") + mPlayer->setHairStyle(mPlayer->getHairStyle() + + mPlayer->getNumOfHairstyles() - 1, + mPlayer->getHairColor()); } std::string CharCreateDialog::getName() diff --git a/src/gui/login.cpp b/src/gui/login.cpp index bba69754..eddae739 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -99,15 +99,15 @@ LoginDialog::LoginDialog(LoginData *loginData): place(0, 2, serverLabel); place(0, 3, portLabel); place(0, 4, dropdownLabel); - place(1, 0, mUserField, 3).setPadding(2); - place(1, 1, mPassField, 3).setPadding(2); - place(1, 2, mServerField, 3).setPadding(2); - place(1, 3, mPortField, 3).setPadding(2); - place(1, 4, mServerDropDown, 3).setPadding(2); + place(1, 0, mUserField, 3).setPadding(1); + place(1, 1, mPassField, 3).setPadding(1); + place(1, 2, mServerField, 3).setPadding(1); + place(1, 3, mPortField, 3).setPadding(1); + place(1, 4, mServerDropDown, 3).setPadding(1); place(0, 5, mKeepCheck, 4); place(0, 6, mRegisterButton).setHAlign(LayoutCell::LEFT); - place(2, 6, mOkButton); - place(3, 6, mCancelButton); + place(2, 6, mCancelButton); + place(3, 6, mOkButton); reflowLayout(250, 0); setLocationRelativeTo(getParent()); diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 9311b59b..ba802876 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -123,8 +123,8 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost, place(0, 0, mScrollArea, 5, 3).setPadding(3); place(0, 3, mLabel, 5); place(0, 4, mProgressBar, 5); - place(0, 5, mCancelButton); - place(1, 5, mPlayButton); + place(3, 5, mCancelButton); + place(4, 5, mPlayButton); reflowLayout(320, 240); |