diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index 072b73b50b..6bc54b3cc8 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -129,6 +129,8 @@ namespace MWBase virtual bool isConsoleMode() const = 0; + virtual bool isPostProcessorHudVisible() const = 0; + virtual void toggleVisible (MWGui::GuiWindow wnd) = 0; virtual void forceHide(MWGui::GuiWindow wnd) = 0; diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 42e2cc54d7..07a19cf733 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1520,6 +1520,11 @@ namespace MWGui return mConsole && mConsole->isVisible(); } + bool WindowManager::isPostProcessorHudVisible() const + { + return mPostProcessorHud->isVisible(); + } + MWGui::GuiMode WindowManager::getMode() const { if (mGuiModes.empty()) diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index ea45e34e94..1492453505 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -169,6 +169,8 @@ namespace MWGui bool isConsoleMode() const override; + bool isPostProcessorHudVisible() const override; + void toggleVisible(GuiWindow wnd) override; void forceHide(MWGui::GuiWindow wnd) override; diff --git a/apps/openmw/mwinput/actionmanager.cpp b/apps/openmw/mwinput/actionmanager.cpp index 30118555d3..458066a5ee 100644 --- a/apps/openmw/mwinput/actionmanager.cpp +++ b/apps/openmw/mwinput/actionmanager.cpp @@ -323,6 +323,12 @@ namespace MWInput return; } + if (MWBase::Environment::get().getWindowManager()->isPostProcessorHudVisible()) + { + MWBase::Environment::get().getWindowManager()->togglePostProcessorHud(); + return; + } + if (!MWBase::Environment::get().getWindowManager()->isGuiMode()) //No open GUIs, open up the MainMenu { MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);