mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 20:49:41 +00:00
CharacterCreation refactoring
This commit is contained in:
parent
d00c75d428
commit
7fd1c2c2e2
2 changed files with 24 additions and 75 deletions
|
@ -330,20 +330,7 @@ namespace MWGui
|
||||||
|
|
||||||
updatePlayerHealth();
|
updatePlayerHealth();
|
||||||
|
|
||||||
//TODO This bit gets repeated a few times; wrap it in a function
|
handleDialogDone(CSE_ClassChosen, GM_Birth);
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
|
||||||
}
|
|
||||||
else if (mCreationStage >= CSE_ClassChosen)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCreationStage = CSE_ClassChosen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onPickClassDialogBack()
|
void CharacterCreation::onPickClassDialogBack()
|
||||||
|
@ -397,19 +384,7 @@ namespace MWGui
|
||||||
mNameDialog = 0;
|
mNameDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
handleDialogDone(CSE_NameChosen, GM_Race);
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
|
||||||
}
|
|
||||||
else if (mCreationStage >= CSE_NameChosen)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Race);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCreationStage = CSE_NameChosen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onRaceDialogBack()
|
void CharacterCreation::onRaceDialogBack()
|
||||||
|
@ -456,19 +431,7 @@ namespace MWGui
|
||||||
|
|
||||||
updatePlayerHealth();
|
updatePlayerHealth();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
handleDialogDone(CSE_RaceChosen, GM_Class);
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
|
||||||
}
|
|
||||||
else if (mCreationStage >= CSE_RaceChosen)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCreationStage = CSE_RaceChosen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onBirthSignDialogDone(WindowBase* parWindow)
|
void CharacterCreation::onBirthSignDialogDone(WindowBase* parWindow)
|
||||||
|
@ -484,15 +447,7 @@ namespace MWGui
|
||||||
|
|
||||||
updatePlayerHealth();
|
updatePlayerHealth();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
handleDialogDone(CSE_BirthSignChosen, GM_Review);
|
||||||
if (mCreationStage >= CSE_BirthSignChosen)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCreationStage = CSE_BirthSignChosen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onBirthSignDialogBack()
|
void CharacterCreation::onBirthSignDialogBack()
|
||||||
|
@ -543,19 +498,7 @@ namespace MWGui
|
||||||
|
|
||||||
updatePlayerHealth();
|
updatePlayerHealth();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
handleDialogDone(CSE_ClassChosen, GM_Birth);
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
|
||||||
}
|
|
||||||
else if (mCreationStage >= CSE_ClassChosen)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCreationStage = CSE_ClassChosen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onCreateClassDialogBack()
|
void CharacterCreation::onCreateClassDialogBack()
|
||||||
|
@ -711,19 +654,7 @@ namespace MWGui
|
||||||
|
|
||||||
updatePlayerHealth();
|
updatePlayerHealth();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
handleDialogDone(CSE_ClassChosen, GM_Birth);
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
|
||||||
}
|
|
||||||
else if (mCreationStage >= CSE_ClassChosen)
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mCreationStage = CSE_ClassChosen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterCreation::~CharacterCreation()
|
CharacterCreation::~CharacterCreation()
|
||||||
|
@ -739,4 +670,20 @@ namespace MWGui
|
||||||
delete mReviewDialog;
|
delete mReviewDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CharacterCreation::handleDialogDone(CSE currentStage, int nextMode)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
|
if (mCreationStage == CSE_ReviewNext)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
||||||
|
}
|
||||||
|
else if (mCreationStage >= currentStage)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->pushGuiMode((GuiMode)nextMode);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mCreationStage = currentStage;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,8 @@ namespace MWGui
|
||||||
};
|
};
|
||||||
|
|
||||||
CSE mCreationStage; // Which state the character creating is in, controls back/next/ok buttons
|
CSE mCreationStage; // Which state the character creating is in, controls back/next/ok buttons
|
||||||
|
|
||||||
|
void handleDialogDone(CSE currentStage, int nextMode);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue