|
|
|
@ -1149,17 +1149,13 @@ namespace MWInput
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool state = MWBase::Environment::get().getStateManager()->getState() == MWBase::StateManager::State_NoGame;
|
|
|
|
|
bool inGame = MWBase::Environment::get().getStateManager()->getState() != MWBase::StateManager::State_NoGame;
|
|
|
|
|
MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode();
|
|
|
|
|
|
|
|
|
|
if (mode == MWGui::GM_MainMenu || mode == MWGui::GM_Settings)
|
|
|
|
|
{
|
|
|
|
|
if ((inGame && mode == MWGui::GM_MainMenu) || mode == MWGui::GM_Settings)
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(state || mode == MWGui::GM_MainMenu)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (inGame && mode != MWGui::GM_MainMenu)
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_MainMenu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1172,19 +1168,12 @@ namespace MWInput
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode();
|
|
|
|
|
bool state = MWBase::Environment::get().getStateManager()->getState() == MWBase::StateManager::State_NoGame;
|
|
|
|
|
if (mode == MWGui::GM_Settings)
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (mode == MWGui::GM_MainMenu && !state)
|
|
|
|
|
{
|
|
|
|
|
bool inGame = MWBase::Environment::get().getStateManager()->getState() != MWBase::StateManager::State_NoGame;
|
|
|
|
|
|
|
|
|
|
if ((inGame && mode == MWGui::GM_MainMenu) || mode == MWGui::GM_Settings)
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
|
|
|
|
}
|
|
|
|
|
else if (mode == MWGui::GM_MainMenu)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (inGame && mode != MWGui::GM_Settings)
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|