Fix not being able to exit dialogue using Escape when a Goodbye link appears

This commit is contained in:
scrawl 2014-07-13 06:42:24 +02:00
parent f2799ea1d9
commit 8b404ee255
3 changed files with 9 additions and 11 deletions

View file

@ -505,9 +505,10 @@ namespace MWDialogue
void DialogueManager::askQuestion (const std::string& question, int choice) void DialogueManager::askQuestion (const std::string& question, int choice)
{ {
mIsInChoice = true;
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
win->addChoice(question, choice); win->addChoice(question, choice);
mIsInChoice = true;
} }
void DialogueManager::goodbye() void DialogueManager::goodbye()

View file

@ -273,8 +273,13 @@ namespace MWGui
{ {
if ((!mEnabled || MWBase::Environment::get().getDialogueManager()->isInChoice()) if ((!mEnabled || MWBase::Environment::get().getDialogueManager()->isInChoice())
&& !mGoodbye) && !mGoodbye)
return; {
MWBase::Environment::get().getDialogueManager()->goodbyeSelected(); // in choice, not allowed to escape, but give access to main menu to allow loading other saves
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);
MWBase::Environment::get().getSoundManager()->pauseSounds (MWBase::SoundManager::Play_TypeSfx);
}
else
MWBase::Environment::get().getDialogueManager()->goodbyeSelected();
} }
void DialogueWindow::onWindowResize(MyGUI::Window* _sender) void DialogueWindow::onWindowResize(MyGUI::Window* _sender)

View file

@ -686,14 +686,6 @@ namespace MWInput
return; return;
} }
if(MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Dialogue) { //Give access to the main menu when at a choice in dialogue
if(MWBase::Environment::get().getDialogueManager()->isInChoice()) {
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);
MWBase::Environment::get().getSoundManager()->pauseSounds (MWBase::SoundManager::Play_TypeSfx);
return;
}
}
if(!MWBase::Environment::get().getWindowManager()->isGuiMode()) //No open GUIs, open up the MainMenu if(!MWBase::Environment::get().getWindowManager()->isGuiMode()) //No open GUIs, open up the MainMenu
{ {
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu); MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);