1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Correct odd toggling menu behavior.

This commit is contained in:
Perry Hugh 2019-03-05 14:39:40 -08:00 committed by Bret Curtis
parent 088de40365
commit b8b7568ce5

View File

@ -1146,12 +1146,21 @@ namespace MWInput
bool state = MWBase::Environment::get().getStateManager()->getState() == MWBase::StateManager::State_NoGame;
MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode();
if (mode == MWGui::GM_Settings || (!state && mode == MWGui::GM_MainMenu))
if (mode == MWGui::GM_MainMenu)
{
if (MyGUI::InputManager::getInstance().isModalAny())
MWBase::Environment::get().getWindowManager()->exitCurrentModal();
MWBase::Environment::get().getWindowManager()->popGuiMode();
{
while (MyGUI::InputManager::getInstance().isModalAny())
{
MWBase::Environment::get().getWindowManager()->exitCurrentModal();
}
}
else if (!state)
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
else if (mode == MWGui::GM_Settings)
MWBase::Environment::get().getWindowManager()->popGuiMode();
if(state || mode == MWGui::GM_MainMenu)
return;