fix an infinite recursion regression on several dialogs.

This commit is contained in:
scrawl 2012-08-27 21:29:04 +02:00
parent 5c28a67203
commit 321f7c3419
13 changed files with 17 additions and 36 deletions

View file

@ -65,9 +65,9 @@ void BirthDialog::setNextButtonShow(bool shown)
void BirthDialog::open() void BirthDialog::open()
{ {
WindowBase::open();
updateBirths(); updateBirths();
updateSpells(); updateSpells();
setVisible(true);
} }

View file

@ -28,7 +28,7 @@ namespace MWGui
void setBirthId(const std::string &raceId); void setBirthId(const std::string &raceId);
void setNextButtonShow(bool shown); void setNextButtonShow(bool shown);
void open(); virtual void open();
// Events // Events
typedef delegates::CMultiDelegate0 EventHandle_Void; typedef delegates::CMultiDelegate0 EventHandle_Void;

View file

@ -194,7 +194,7 @@ void CharacterCreation::spawnDialog(const char id)
mNameDialog->setTextInput(mPlayerName); mNameDialog->setTextInput(mPlayerName);
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen); mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone); mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
mNameDialog->open(); mNameDialog->setVisible(true);
break; break;
case GM_Race: case GM_Race:
@ -205,7 +205,7 @@ void CharacterCreation::spawnDialog(const char id)
mRaceDialog->setRaceId(mPlayerRaceId); mRaceDialog->setRaceId(mPlayerRaceId);
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone); mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack); mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
mRaceDialog->open(); mRaceDialog->setVisible(true);;
break; break;
case GM_Class: case GM_Class:
@ -213,7 +213,7 @@ void CharacterCreation::spawnDialog(const char id)
mClassChoiceDialog = 0; mClassChoiceDialog = 0;
mClassChoiceDialog = new ClassChoiceDialog(*mWM); mClassChoiceDialog = new ClassChoiceDialog(*mWM);
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice); mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
mClassChoiceDialog->open(); mClassChoiceDialog->setVisible(true);
break; break;
case GM_ClassPick: case GM_ClassPick:
@ -224,7 +224,7 @@ void CharacterCreation::spawnDialog(const char id)
mPickClassDialog->setClassId(mPlayerClass.name); mPickClassDialog->setClassId(mPlayerClass.name);
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone); mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack); mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
mPickClassDialog->open(); mPickClassDialog->setVisible(true);
break; break;
case GM_Birth: case GM_Birth:
@ -234,7 +234,7 @@ void CharacterCreation::spawnDialog(const char id)
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen); mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone); mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack); mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
mBirthSignDialog->open(); mBirthSignDialog->setVisible(true);
break; break;
case GM_ClassCreate: case GM_ClassCreate:
@ -244,7 +244,7 @@ void CharacterCreation::spawnDialog(const char id)
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen); 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->open(); mCreateClassDialog->setVisible(true);
break; break;
case GM_ClassGenerate: case GM_ClassGenerate:
mGenerateClassStep = 0; mGenerateClassStep = 0;
@ -289,7 +289,7 @@ void CharacterCreation::spawnDialog(const char id)
mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone); mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack); mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog); mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
mReviewDialog->open(); mReviewDialog->setVisible(true);
break; break;
} }
} }
@ -680,7 +680,7 @@ void CharacterCreation::showClassQuestionDialog()
mGenerateClassResultDialog->setClassId(mGenerateClass); mGenerateClassResultDialog->setClassId(mGenerateClass);
mGenerateClassResultDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack); mGenerateClassResultDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
mGenerateClassResultDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone); mGenerateClassResultDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
mGenerateClassResultDialog->open(); mGenerateClassResultDialog->setVisible(true);
return; return;
} }
@ -703,7 +703,7 @@ void CharacterCreation::showClassQuestionDialog()
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[2]); buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[2]);
mGenerateClassQuestionDialog->setButtons(buttons); mGenerateClassQuestionDialog->setButtons(buttons);
mGenerateClassQuestionDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen); mGenerateClassQuestionDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
mGenerateClassQuestionDialog->open(); mGenerateClassQuestionDialog->setVisible(true);
MWBase::Environment::get().getSoundManager()->say(sGenerateClassSteps[mGenerateClassStep].mSound); MWBase::Environment::get().getSoundManager()->say(sGenerateClassSteps[mGenerateClassStep].mSound);
} }

View file

@ -46,11 +46,6 @@ GenerateClassResultDialog::GenerateClassResultDialog(MWBase::WindowManager& parW
backButton->setCoord(315 - okButtonWidth - backButtonWidth - 6, 219, backButtonWidth, 23); backButton->setCoord(315 - okButtonWidth - backButtonWidth - 6, 219, backButtonWidth, 23);
} }
void GenerateClassResultDialog::open()
{
setVisible(true);
}
std::string GenerateClassResultDialog::getClassId() const std::string GenerateClassResultDialog::getClassId() const
{ {
return mClassName->getCaption(); return mClassName->getCaption();
@ -143,7 +138,6 @@ void PickClassDialog::open()
{ {
updateClasses(); updateClasses();
updateStats(); updateStats();
setVisible(true);
} }
@ -341,7 +335,6 @@ void InfoBoxDialog::open()
layoutVertically(mMainWidget, 4 + 6); layoutVertically(mMainWidget, 4 + 6);
center(); center();
setVisible(true);
} }
int InfoBoxDialog::getChosenButton() const int InfoBoxDialog::getChosenButton() const
@ -549,11 +542,6 @@ void CreateClassDialog::setNextButtonShow(bool shown)
descriptionButton->setCoord(459 - okButtonWidth - backButtonWidth - descriptionButtonWidth - 12, 158, descriptionButtonWidth, 23); descriptionButton->setCoord(459 - okButtonWidth - backButtonWidth - descriptionButtonWidth - 12, 158, descriptionButtonWidth, 23);
} }
void CreateClassDialog::open()
{
setVisible(true);
}
// widget controls // widget controls
void CreateClassDialog::onDialogCancel() void CreateClassDialog::onDialogCancel()

View file

@ -26,7 +26,7 @@ namespace MWGui
std::string getText() const; std::string getText() const;
void setButtons(ButtonList &buttons); void setButtons(ButtonList &buttons);
void open(); virtual void open();
int getChosenButton() const; int getChosenButton() const;
// Events // Events
@ -74,8 +74,6 @@ namespace MWGui
std::string getClassId() const; std::string getClassId() const;
void setClassId(const std::string &classId); void setClassId(const std::string &classId);
void open();
// Events // Events
typedef delegates::CMultiDelegate0 EventHandle_Void; typedef delegates::CMultiDelegate0 EventHandle_Void;
@ -104,7 +102,7 @@ namespace MWGui
void setClassId(const std::string &classId); void setClassId(const std::string &classId);
void setNextButtonShow(bool shown); void setNextButtonShow(bool shown);
void open(); virtual void open();
// Events // Events
typedef delegates::CMultiDelegate0 EventHandle_Void; typedef delegates::CMultiDelegate0 EventHandle_Void;
@ -264,7 +262,6 @@ namespace MWGui
std::vector<ESM::Skill::SkillEnum> getMinorSkills() const; std::vector<ESM::Skill::SkillEnum> getMinorSkills() const;
void setNextButtonShow(bool shown); void setNextButtonShow(bool shown);
void open();
// Events // Events
typedef delegates::CMultiDelegate0 EventHandle_Void; typedef delegates::CMultiDelegate0 EventHandle_Void;

View file

@ -14,7 +14,7 @@ namespace MWGui
{ {
public: public:
JournalWindow(MWBase::WindowManager& parWindowManager); JournalWindow(MWBase::WindowManager& parWindowManager);
void open(); virtual void open();
virtual void setVisible(bool visible); // only used to play close sound virtual void setVisible(bool visible); // only used to play close sound

View file

@ -113,7 +113,6 @@ void RaceDialog::open()
updateRaces(); updateRaces();
updateSkills(); updateSkills();
updateSpellPowers(); updateSpellPowers();
setVisible(true);
} }

View file

@ -43,7 +43,7 @@ namespace MWGui
// setHair() // setHair()
void setNextButtonShow(bool shown); void setNextButtonShow(bool shown);
void open(); virtual void open();
// Events // Events
typedef delegates::CMultiDelegate0 EventHandle_Void; typedef delegates::CMultiDelegate0 EventHandle_Void;

View file

@ -110,7 +110,6 @@ ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
void ReviewDialog::open() void ReviewDialog::open()
{ {
updateSkillArea(); updateSkillArea();
setVisible(true);
} }
void ReviewDialog::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos) void ReviewDialog::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos)

View file

@ -46,7 +46,7 @@ namespace MWGui
void configureSkills(const SkillList& major, const SkillList& minor); void configureSkills(const SkillList& major, const SkillList& minor);
void setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::Stat<float>& value); void setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::Stat<float>& value);
void open(); virtual void open();
// Events // Events
typedef delegates::CMultiDelegate0 EventHandle_Void; typedef delegates::CMultiDelegate0 EventHandle_Void;

View file

@ -45,7 +45,6 @@ void TextInputDialog::open()
{ {
// Make sure the edit box has focus // Make sure the edit box has focus
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit); MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
setVisible(true);
} }
// widget controls // widget controls

View file

@ -25,7 +25,7 @@ namespace MWGui
void setNextButtonShow(bool shown); void setNextButtonShow(bool shown);
void setTextLabel(const std::string &label); void setTextLabel(const std::string &label);
void open(); virtual void open();
protected: protected:
void onOkClicked(MyGUI::Widget* _sender); void onOkClicked(MyGUI::Widget* _sender);

View file

@ -318,7 +318,6 @@ void WindowManager::updateVisible()
break; break;
case GM_Journal: case GM_Journal:
mJournal->setVisible(true); mJournal->setVisible(true);
mJournal->open();
break; break;
default: default:
// Unsupported mode, switch back to game // Unsupported mode, switch back to game