Merge pull request #2228 from Capostrophic/mainmenu

Fix main menu toggling again
pull/541/head
Bret Curtis 6 years ago committed by GitHub
commit 048cfdfac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1149,18 +1149,14 @@ 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;
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_MainMenu);
if (inGame && mode != MWGui::GM_MainMenu)
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_MainMenu);
}
void InputManager::toggleOptionsMenu()
@ -1172,20 +1168,13 @@ 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;
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Settings);
if (inGame && mode != MWGui::GM_Settings)
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Settings);
}
void InputManager::quickLoad() {

Loading…
Cancel
Save