diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/char_select.cpp | 12 | ||||
-rw-r--r-- | src/gui/char_select.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 621dc461..7ce2a77d 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -69,7 +69,7 @@ void CharDeleteConfirm::action(const std::string &eventId) } CharSelectDialog::CharSelectDialog(Network *network, LockedArray<LocalPlayer*> *charInfo): - Window("Select Character"), mNetwork(network), mCharInfo(charInfo) + Window("Select Character"), mNetwork(network), mCharInfo(charInfo), mCharSelected(false) { selectButton = new Button("Ok"); cancelButton = new Button("Cancel"); @@ -146,6 +146,7 @@ void CharSelectDialog::action(const std::string& eventId) selectButton->setEnabled(false); previousButton->setEnabled(false); nextButton->setEnabled(false); + mCharSelected = true; attemptCharSelect(); } else if (eventId == "cancel") @@ -195,9 +196,12 @@ void CharSelectDialog::updatePlayerInfo() levelLabel->setCaption(levelCaption.str()); jobLevelLabel->setCaption(jobCaption.str()); moneyLabel->setCaption(moneyCaption.str()); - newCharButton->setEnabled(false); - delCharButton->setEnabled(true); - selectButton->setEnabled(true); + if (!mCharSelected) + { + newCharButton->setEnabled(false); + delCharButton->setEnabled(true); + selectButton->setEnabled(true); + } playerBox->hairStyle = pi->getHairStyle() - 1; playerBox->hairColor = pi->getHairColor() - 1; playerBox->showPlayer = true; diff --git a/src/gui/char_select.h b/src/gui/char_select.h index 94d69e06..0cfc4f94 100644 --- a/src/gui/char_select.h +++ b/src/gui/char_select.h @@ -71,6 +71,8 @@ class CharSelectDialog : public Window, public gcn::ActionListener PlayerBox *playerBox; + bool mCharSelected; + /** * Communicate character deletion to the server. */ |