1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 09:15:35 +00:00

Activated buttons in review dialog to go to the respective dialogs.

This commit is contained in:
Jan Borsodi 2010-10-23 01:00:07 +02:00
parent debf1e3c4f
commit 1c6b9a9b7b
4 changed files with 87 additions and 4 deletions

View file

@ -32,18 +32,22 @@ ReviewDialog::ReviewDialog(MWWorld::Environment& environment)
getWidget(nameWidget, "NameText");
getWidget(button, "NameButton");
button->setCaption(wm->getGameSettingString("sName", ""));
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onNameClicked);;
getWidget(raceWidget, "RaceText");
getWidget(button, "RaceButton");
button->setCaption(wm->getGameSettingString("sRace", ""));
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onRaceClicked);;
getWidget(classWidget, "ClassText");
getWidget(button, "ClassButton");
button->setCaption(wm->getGameSettingString("sClass", ""));
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onClassClicked);;
getWidget(birthSignWidget, "SignText");
getWidget(button, "SignButton");
button->setCaption(wm->getGameSettingString("sBirthSign", ""));
button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onBirthSignClicked);;
// Setup dynamic stats
getWidget(health, "Health");
@ -353,3 +357,23 @@ void ReviewDialog::onBackClicked(MyGUI::Widget* _sender)
{
eventBack();
}
void ReviewDialog::onNameClicked(MyGUI::Widget* _sender)
{
eventNameActivated();
}
void ReviewDialog::onRaceClicked(MyGUI::Widget* _sender)
{
eventRaceActivated();
}
void ReviewDialog::onClassClicked(MyGUI::Widget* _sender)
{
eventClassActivated();
}
void ReviewDialog::onBirthSignClicked(MyGUI::Widget* _sender)
{
eventBirthSignActivated();
}

View file

@ -56,10 +56,35 @@ namespace MWGui
*/
EventHandle_Void eventDone;
/** Event : Activate name dialog.\n
signature : void method()\n
*/
EventHandle_Void eventNameActivated;
/** Event : Activate race dialog.\n
signature : void method()\n
*/
EventHandle_Void eventRaceActivated;
/** Event : Activate class dialog.\n
signature : void method()\n
*/
EventHandle_Void eventClassActivated;
/** Event : Activate birth sign dialog.\n
signature : void method()\n
*/
EventHandle_Void eventBirthSignActivated;
protected:
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);
void onNameClicked(MyGUI::Widget* _sender);
void onRaceClicked(MyGUI::Widget* _sender);
void onClassClicked(MyGUI::Widget* _sender);
void onBirthSignClicked(MyGUI::Widget* _sender);
private:
enum ColorStyle
{

View file

@ -173,7 +173,7 @@ void WindowManager::updateVisible()
std::string sName = getGameSettingString("sName", "Name");
nameDialog->setTextLabel(sName);
nameDialog->setTextInput(playerName);
nameDialog->setNextButtonShow(nameChosen);
nameDialog->setNextButtonShow(nameChosen || reviewNext);
nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
nameDialog->open();
return;
@ -184,7 +184,7 @@ void WindowManager::updateVisible()
if (raceDialog)
removeDialog(raceDialog);
raceDialog = new RaceDialog(environment);
raceDialog->setNextButtonShow(raceChosen);
raceDialog->setNextButtonShow(raceChosen || reviewNext);
raceDialog->setRaceId(playerRaceId);
raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
raceDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onRaceDialogBack);
@ -214,7 +214,7 @@ void WindowManager::updateVisible()
if (pickClassDialog)
removeDialog(pickClassDialog);
pickClassDialog = new PickClassDialog(environment);
pickClassDialog->setNextButtonShow(classChosen);
pickClassDialog->setNextButtonShow(classChosen || reviewNext);
pickClassDialog->setClassId(playerClass.name);
pickClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogDone);
pickClassDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogBack);
@ -238,7 +238,7 @@ void WindowManager::updateVisible()
if (birthSignDialog)
removeDialog(birthSignDialog);
birthSignDialog = new BirthDialog(environment);
birthSignDialog->setNextButtonShow(birthSignChosen);
birthSignDialog->setNextButtonShow(birthSignChosen || reviewNext);
birthSignDialog->setBirthId(playerBirthSignId);
birthSignDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogDone);
birthSignDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogBack);
@ -280,6 +280,12 @@ void WindowManager::updateVisible()
reviewDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onReviewDialogDone);
reviewDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onReviewDialogBack);
reviewDialog->eventNameActivated = MyGUI::newDelegate(this, &WindowManager::onNameDialogActivate);
reviewDialog->eventRaceActivated = MyGUI::newDelegate(this, &WindowManager::onRaceDialogActivate);
reviewDialog->eventClassActivated = MyGUI::newDelegate(this, &WindowManager::onClassDialogActivate);
reviewDialog->eventBirthSignActivated = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogActivate);
reviewDialog->open();
return;
}
@ -778,3 +784,27 @@ void WindowManager::onReviewDialogBack()
setGuiMode(GM_Birth);
}
void WindowManager::onNameDialogActivate()
{
reviewNext = true;
setGuiMode(GM_Name);
}
void WindowManager::onRaceDialogActivate()
{
reviewNext = true;
setGuiMode(GM_Race);
}
void WindowManager::onClassDialogActivate()
{
reviewNext = true;
setGuiMode(GM_Class);
}
void WindowManager::onBirthSignDialogActivate()
{
reviewNext = true;
setGuiMode(GM_Birth);
}

View file

@ -279,6 +279,10 @@ namespace MWGui
// Character generation: Review dialog
void onReviewDialogDone();
void onReviewDialogBack();
void onNameDialogActivate();
void onRaceDialogActivate();
void onClassDialogActivate();
void onBirthSignDialogActivate();
};
template<typename T>