forked from teamnwah/openmw-tes3coop
Fix #1207: Remember previous choice in class creation dialog
This commit is contained in:
parent
1da19585dc
commit
b89463db09
1 changed files with 10 additions and 9 deletions
|
@ -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->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
||||||
|
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
||||||
|
}
|
||||||
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
||||||
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
|
||||||
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
|
||||||
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…
Reference in a new issue