mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 01:26:39 +00:00 
			
		
		
		
	Activated buttons in review dialog to go to the respective dialogs.
This commit is contained in:
		
							parent
							
								
									debf1e3c4f
								
							
						
					
					
						commit
						1c6b9a9b7b
					
				
					 4 changed files with 87 additions and 4 deletions
				
			
		| 
						 | 
					@ -32,18 +32,22 @@ ReviewDialog::ReviewDialog(MWWorld::Environment& environment)
 | 
				
			||||||
    getWidget(nameWidget, "NameText");
 | 
					    getWidget(nameWidget, "NameText");
 | 
				
			||||||
    getWidget(button, "NameButton");
 | 
					    getWidget(button, "NameButton");
 | 
				
			||||||
    button->setCaption(wm->getGameSettingString("sName", ""));
 | 
					    button->setCaption(wm->getGameSettingString("sName", ""));
 | 
				
			||||||
 | 
					    button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onNameClicked);;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    getWidget(raceWidget, "RaceText");
 | 
					    getWidget(raceWidget, "RaceText");
 | 
				
			||||||
    getWidget(button, "RaceButton");
 | 
					    getWidget(button, "RaceButton");
 | 
				
			||||||
    button->setCaption(wm->getGameSettingString("sRace", ""));
 | 
					    button->setCaption(wm->getGameSettingString("sRace", ""));
 | 
				
			||||||
 | 
					    button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onRaceClicked);;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    getWidget(classWidget, "ClassText");
 | 
					    getWidget(classWidget, "ClassText");
 | 
				
			||||||
    getWidget(button, "ClassButton");
 | 
					    getWidget(button, "ClassButton");
 | 
				
			||||||
    button->setCaption(wm->getGameSettingString("sClass", ""));
 | 
					    button->setCaption(wm->getGameSettingString("sClass", ""));
 | 
				
			||||||
 | 
					    button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onClassClicked);;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    getWidget(birthSignWidget, "SignText");
 | 
					    getWidget(birthSignWidget, "SignText");
 | 
				
			||||||
    getWidget(button, "SignButton");
 | 
					    getWidget(button, "SignButton");
 | 
				
			||||||
    button->setCaption(wm->getGameSettingString("sBirthSign", ""));
 | 
					    button->setCaption(wm->getGameSettingString("sBirthSign", ""));
 | 
				
			||||||
 | 
					    button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onBirthSignClicked);;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Setup dynamic stats
 | 
					    // Setup dynamic stats
 | 
				
			||||||
    getWidget(health, "Health");
 | 
					    getWidget(health, "Health");
 | 
				
			||||||
| 
						 | 
					@ -353,3 +357,23 @@ void ReviewDialog::onBackClicked(MyGUI::Widget* _sender)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    eventBack();
 | 
					    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();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -56,10 +56,35 @@ namespace MWGui
 | 
				
			||||||
        */
 | 
					        */
 | 
				
			||||||
        EventHandle_Void eventDone;
 | 
					        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:
 | 
					    protected:
 | 
				
			||||||
        void onOkClicked(MyGUI::Widget* _sender);
 | 
					        void onOkClicked(MyGUI::Widget* _sender);
 | 
				
			||||||
        void onBackClicked(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:
 | 
					    private:
 | 
				
			||||||
        enum ColorStyle
 | 
					        enum ColorStyle
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -173,7 +173,7 @@ void WindowManager::updateVisible()
 | 
				
			||||||
      std::string sName = getGameSettingString("sName", "Name");
 | 
					      std::string sName = getGameSettingString("sName", "Name");
 | 
				
			||||||
      nameDialog->setTextLabel(sName);
 | 
					      nameDialog->setTextLabel(sName);
 | 
				
			||||||
      nameDialog->setTextInput(playerName);
 | 
					      nameDialog->setTextInput(playerName);
 | 
				
			||||||
      nameDialog->setNextButtonShow(nameChosen);
 | 
					      nameDialog->setNextButtonShow(nameChosen || reviewNext);
 | 
				
			||||||
      nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
 | 
					      nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
 | 
				
			||||||
      nameDialog->open();
 | 
					      nameDialog->open();
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
| 
						 | 
					@ -184,7 +184,7 @@ void WindowManager::updateVisible()
 | 
				
			||||||
      if (raceDialog)
 | 
					      if (raceDialog)
 | 
				
			||||||
          removeDialog(raceDialog);
 | 
					          removeDialog(raceDialog);
 | 
				
			||||||
      raceDialog = new RaceDialog(environment);
 | 
					      raceDialog = new RaceDialog(environment);
 | 
				
			||||||
      raceDialog->setNextButtonShow(raceChosen);
 | 
					      raceDialog->setNextButtonShow(raceChosen || reviewNext);
 | 
				
			||||||
      raceDialog->setRaceId(playerRaceId);
 | 
					      raceDialog->setRaceId(playerRaceId);
 | 
				
			||||||
      raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
 | 
					      raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
 | 
				
			||||||
      raceDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onRaceDialogBack);
 | 
					      raceDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onRaceDialogBack);
 | 
				
			||||||
| 
						 | 
					@ -214,7 +214,7 @@ void WindowManager::updateVisible()
 | 
				
			||||||
      if (pickClassDialog)
 | 
					      if (pickClassDialog)
 | 
				
			||||||
          removeDialog(pickClassDialog);
 | 
					          removeDialog(pickClassDialog);
 | 
				
			||||||
      pickClassDialog = new PickClassDialog(environment);
 | 
					      pickClassDialog = new PickClassDialog(environment);
 | 
				
			||||||
      pickClassDialog->setNextButtonShow(classChosen);
 | 
					      pickClassDialog->setNextButtonShow(classChosen || reviewNext);
 | 
				
			||||||
      pickClassDialog->setClassId(playerClass.name);
 | 
					      pickClassDialog->setClassId(playerClass.name);
 | 
				
			||||||
      pickClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogDone);
 | 
					      pickClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogDone);
 | 
				
			||||||
      pickClassDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogBack);
 | 
					      pickClassDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogBack);
 | 
				
			||||||
| 
						 | 
					@ -238,7 +238,7 @@ void WindowManager::updateVisible()
 | 
				
			||||||
      if (birthSignDialog)
 | 
					      if (birthSignDialog)
 | 
				
			||||||
          removeDialog(birthSignDialog);
 | 
					          removeDialog(birthSignDialog);
 | 
				
			||||||
      birthSignDialog = new BirthDialog(environment);
 | 
					      birthSignDialog = new BirthDialog(environment);
 | 
				
			||||||
      birthSignDialog->setNextButtonShow(birthSignChosen);
 | 
					      birthSignDialog->setNextButtonShow(birthSignChosen || reviewNext);
 | 
				
			||||||
      birthSignDialog->setBirthId(playerBirthSignId);
 | 
					      birthSignDialog->setBirthId(playerBirthSignId);
 | 
				
			||||||
      birthSignDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogDone);
 | 
					      birthSignDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogDone);
 | 
				
			||||||
      birthSignDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogBack);
 | 
					      birthSignDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogBack);
 | 
				
			||||||
| 
						 | 
					@ -280,6 +280,12 @@ 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->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;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					@ -778,3 +784,27 @@ void WindowManager::onReviewDialogBack()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    setGuiMode(GM_Birth);
 | 
					    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);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -279,6 +279,10 @@ namespace MWGui
 | 
				
			||||||
    // Character generation: Review dialog
 | 
					    // Character generation: Review dialog
 | 
				
			||||||
    void onReviewDialogDone();
 | 
					    void onReviewDialogDone();
 | 
				
			||||||
    void onReviewDialogBack();
 | 
					    void onReviewDialogBack();
 | 
				
			||||||
 | 
					    void onNameDialogActivate();
 | 
				
			||||||
 | 
					    void onRaceDialogActivate();
 | 
				
			||||||
 | 
					    void onClassDialogActivate();
 | 
				
			||||||
 | 
					    void onBirthSignDialogActivate();
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  template<typename T>
 | 
					  template<typename T>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue