|
|
@ -6,26 +6,25 @@
|
|
|
|
#include "birth.hpp"
|
|
|
|
#include "birth.hpp"
|
|
|
|
#include "review.hpp"
|
|
|
|
#include "review.hpp"
|
|
|
|
#include "dialogue.hpp"
|
|
|
|
#include "dialogue.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
#include "mode.hpp"
|
|
|
|
#include "mode.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
using namespace MWGui;
|
|
|
|
using namespace MWGui;
|
|
|
|
|
|
|
|
|
|
|
|
CharacterCreation::CharacterCreation(WindowManager* _wm, MWWorld::Environment* _environment)
|
|
|
|
CharacterCreation::CharacterCreation(WindowManager* _wm, MWWorld::Environment* _environment)
|
|
|
|
: nameDialog(0)
|
|
|
|
: mNameDialog(0)
|
|
|
|
, raceDialog(0)
|
|
|
|
, mRaceDialog(0)
|
|
|
|
, dialogueWindow(0)
|
|
|
|
, mDialogueWindow(0)
|
|
|
|
, classChoiceDialog(0)
|
|
|
|
, mClassChoiceDialog(0)
|
|
|
|
, generateClassQuestionDialog(0)
|
|
|
|
, mGenerateClassQuestionDialog(0)
|
|
|
|
, generateClassResultDialog(0)
|
|
|
|
, mGenerateClassResultDialog(0)
|
|
|
|
, pickClassDialog(0)
|
|
|
|
, mPickClassDialog(0)
|
|
|
|
, createClassDialog(0)
|
|
|
|
, mCreateClassDialog(0)
|
|
|
|
, birthSignDialog(0)
|
|
|
|
, mBirthSignDialog(0)
|
|
|
|
, reviewDialog(0)
|
|
|
|
, mReviewDialog(0)
|
|
|
|
, wm(_wm)
|
|
|
|
, mWM(_wm)
|
|
|
|
, environment(_environment)
|
|
|
|
, mEnvironment(_environment)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
creationStage = NotStarted;
|
|
|
|
mCreationStage = CSE_NotStarted;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::spawnDialog(const char id)
|
|
|
|
void CharacterCreation::spawnDialog(const char id)
|
|
|
@ -33,210 +32,210 @@ void CharacterCreation::spawnDialog(const char id)
|
|
|
|
switch (id)
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case GM_Name:
|
|
|
|
case GM_Name:
|
|
|
|
if(nameDialog)
|
|
|
|
if(mNameDialog)
|
|
|
|
wm->removeDialog(nameDialog);
|
|
|
|
mWM->removeDialog(mNameDialog);
|
|
|
|
nameDialog = new TextInputDialog(*wm);
|
|
|
|
mNameDialog = new TextInputDialog(*mWM);
|
|
|
|
nameDialog->setTextLabel(wm->getGameSettingString("sName", "Name"));
|
|
|
|
mNameDialog->setTextLabel(mWM->getGameSettingString("sName", "Name"));
|
|
|
|
nameDialog->setTextInput(playerName);
|
|
|
|
mNameDialog->setTextInput(mPlayerName);
|
|
|
|
nameDialog->setNextButtonShow(creationStage >= NameChosen);
|
|
|
|
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
|
|
|
|
nameDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
|
|
|
mNameDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
|
|
|
nameDialog->open();
|
|
|
|
mNameDialog->open();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case GM_Race:
|
|
|
|
case GM_Race:
|
|
|
|
if (raceDialog)
|
|
|
|
if (mRaceDialog)
|
|
|
|
wm->removeDialog(raceDialog);
|
|
|
|
mWM->removeDialog(mRaceDialog);
|
|
|
|
raceDialog = new RaceDialog(*wm);
|
|
|
|
mRaceDialog = new RaceDialog(*mWM);
|
|
|
|
raceDialog->setNextButtonShow(creationStage >= RaceChosen);
|
|
|
|
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
|
|
|
|
raceDialog->setRaceId(playerRaceId);
|
|
|
|
mRaceDialog->setRaceId(mPlayerRaceId);
|
|
|
|
raceDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
|
|
|
mRaceDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
|
|
|
raceDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
|
|
|
|
mRaceDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
|
|
|
|
raceDialog->open();
|
|
|
|
mRaceDialog->open();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case GM_Class:
|
|
|
|
case GM_Class:
|
|
|
|
if (classChoiceDialog)
|
|
|
|
if (mClassChoiceDialog)
|
|
|
|
wm->removeDialog(classChoiceDialog);
|
|
|
|
mWM->removeDialog(mClassChoiceDialog);
|
|
|
|
classChoiceDialog = new ClassChoiceDialog(*wm);
|
|
|
|
mClassChoiceDialog = new ClassChoiceDialog(*mWM);
|
|
|
|
classChoiceDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
|
|
|
mClassChoiceDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
|
|
|
classChoiceDialog->open();
|
|
|
|
mClassChoiceDialog->open();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case GM_ClassPick:
|
|
|
|
case GM_ClassPick:
|
|
|
|
if (pickClassDialog)
|
|
|
|
if (mPickClassDialog)
|
|
|
|
wm->removeDialog(pickClassDialog);
|
|
|
|
mWM->removeDialog(mPickClassDialog);
|
|
|
|
pickClassDialog = new PickClassDialog(*wm);
|
|
|
|
mPickClassDialog = new PickClassDialog(*mWM);
|
|
|
|
pickClassDialog->setNextButtonShow(creationStage >= ClassChosen);
|
|
|
|
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
|
|
|
pickClassDialog->setClassId(playerClass.name);
|
|
|
|
mPickClassDialog->setClassId(mPlayerClass.name);
|
|
|
|
pickClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
|
|
|
mPickClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
|
|
|
pickClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
|
|
|
|
mPickClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
|
|
|
|
pickClassDialog->open();
|
|
|
|
mPickClassDialog->open();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case GM_Birth:
|
|
|
|
case GM_Birth:
|
|
|
|
if (birthSignDialog)
|
|
|
|
if (mBirthSignDialog)
|
|
|
|
wm->removeDialog(birthSignDialog);
|
|
|
|
mWM->removeDialog(mBirthSignDialog);
|
|
|
|
birthSignDialog = new BirthDialog(*wm);
|
|
|
|
mBirthSignDialog = new BirthDialog(*mWM);
|
|
|
|
birthSignDialog->setNextButtonShow(creationStage >= BirthSignChosen);
|
|
|
|
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
|
|
|
|
birthSignDialog->setBirthId(playerBirthSignId);
|
|
|
|
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
|
|
|
|
birthSignDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
|
|
|
mBirthSignDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
|
|
|
birthSignDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
|
|
|
|
mBirthSignDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
|
|
|
|
birthSignDialog->open();
|
|
|
|
mBirthSignDialog->open();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case GM_ClassCreate:
|
|
|
|
case GM_ClassCreate:
|
|
|
|
if (createClassDialog)
|
|
|
|
if (mCreateClassDialog)
|
|
|
|
wm->removeDialog(createClassDialog);
|
|
|
|
mWM->removeDialog(mCreateClassDialog);
|
|
|
|
createClassDialog = new CreateClassDialog(*wm);
|
|
|
|
mCreateClassDialog = new CreateClassDialog(*mWM);
|
|
|
|
createClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
|
|
|
mCreateClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
|
|
|
createClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
|
|
|
mCreateClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
|
|
|
createClassDialog->open();
|
|
|
|
mCreateClassDialog->open();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case GM_ClassGenerate:
|
|
|
|
case GM_ClassGenerate:
|
|
|
|
generateClassStep = 0;
|
|
|
|
mGenerateClassStep = 0;
|
|
|
|
generateClass = "";
|
|
|
|
mGenerateClass = "";
|
|
|
|
generateClassSpecializations[0] = 0;
|
|
|
|
mGenerateClassSpecializations[0] = 0;
|
|
|
|
generateClassSpecializations[1] = 0;
|
|
|
|
mGenerateClassSpecializations[1] = 0;
|
|
|
|
generateClassSpecializations[2] = 0;
|
|
|
|
mGenerateClassSpecializations[2] = 0;
|
|
|
|
showClassQuestionDialog();
|
|
|
|
showClassQuestionDialog();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case GM_Review:
|
|
|
|
case GM_Review:
|
|
|
|
if (reviewDialog)
|
|
|
|
if (mReviewDialog)
|
|
|
|
wm->removeDialog(reviewDialog);
|
|
|
|
mWM->removeDialog(mReviewDialog);
|
|
|
|
reviewDialog = new ReviewDialog(*wm);
|
|
|
|
mReviewDialog = new ReviewDialog(*mWM);
|
|
|
|
reviewDialog->setPlayerName(playerName);
|
|
|
|
mReviewDialog->setPlayerName(mPlayerName);
|
|
|
|
reviewDialog->setRace(playerRaceId);
|
|
|
|
mReviewDialog->setRace(mPlayerRaceId);
|
|
|
|
reviewDialog->setClass(playerClass);
|
|
|
|
mReviewDialog->setClass(mPlayerClass);
|
|
|
|
reviewDialog->setBirthSign(playerBirthSignId);
|
|
|
|
mReviewDialog->setBirthSign(mPlayerBirthSignId);
|
|
|
|
|
|
|
|
|
|
|
|
reviewDialog->setHealth(wm->getValue("HBar"));
|
|
|
|
mReviewDialog->setHealth(mWM->getValue("HBar"));
|
|
|
|
reviewDialog->setMagicka(wm->getValue("MBar"));
|
|
|
|
mReviewDialog->setMagicka(mWM->getValue("MBar"));
|
|
|
|
reviewDialog->setFatigue(wm->getValue("FBar"));
|
|
|
|
mReviewDialog->setFatigue(mWM->getValue("FBar"));
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator end = playerAttributes.end();
|
|
|
|
std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator end = mPlayerAttributes.end();
|
|
|
|
for (std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator it = playerAttributes.begin(); it != end; ++it)
|
|
|
|
for (std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator it = mPlayerAttributes.begin(); it != end; ++it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
reviewDialog->setAttribute(it->first, it->second);
|
|
|
|
mReviewDialog->setAttribute(it->first, it->second);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator end = playerSkillValues.end();
|
|
|
|
std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator end = mPlayerSkillValues.end();
|
|
|
|
for (std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator it = playerSkillValues.begin(); it != end; ++it)
|
|
|
|
for (std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator it = mPlayerSkillValues.begin(); it != end; ++it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
reviewDialog->setSkillValue(it->first, it->second);
|
|
|
|
mReviewDialog->setSkillValue(it->first, it->second);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
reviewDialog->configureSkills(playerMajorSkills, playerMinorSkills);
|
|
|
|
mReviewDialog->configureSkills(mPlayerMajorSkills, mPlayerMinorSkills);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
reviewDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
|
|
|
mReviewDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
|
|
|
reviewDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
|
|
|
|
mReviewDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
|
|
|
|
reviewDialog->eventActivateDialog = MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
|
|
|
|
mReviewDialog->eventActivateDialog = MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
|
|
|
|
reviewDialog->open();
|
|
|
|
mReviewDialog->open();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onReviewDialogDone(WindowBase* parWindow)
|
|
|
|
void CharacterCreation::onReviewDialogDone(WindowBase* parWindow)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (reviewDialog)
|
|
|
|
if (mReviewDialog)
|
|
|
|
wm->removeDialog(reviewDialog);
|
|
|
|
mWM->removeDialog(mReviewDialog);
|
|
|
|
|
|
|
|
|
|
|
|
wm->setGuiMode(GM_Game);
|
|
|
|
mWM->setGuiMode(GM_Game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onReviewDialogBack()
|
|
|
|
void CharacterCreation::onReviewDialogBack()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (reviewDialog)
|
|
|
|
if (mReviewDialog)
|
|
|
|
wm->removeDialog(reviewDialog);
|
|
|
|
mWM->removeDialog(mReviewDialog);
|
|
|
|
|
|
|
|
|
|
|
|
wm->setGuiMode(GM_Birth);
|
|
|
|
mWM->setGuiMode(GM_Birth);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onReviewActivateDialog(int parDialog)
|
|
|
|
void CharacterCreation::onReviewActivateDialog(int parDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (reviewDialog)
|
|
|
|
if (mReviewDialog)
|
|
|
|
wm->removeDialog(reviewDialog);
|
|
|
|
mWM->removeDialog(mReviewDialog);
|
|
|
|
creationStage = ReviewNext;
|
|
|
|
mCreationStage = CSE_ReviewNext;
|
|
|
|
|
|
|
|
|
|
|
|
switch(parDialog)
|
|
|
|
switch(parDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case ReviewDialog::NAME_DIALOG:
|
|
|
|
case ReviewDialog::NAME_DIALOG:
|
|
|
|
wm->setGuiMode(GM_Name);
|
|
|
|
mWM->setGuiMode(GM_Name);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ReviewDialog::RACE_DIALOG:
|
|
|
|
case ReviewDialog::RACE_DIALOG:
|
|
|
|
wm->setGuiMode(GM_Race);
|
|
|
|
mWM->setGuiMode(GM_Race);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ReviewDialog::CLASS_DIALOG:
|
|
|
|
case ReviewDialog::CLASS_DIALOG:
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ReviewDialog::BIRTHSIGN_DIALOG:
|
|
|
|
case ReviewDialog::BIRTHSIGN_DIALOG:
|
|
|
|
wm->setGuiMode(GM_Birth);
|
|
|
|
mWM->setGuiMode(GM_Birth);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onPickClassDialogDone(WindowBase* parWindow)
|
|
|
|
void CharacterCreation::onPickClassDialogDone(WindowBase* parWindow)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (pickClassDialog)
|
|
|
|
if (mPickClassDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const std::string &classId = pickClassDialog->getClassId();
|
|
|
|
const std::string &classId = mPickClassDialog->getClassId();
|
|
|
|
if (!classId.empty())
|
|
|
|
if (!classId.empty())
|
|
|
|
environment->mMechanicsManager->setPlayerClass(classId);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerClass(classId);
|
|
|
|
const ESM::Class *klass = environment->mWorld->getStore().classes.find(classId);
|
|
|
|
const ESM::Class *klass = mEnvironment->mWorld->getStore().classes.find(classId);
|
|
|
|
if (klass)
|
|
|
|
if (klass)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerClass = *klass;
|
|
|
|
mPlayerClass = *klass;
|
|
|
|
wm->setPlayerClass(playerClass);
|
|
|
|
mWM->setPlayerClass(mPlayerClass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wm->removeDialog(pickClassDialog);
|
|
|
|
mWM->removeDialog(mPickClassDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//TODO This bit gets repeated a few times; wrap it in a function
|
|
|
|
//TODO This bit gets repeated a few times; wrap it in a function
|
|
|
|
if (creationStage == ReviewNext)
|
|
|
|
if (mCreationStage == CSE_ReviewNext)
|
|
|
|
wm->setGuiMode(GM_Review);
|
|
|
|
mWM->setGuiMode(GM_Review);
|
|
|
|
else if (creationStage >= ClassChosen)
|
|
|
|
else if (mCreationStage >= CSE_ClassChosen)
|
|
|
|
wm->setGuiMode(GM_Birth);
|
|
|
|
mWM->setGuiMode(GM_Birth);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
creationStage = ClassChosen;
|
|
|
|
mCreationStage = CSE_ClassChosen;
|
|
|
|
wm->setGuiMode(GM_Game);
|
|
|
|
mWM->setGuiMode(GM_Game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onPickClassDialogBack()
|
|
|
|
void CharacterCreation::onPickClassDialogBack()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (pickClassDialog)
|
|
|
|
if (mPickClassDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const std::string classId = pickClassDialog->getClassId();
|
|
|
|
const std::string classId = mPickClassDialog->getClassId();
|
|
|
|
if (!classId.empty())
|
|
|
|
if (!classId.empty())
|
|
|
|
environment->mMechanicsManager->setPlayerClass(classId);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerClass(classId);
|
|
|
|
wm->removeDialog(pickClassDialog);
|
|
|
|
mWM->removeDialog(mPickClassDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onClassChoice(int _index)
|
|
|
|
void CharacterCreation::onClassChoice(int _index)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (classChoiceDialog)
|
|
|
|
if (mClassChoiceDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
wm->removeDialog(classChoiceDialog);
|
|
|
|
mWM->removeDialog(mClassChoiceDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch(_index)
|
|
|
|
switch(_index)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case ClassChoiceDialog::Class_Generate:
|
|
|
|
case ClassChoiceDialog::Class_Generate:
|
|
|
|
wm->setGuiMode(GM_ClassGenerate);
|
|
|
|
mWM->setGuiMode(GM_ClassGenerate);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ClassChoiceDialog::Class_Pick:
|
|
|
|
case ClassChoiceDialog::Class_Pick:
|
|
|
|
wm->setGuiMode(GM_ClassPick);
|
|
|
|
mWM->setGuiMode(GM_ClassPick);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ClassChoiceDialog::Class_Create:
|
|
|
|
case ClassChoiceDialog::Class_Create:
|
|
|
|
wm->setGuiMode(GM_ClassCreate);
|
|
|
|
mWM->setGuiMode(GM_ClassCreate);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ClassChoiceDialog::Class_Back:
|
|
|
|
case ClassChoiceDialog::Class_Back:
|
|
|
|
wm->setGuiMode(GM_Race);
|
|
|
|
mWM->setGuiMode(GM_Race);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -244,108 +243,108 @@ void CharacterCreation::onClassChoice(int _index)
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onNameDialogDone(WindowBase* parWindow)
|
|
|
|
void CharacterCreation::onNameDialogDone(WindowBase* parWindow)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nameDialog)
|
|
|
|
if (mNameDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerName = nameDialog->getTextInput();
|
|
|
|
mPlayerName = mNameDialog->getTextInput();
|
|
|
|
wm->setValue("name", playerName);
|
|
|
|
mWM->setValue("name", mPlayerName);
|
|
|
|
environment->mMechanicsManager->setPlayerName(playerName);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerName(mPlayerName);
|
|
|
|
wm->removeDialog(nameDialog);
|
|
|
|
mWM->removeDialog(mNameDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (creationStage == ReviewNext)
|
|
|
|
if (mCreationStage == CSE_ReviewNext)
|
|
|
|
wm->setGuiMode(GM_Review);
|
|
|
|
mWM->setGuiMode(GM_Review);
|
|
|
|
else if (creationStage >= NameChosen)
|
|
|
|
else if (mCreationStage >= CSE_NameChosen)
|
|
|
|
wm->setGuiMode(GM_Race);
|
|
|
|
mWM->setGuiMode(GM_Race);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
creationStage = NameChosen;
|
|
|
|
mCreationStage = CSE_NameChosen;
|
|
|
|
wm->setGuiMode(GM_Game);
|
|
|
|
mWM->setGuiMode(GM_Game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onRaceDialogBack()
|
|
|
|
void CharacterCreation::onRaceDialogBack()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (raceDialog)
|
|
|
|
if (mRaceDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerRaceId = raceDialog->getRaceId();
|
|
|
|
mPlayerRaceId = mRaceDialog->getRaceId();
|
|
|
|
if (!playerRaceId.empty())
|
|
|
|
if (!mPlayerRaceId.empty())
|
|
|
|
environment->mMechanicsManager->setPlayerRace(playerRaceId, raceDialog->getGender() == RaceDialog::GM_Male);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerRace(mPlayerRaceId, mRaceDialog->getGender() == RaceDialog::GM_Male);
|
|
|
|
wm->removeDialog(raceDialog);
|
|
|
|
mWM->removeDialog(mRaceDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wm->setGuiMode(GM_Name);
|
|
|
|
mWM->setGuiMode(GM_Name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
|
|
|
|
void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (raceDialog)
|
|
|
|
if (mRaceDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerRaceId = raceDialog->getRaceId();
|
|
|
|
mPlayerRaceId = mRaceDialog->getRaceId();
|
|
|
|
wm->setValue("race", playerRaceId);
|
|
|
|
mWM->setValue("race", mPlayerRaceId);
|
|
|
|
if (!playerRaceId.empty())
|
|
|
|
if (!mPlayerRaceId.empty())
|
|
|
|
environment->mMechanicsManager->setPlayerRace(playerRaceId, raceDialog->getGender() == RaceDialog::GM_Male);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerRace(mPlayerRaceId, mRaceDialog->getGender() == RaceDialog::GM_Male);
|
|
|
|
wm->removeDialog(raceDialog);
|
|
|
|
mWM->removeDialog(mRaceDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (creationStage == ReviewNext)
|
|
|
|
if (mCreationStage == CSE_ReviewNext)
|
|
|
|
wm->setGuiMode(GM_Review);
|
|
|
|
mWM->setGuiMode(GM_Review);
|
|
|
|
else if(creationStage >= RaceChosen)
|
|
|
|
else if(mCreationStage >= CSE_RaceChosen)
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
creationStage = RaceChosen;
|
|
|
|
mCreationStage = CSE_RaceChosen;
|
|
|
|
wm->setGuiMode(GM_Game);
|
|
|
|
mWM->setGuiMode(GM_Game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onBirthSignDialogDone(WindowBase* parWindow)
|
|
|
|
void CharacterCreation::onBirthSignDialogDone(WindowBase* parWindow)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (birthSignDialog)
|
|
|
|
if (mBirthSignDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerBirthSignId = birthSignDialog->getBirthId();
|
|
|
|
mPlayerBirthSignId = mBirthSignDialog->getBirthId();
|
|
|
|
wm->setBirthSign(playerBirthSignId);
|
|
|
|
mWM->setBirthSign(mPlayerBirthSignId);
|
|
|
|
if (!playerBirthSignId.empty())
|
|
|
|
if (!mPlayerBirthSignId.empty())
|
|
|
|
environment->mMechanicsManager->setPlayerBirthsign(playerBirthSignId);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerBirthsign(mPlayerBirthSignId);
|
|
|
|
wm->removeDialog(birthSignDialog);
|
|
|
|
mWM->removeDialog(mBirthSignDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (creationStage >= BirthSignChosen)
|
|
|
|
if (mCreationStage >= CSE_BirthSignChosen)
|
|
|
|
wm->setGuiMode(GM_Review);
|
|
|
|
mWM->setGuiMode(GM_Review);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
creationStage = BirthSignChosen;
|
|
|
|
mCreationStage = CSE_BirthSignChosen;
|
|
|
|
wm->setGuiMode(GM_Game);
|
|
|
|
mWM->setGuiMode(GM_Game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onBirthSignDialogBack()
|
|
|
|
void CharacterCreation::onBirthSignDialogBack()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (birthSignDialog)
|
|
|
|
if (mBirthSignDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
environment->mMechanicsManager->setPlayerBirthsign(birthSignDialog->getBirthId());
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerBirthsign(mBirthSignDialog->getBirthId());
|
|
|
|
wm->removeDialog(birthSignDialog);
|
|
|
|
mWM->removeDialog(mBirthSignDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
|
|
|
|
void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (createClassDialog)
|
|
|
|
if (mCreateClassDialog)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ESM::Class klass;
|
|
|
|
ESM::Class klass;
|
|
|
|
klass.name = createClassDialog->getName();
|
|
|
|
klass.name = mCreateClassDialog->getName();
|
|
|
|
klass.description = createClassDialog->getDescription();
|
|
|
|
klass.description = mCreateClassDialog->getDescription();
|
|
|
|
klass.data.specialization = createClassDialog->getSpecializationId();
|
|
|
|
klass.data.specialization = mCreateClassDialog->getSpecializationId();
|
|
|
|
klass.data.isPlayable = 0x1;
|
|
|
|
klass.data.isPlayable = 0x1;
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<int> attributes = createClassDialog->getFavoriteAttributes();
|
|
|
|
std::vector<int> attributes = mCreateClassDialog->getFavoriteAttributes();
|
|
|
|
assert(attributes.size() == 2);
|
|
|
|
assert(attributes.size() == 2);
|
|
|
|
klass.data.attribute[0] = attributes[0];
|
|
|
|
klass.data.attribute[0] = attributes[0];
|
|
|
|
klass.data.attribute[1] = attributes[1];
|
|
|
|
klass.data.attribute[1] = attributes[1];
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<ESM::Skill::SkillEnum> majorSkills = createClassDialog->getMajorSkills();
|
|
|
|
std::vector<ESM::Skill::SkillEnum> majorSkills = mCreateClassDialog->getMajorSkills();
|
|
|
|
std::vector<ESM::Skill::SkillEnum> minorSkills = createClassDialog->getMinorSkills();
|
|
|
|
std::vector<ESM::Skill::SkillEnum> minorSkills = mCreateClassDialog->getMinorSkills();
|
|
|
|
assert(majorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
|
|
|
|
assert(majorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
|
|
|
|
assert(minorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
|
|
|
|
assert(minorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
|
|
|
|
for (size_t i = 0; i < sizeof(klass.data.skills)/sizeof(klass.data.skills[0]); ++i)
|
|
|
|
for (size_t i = 0; i < sizeof(klass.data.skills)/sizeof(klass.data.skills[0]); ++i)
|
|
|
@ -353,56 +352,56 @@ void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
|
|
|
|
klass.data.skills[i][1] = majorSkills[i];
|
|
|
|
klass.data.skills[i][1] = majorSkills[i];
|
|
|
|
klass.data.skills[i][0] = minorSkills[i];
|
|
|
|
klass.data.skills[i][0] = minorSkills[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment->mMechanicsManager->setPlayerClass(klass);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerClass(klass);
|
|
|
|
playerClass = klass;
|
|
|
|
mPlayerClass = klass;
|
|
|
|
wm->setPlayerClass(klass);
|
|
|
|
mWM->setPlayerClass(klass);
|
|
|
|
|
|
|
|
|
|
|
|
wm->removeDialog(createClassDialog);
|
|
|
|
mWM->removeDialog(mCreateClassDialog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (creationStage == ReviewNext)
|
|
|
|
if (mCreationStage == CSE_ReviewNext)
|
|
|
|
wm->setGuiMode(GM_Review);
|
|
|
|
mWM->setGuiMode(GM_Review);
|
|
|
|
else if (creationStage >= ClassChosen)
|
|
|
|
else if (mCreationStage >= CSE_ClassChosen)
|
|
|
|
wm->setGuiMode(GM_Birth);
|
|
|
|
mWM->setGuiMode(GM_Birth);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
creationStage = ClassChosen;
|
|
|
|
mCreationStage = CSE_ClassChosen;
|
|
|
|
wm->setGuiMode(GM_Game);
|
|
|
|
mWM->setGuiMode(GM_Game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onCreateClassDialogBack()
|
|
|
|
void CharacterCreation::onCreateClassDialogBack()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (createClassDialog)
|
|
|
|
if (mCreateClassDialog)
|
|
|
|
wm->removeDialog(createClassDialog);
|
|
|
|
mWM->removeDialog(mCreateClassDialog);
|
|
|
|
|
|
|
|
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onClassQuestionChosen(int _index)
|
|
|
|
void CharacterCreation::onClassQuestionChosen(int _index)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (generateClassQuestionDialog)
|
|
|
|
if (mGenerateClassQuestionDialog)
|
|
|
|
wm->removeDialog(generateClassQuestionDialog);
|
|
|
|
mWM->removeDialog(mGenerateClassQuestionDialog);
|
|
|
|
if (_index < 0 || _index >= 3)
|
|
|
|
if (_index < 0 || _index >= 3)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ESM::Class::Specialization specialization = generateClassSteps[generateClassStep].specializations[_index];
|
|
|
|
ESM::Class::Specialization specialization = sGenerateClassSteps[mGenerateClassStep].mSpecializations[_index];
|
|
|
|
if (specialization == ESM::Class::Stealth)
|
|
|
|
if (specialization == ESM::Class::Stealth)
|
|
|
|
++generateClassSpecializations[0];
|
|
|
|
++mGenerateClassSpecializations[0];
|
|
|
|
else if (specialization == ESM::Class::Combat)
|
|
|
|
else if (specialization == ESM::Class::Combat)
|
|
|
|
++generateClassSpecializations[1];
|
|
|
|
++mGenerateClassSpecializations[1];
|
|
|
|
else if (specialization == ESM::Class::Magic)
|
|
|
|
else if (specialization == ESM::Class::Magic)
|
|
|
|
++generateClassSpecializations[2];
|
|
|
|
++mGenerateClassSpecializations[2];
|
|
|
|
++generateClassStep;
|
|
|
|
++mGenerateClassStep;
|
|
|
|
showClassQuestionDialog();
|
|
|
|
showClassQuestionDialog();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::showClassQuestionDialog()
|
|
|
|
void CharacterCreation::showClassQuestionDialog()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (generateClassStep == generateClassSteps.size())
|
|
|
|
if (mGenerateClassStep == sGenerateClassSteps.size())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static boost::array<ClassPoint, 23> classes = { {
|
|
|
|
static boost::array<ClassPoint, 23> classes = { {
|
|
|
|
{"Acrobat", {6, 2, 2}},
|
|
|
|
{"Acrobat", {6, 2, 2}},
|
|
|
@ -433,100 +432,100 @@ void CharacterCreation::showClassQuestionDialog()
|
|
|
|
int match = -1;
|
|
|
|
int match = -1;
|
|
|
|
for (unsigned i = 0; i < classes.size(); ++i)
|
|
|
|
for (unsigned i = 0; i < classes.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (generateClassSpecializations[0] == classes[i].points[0] &&
|
|
|
|
if (mGenerateClassSpecializations[0] == classes[i].points[0] &&
|
|
|
|
generateClassSpecializations[1] == classes[i].points[1] &&
|
|
|
|
mGenerateClassSpecializations[1] == classes[i].points[1] &&
|
|
|
|
generateClassSpecializations[2] == classes[i].points[2])
|
|
|
|
mGenerateClassSpecializations[2] == classes[i].points[2])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
match = i;
|
|
|
|
match = i;
|
|
|
|
generateClass = classes[i].id;
|
|
|
|
mGenerateClass = classes[i].id;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (match == -1)
|
|
|
|
if (match == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (generateClassSpecializations[0] >= 7)
|
|
|
|
if (mGenerateClassSpecializations[0] >= 7)
|
|
|
|
generateClass = "Thief";
|
|
|
|
mGenerateClass = "Thief";
|
|
|
|
else if (generateClassSpecializations[1] >= 7)
|
|
|
|
else if (mGenerateClassSpecializations[1] >= 7)
|
|
|
|
generateClass = "Warrior";
|
|
|
|
mGenerateClass = "Warrior";
|
|
|
|
else if (generateClassSpecializations[2] >= 7)
|
|
|
|
else if (mGenerateClassSpecializations[2] >= 7)
|
|
|
|
generateClass = "Mage";
|
|
|
|
mGenerateClass = "Mage";
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::cerr << "Failed to deduce class from chosen answers in generate class dialog" << std::endl;
|
|
|
|
std::cerr << "Failed to deduce class from chosen answers in generate class dialog" << std::endl;
|
|
|
|
generateClass = "Thief";
|
|
|
|
mGenerateClass = "Thief";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (generateClassResultDialog)
|
|
|
|
if (mGenerateClassResultDialog)
|
|
|
|
wm->removeDialog(generateClassResultDialog);
|
|
|
|
mWM->removeDialog(mGenerateClassResultDialog);
|
|
|
|
generateClassResultDialog = new GenerateClassResultDialog(*wm);
|
|
|
|
mGenerateClassResultDialog = new GenerateClassResultDialog(*mWM);
|
|
|
|
generateClassResultDialog->setClassId(generateClass);
|
|
|
|
mGenerateClassResultDialog->setClassId(mGenerateClass);
|
|
|
|
generateClassResultDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
|
|
|
|
mGenerateClassResultDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
|
|
|
|
generateClassResultDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
|
|
|
|
mGenerateClassResultDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
|
|
|
|
generateClassResultDialog->open();
|
|
|
|
mGenerateClassResultDialog->open();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (generateClassStep > generateClassSteps.size())
|
|
|
|
if (mGenerateClassStep > sGenerateClassSteps.size())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (generateClassQuestionDialog)
|
|
|
|
if (mGenerateClassQuestionDialog)
|
|
|
|
wm->removeDialog(generateClassQuestionDialog);
|
|
|
|
mWM->removeDialog(mGenerateClassQuestionDialog);
|
|
|
|
generateClassQuestionDialog = new InfoBoxDialog(*wm);
|
|
|
|
mGenerateClassQuestionDialog = new InfoBoxDialog(*mWM);
|
|
|
|
|
|
|
|
|
|
|
|
InfoBoxDialog::ButtonList buttons;
|
|
|
|
InfoBoxDialog::ButtonList buttons;
|
|
|
|
generateClassQuestionDialog->setText(generateClassSteps[generateClassStep].text);
|
|
|
|
mGenerateClassQuestionDialog->setText(sGenerateClassSteps[mGenerateClassStep].mText);
|
|
|
|
buttons.push_back(generateClassSteps[generateClassStep].buttons[0]);
|
|
|
|
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[0]);
|
|
|
|
buttons.push_back(generateClassSteps[generateClassStep].buttons[1]);
|
|
|
|
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[1]);
|
|
|
|
buttons.push_back(generateClassSteps[generateClassStep].buttons[2]);
|
|
|
|
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[2]);
|
|
|
|
generateClassQuestionDialog->setButtons(buttons);
|
|
|
|
mGenerateClassQuestionDialog->setButtons(buttons);
|
|
|
|
generateClassQuestionDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
|
|
|
|
mGenerateClassQuestionDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
|
|
|
|
generateClassQuestionDialog->open();
|
|
|
|
mGenerateClassQuestionDialog->open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onGenerateClassBack()
|
|
|
|
void CharacterCreation::onGenerateClassBack()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(creationStage < ClassChosen)
|
|
|
|
if(mCreationStage < CSE_ClassChosen)
|
|
|
|
creationStage = ClassChosen;
|
|
|
|
mCreationStage = CSE_ClassChosen;
|
|
|
|
|
|
|
|
|
|
|
|
if (generateClassResultDialog)
|
|
|
|
if (mGenerateClassResultDialog)
|
|
|
|
wm->removeDialog(generateClassResultDialog);
|
|
|
|
mWM->removeDialog(mGenerateClassResultDialog);
|
|
|
|
environment->mMechanicsManager->setPlayerClass(generateClass);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerClass(mGenerateClass);
|
|
|
|
|
|
|
|
|
|
|
|
wm->setGuiMode(GM_Class);
|
|
|
|
mWM->setGuiMode(GM_Class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
|
|
|
|
void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (generateClassResultDialog)
|
|
|
|
if (mGenerateClassResultDialog)
|
|
|
|
wm->removeDialog(generateClassResultDialog);
|
|
|
|
mWM->removeDialog(mGenerateClassResultDialog);
|
|
|
|
environment->mMechanicsManager->setPlayerClass(generateClass);
|
|
|
|
mEnvironment->mMechanicsManager->setPlayerClass(mGenerateClass);
|
|
|
|
|
|
|
|
|
|
|
|
if (creationStage == ReviewNext)
|
|
|
|
if (mCreationStage == CSE_ReviewNext)
|
|
|
|
wm->setGuiMode(GM_Review);
|
|
|
|
mWM->setGuiMode(GM_Review);
|
|
|
|
else if (creationStage >= ClassChosen)
|
|
|
|
else if (mCreationStage >= CSE_ClassChosen)
|
|
|
|
wm->setGuiMode(GM_Birth);
|
|
|
|
mWM->setGuiMode(GM_Birth);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
creationStage = ClassChosen;
|
|
|
|
mCreationStage = CSE_ClassChosen;
|
|
|
|
wm->setGuiMode(GM_Game);
|
|
|
|
mWM->setGuiMode(GM_Game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CharacterCreation::~CharacterCreation()
|
|
|
|
CharacterCreation::~CharacterCreation()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
delete nameDialog;
|
|
|
|
delete mNameDialog;
|
|
|
|
delete raceDialog;
|
|
|
|
delete mRaceDialog;
|
|
|
|
delete dialogueWindow;
|
|
|
|
delete mDialogueWindow;
|
|
|
|
delete classChoiceDialog;
|
|
|
|
delete mClassChoiceDialog;
|
|
|
|
delete generateClassQuestionDialog;
|
|
|
|
delete mGenerateClassQuestionDialog;
|
|
|
|
delete generateClassResultDialog;
|
|
|
|
delete mGenerateClassResultDialog;
|
|
|
|
delete pickClassDialog;
|
|
|
|
delete mPickClassDialog;
|
|
|
|
delete createClassDialog;
|
|
|
|
delete mCreateClassDialog;
|
|
|
|
delete birthSignDialog;
|
|
|
|
delete mBirthSignDialog;
|
|
|
|
delete reviewDialog;
|
|
|
|
delete mReviewDialog;
|
|
|
|
}
|
|
|
|
}
|
|
|
|