mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 10:53:51 +00:00
Use one event with a parameters instead of four events to tell with dialog we want to see
This commit is contained in:
parent
a0ee11c51b
commit
5342bd77f1
4 changed files with 31 additions and 65 deletions
|
@ -352,20 +352,20 @@ void ReviewDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
void ReviewDialog::onNameClicked(MyGUI::Widget* _sender)
|
void ReviewDialog::onNameClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
eventNameActivated();
|
eventActivateDialog(NAME_DIALOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReviewDialog::onRaceClicked(MyGUI::Widget* _sender)
|
void ReviewDialog::onRaceClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
eventRaceActivated();
|
eventActivateDialog(RACE_DIALOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReviewDialog::onClassClicked(MyGUI::Widget* _sender)
|
void ReviewDialog::onClassClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
eventClassActivated();
|
eventActivateDialog(CLASS_DIALOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReviewDialog::onBirthSignClicked(MyGUI::Widget* _sender)
|
void ReviewDialog::onBirthSignClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
eventBirthSignActivated();
|
eventActivateDialog(BIRTHSIGN_DIALOG);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,12 @@ namespace MWGui
|
||||||
class ReviewDialog : public WindowBase
|
class ReviewDialog : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
enum Dialogs {
|
||||||
|
NAME_DIALOG,
|
||||||
|
RACE_DIALOG,
|
||||||
|
CLASS_DIALOG,
|
||||||
|
BIRTHSIGN_DIALOG
|
||||||
|
};
|
||||||
typedef std::vector<int> SkillList;
|
typedef std::vector<int> SkillList;
|
||||||
|
|
||||||
ReviewDialog(MWWorld::Environment& environment);
|
ReviewDialog(MWWorld::Environment& environment);
|
||||||
|
@ -44,6 +50,7 @@ namespace MWGui
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
typedef delegates::CDelegate0 EventHandle_Void;
|
||||||
|
typedef delegates::CDelegate1<int> EventHandle_Int;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -55,25 +62,7 @@ namespace MWGui
|
||||||
*/
|
*/
|
||||||
EventHandle_Void eventDone;
|
EventHandle_Void eventDone;
|
||||||
|
|
||||||
/** Event : Activate name dialog.\n
|
EventHandle_Int eventActivateDialog;
|
||||||
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:
|
protected:
|
||||||
void onOkClicked(MyGUI::Widget* _sender);
|
void onOkClicked(MyGUI::Widget* _sender);
|
||||||
|
|
|
@ -297,12 +297,7 @@ void WindowManager::updateVisible()
|
||||||
|
|
||||||
reviewDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onReviewDialogDone);
|
reviewDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onReviewDialogDone);
|
||||||
reviewDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onReviewDialogBack);
|
reviewDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onReviewDialogBack);
|
||||||
|
reviewDialog->eventActivateDialog = MyGUI::newDelegate(this, &WindowManager::onReviewActivateDialog);
|
||||||
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();
|
reviewDialog->open();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -968,39 +963,24 @@ void WindowManager::onReviewDialogBack()
|
||||||
setGuiMode(GM_Birth);
|
setGuiMode(GM_Birth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::onNameDialogActivate()
|
void WindowManager::onReviewActivateDialog(int parDialog)
|
||||||
{
|
{
|
||||||
if (reviewDialog)
|
if (reviewDialog)
|
||||||
removeDialog(reviewDialog);
|
removeDialog(reviewDialog);
|
||||||
|
|
||||||
reviewNext = true;
|
reviewNext = true;
|
||||||
setGuiMode(GM_Name);
|
|
||||||
|
switch(parDialog)
|
||||||
|
{
|
||||||
|
case ReviewDialog::NAME_DIALOG:
|
||||||
|
setGuiMode(GM_Name);
|
||||||
|
break;
|
||||||
|
case ReviewDialog::RACE_DIALOG:
|
||||||
|
setGuiMode(GM_Race);
|
||||||
|
break;
|
||||||
|
case ReviewDialog::CLASS_DIALOG:
|
||||||
|
setGuiMode(GM_Class);
|
||||||
|
break;
|
||||||
|
case ReviewDialog::BIRTHSIGN_DIALOG:
|
||||||
|
setGuiMode(GM_Birth);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::onRaceDialogActivate()
|
|
||||||
{
|
|
||||||
if (reviewDialog)
|
|
||||||
removeDialog(reviewDialog);
|
|
||||||
|
|
||||||
reviewNext = true;
|
|
||||||
setGuiMode(GM_Race);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WindowManager::onClassDialogActivate()
|
|
||||||
{
|
|
||||||
if (reviewDialog)
|
|
||||||
removeDialog(reviewDialog);
|
|
||||||
|
|
||||||
reviewNext = true;
|
|
||||||
setGuiMode(GM_Class);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WindowManager::onBirthSignDialogActivate()
|
|
||||||
{
|
|
||||||
if (reviewDialog)
|
|
||||||
removeDialog(reviewDialog);
|
|
||||||
|
|
||||||
reviewNext = true;
|
|
||||||
setGuiMode(GM_Birth);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -291,10 +291,7 @@ namespace MWGui
|
||||||
// Character generation: Review dialog
|
// Character generation: Review dialog
|
||||||
void onReviewDialogDone();
|
void onReviewDialogDone();
|
||||||
void onReviewDialogBack();
|
void onReviewDialogBack();
|
||||||
void onNameDialogActivate();
|
void onReviewActivateDialog(int parDialog);
|
||||||
void onRaceDialogActivate();
|
|
||||||
void onClassDialogActivate();
|
|
||||||
void onBirthSignDialogActivate();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
Loading…
Reference in a new issue