@ -210,6 +210,12 @@ namespace MWScript
{
bool state = MWBase::Environment::get().getWindowManager()->toggleGui();
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();
}
};