Fix #1207: Remember previous choice in class creation dialog

actorid
scrawl 11 years ago
parent 1da19585dc
commit b89463db09

@ -188,12 +188,13 @@ namespace MWGui
break; break;
case GM_ClassCreate: case GM_ClassCreate:
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog); if (!mCreateClassDialog)
mCreateClassDialog = 0; {
mCreateClassDialog = new CreateClassDialog(); mCreateClassDialog = new CreateClassDialog();
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone); mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack); mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
}
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
mCreateClassDialog->setVisible(true); mCreateClassDialog->setVisible(true);
if (mCreationStage < CSE_RaceChosen) if (mCreationStage < CSE_RaceChosen)
mCreationStage = CSE_RaceChosen; mCreationStage = CSE_RaceChosen;
@ -531,8 +532,8 @@ namespace MWGui
mPlayerClass = klass; mPlayerClass = klass;
MWBase::Environment::get().getWindowManager()->setPlayerClass(klass); MWBase::Environment::get().getWindowManager()->setPlayerClass(klass);
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog); // Do not delete dialog, so that choices are rembered in case we want to go back and adjust them later
mCreateClassDialog = 0; mCreateClassDialog->setVisible(false);
} }
updatePlayerHealth(); updatePlayerHealth();
@ -554,8 +555,8 @@ namespace MWGui
void CharacterCreation::onCreateClassDialogBack() void CharacterCreation::onCreateClassDialogBack()
{ {
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog); // Do not delete dialog, so that choices are rembered in case we want to go back and adjust them later
mCreateClassDialog = 0; mCreateClassDialog->setVisible(false);
MWBase::Environment::get().getWindowManager()->popGuiMode(); MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class); MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);

Loading…
Cancel
Save