mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Make ToggleMenus close open windows (Fixes #2045)
This commit is contained in:
parent
59cde9b431
commit
8103d25b09
1 changed files with 6 additions and 0 deletions
|
@ -210,6 +210,12 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
bool state = MWBase::Environment::get().getWindowManager()->toggleGui();
|
bool state = MWBase::Environment::get().getWindowManager()->toggleGui();
|
||||||
runtime.getContext().report(state ? "GUI -> On" : "GUI -> Off");
|
runtime.getContext().report(state ? "GUI -> On" : "GUI -> Off");
|
||||||
|
|
||||||
|
if (!state)
|
||||||
|
{
|
||||||
|
while (MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_None) // don't use isGuiMode, or we get an infinite loop for modal message boxes!
|
||||||
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue