mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:49:55 +00:00
Fix exiting savegamedialog with 'esc' when no game is running
This commit is contained in:
parent
d94235e3a7
commit
cd437f094d
4 changed files with 10 additions and 5 deletions
|
@ -210,6 +210,11 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainMenu::exit()
|
||||||
|
{
|
||||||
|
return MWBase::Environment::get().getStateManager()->getState() == MWBase::StateManager::State_Running;
|
||||||
|
}
|
||||||
|
|
||||||
void MainMenu::updateMenu()
|
void MainMenu::updateMenu()
|
||||||
{
|
{
|
||||||
setCoord(0,0, mWidth, mHeight);
|
setCoord(0,0, mWidth, mHeight);
|
||||||
|
|
|
@ -38,6 +38,8 @@ namespace MWGui
|
||||||
|
|
||||||
void onFrame(float dt);
|
void onFrame(float dt);
|
||||||
|
|
||||||
|
bool exit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const VFS::Manager* mVFS;
|
const VFS::Manager* mVFS;
|
||||||
|
|
||||||
|
|
|
@ -750,8 +750,8 @@ namespace MWGui
|
||||||
if (!window->exit())
|
if (!window->exit())
|
||||||
{
|
{
|
||||||
// unable to exit window, but give access to main menu
|
// unable to exit window, but give access to main menu
|
||||||
if (!MyGUI::InputManager::getInstance().isModalAny())
|
if (!MyGUI::InputManager::getInstance().isModalAny() && getMode() != GM_MainMenu)
|
||||||
pushGuiMode (MWGui::GM_MainMenu);
|
pushGuiMode (GM_MainMenu);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,8 +241,6 @@ namespace MWInput
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case A_GameMenu:
|
case A_GameMenu:
|
||||||
if(!(MWBase::Environment::get().getStateManager()->getState() != MWBase::StateManager::State_Running
|
|
||||||
&& MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_MainMenu))
|
|
||||||
toggleMainMenu ();
|
toggleMainMenu ();
|
||||||
break;
|
break;
|
||||||
case A_Screenshot:
|
case A_Screenshot:
|
||||||
|
|
Loading…
Reference in a new issue