diff --git a/Core/Config.cpp b/Core/Config.cpp index 2ef04d1cb8e2..e6e0c0adf139 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -461,6 +461,7 @@ static ConfigSetting generalSettings[] = { ConfigSetting("EnableStateUndo", &g_Config.bEnableStateUndo, &DefaultEnableStateUndo, true, true), ConfigSetting("RewindFlipFrequency", &g_Config.iRewindFlipFrequency, 0, true, true), + ConfigSetting("ShowOnScreenMessage", &g_Config.bShowOnScreenMessages, true, true, false), ConfigSetting("ShowRegionOnGameIcon", &g_Config.bShowRegionOnGameIcon, false), ConfigSetting("ShowIDOnGameIcon", &g_Config.bShowIDOnGameIcon, false), ConfigSetting("GameGridScale", &g_Config.fGameGridScale, 1.0), diff --git a/Core/Config.h b/Core/Config.h index 8a1f7bd7a05f..e876e402272e 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -238,6 +238,7 @@ struct Config { bool bShowRegionOnGameIcon; bool bShowIDOnGameIcon; float fGameGridScale; + bool bShowOnScreenMessages; // TODO: Maybe move to a separate theme system. uint32_t uItemStyleFg; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 3a3c5ddb45fc..7ddf06d161a4 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1071,7 +1071,7 @@ void EmuScreen::CreateViews() { saveStatePreview_->SetVisibility(V_GONE); saveStatePreview_->SetCanBeFocused(false); root_->Add(saveStatePreview_); - root_->Add(new OnScreenMessagesView(new AnchorLayoutParams((Size)bounds.w, (Size)bounds.h))); + onScreenMessagesView_ = root_->Add(new OnScreenMessagesView(new AnchorLayoutParams((Size)bounds.w, (Size)bounds.h))); GameInfoBGView *loadingBG = root_->Add(new GameInfoBGView(gamePath_, new AnchorLayoutParams(FILL_PARENT, FILL_PARENT))); TextView *loadingTextView = root_->Add(new TextView(sc->T(PSP_GetLoading()), new AnchorLayoutParams(bounds.centerX(), NONE, NONE, 40, true))); @@ -1142,11 +1142,12 @@ UI::EventReturn EmuScreen::OnChat(UI::EventParams& params) { } void EmuScreen::update() { - UIScreen::update(); + onScreenMessagesView_->SetVisibility(g_Config.bShowOnScreenMessages ? UI::Visibility::V_VISIBLE : UI::Visibility::V_GONE); - if (bootPending_) + if (bootPending_) { bootGame(gamePath_); + } // Simply forcibly update to the current screen size every frame. Doesn't cost much. // If bounds is set to be smaller than the actual pixel resolution of the display, respect that. diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 77a072f43380..69befa43b0e2 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -30,6 +30,7 @@ struct AxisInput; class AsyncImageFileView; +class OnScreenMessagesView; class EmuScreen : public UIScreen { public: @@ -106,6 +107,8 @@ class EmuScreen : public UIScreen { UI::TextView *loadingTextView_ = nullptr; UI::Button *cardboardDisableButton_ = nullptr; + OnScreenMessagesView *onScreenMessagesView_ = nullptr; + bool autoRotatingAnalogCW_ = false; bool autoRotatingAnalogCCW_ = false; }; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 3bb7820ec954..a19a6620d4b6 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1650,6 +1650,7 @@ void DeveloperToolsScreen::CreateViews() { list->Add(allowDebugger)->OnClick.Handle(this, &DeveloperToolsScreen::OnRemoteDebugger); allowDebugger->SetEnabledPtr(&canAllowDebugger_); + list->Add(new CheckBox(&g_Config.bShowOnScreenMessages, dev->T("Show on-screen messages"))); list->Add(new CheckBox(&g_Config.bEnableLogging, dev->T("Enable Logging")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLoggingChanged); list->Add(new CheckBox(&g_Config.bLogFrameDrops, dev->T("Log Dropped Frame Statistics"))); list->Add(new Choice(dev->T("Logging Channels")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLogConfig);