Skip to content

Commit

Permalink
Merge pull request #13695 from hrydgard/hide-onscreen-messages
Browse files Browse the repository at this point in the history
Add developer setting "Show on-screen messages". Uncheck to hide them.
  • Loading branch information
hrydgard authored Nov 22, 2020
2 parents 52c31fb + 1640a39 commit 60734a2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions UI/EmuScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
struct AxisInput;

class AsyncImageFileView;
class OnScreenMessagesView;

class EmuScreen : public UIScreen {
public:
Expand Down Expand Up @@ -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;
};
1 change: 1 addition & 0 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 60734a2

Please sign in to comment.