From d6697d50c774292158a0e7c16ccbea27f65dbc1e Mon Sep 17 00:00:00 2001 From: XtraFear Date: Fri, 16 Nov 2012 15:16:50 -0500 Subject: [PATCH] Added option to toggle the display of On-Screen Display messages in the Interface tab. --- Source/Core/Core/Src/ConfigManager.cpp | 2 ++ Source/Core/Core/Src/CoreParameter.cpp | 2 +- Source/Core/Core/Src/CoreParameter.h | 2 +- Source/Core/DolphinWX/Src/ConfigMain.cpp | 10 ++++++++++ Source/Core/DolphinWX/Src/ConfigMain.h | 2 ++ Source/Core/VideoCommon/Src/OnScreenDisplay.cpp | 3 +++ 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index cb274b5e4b..27c809717f 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -161,6 +161,7 @@ void SConfig::SaveSettings() // Interface ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop); ini.Set("Interface", "UsePanicHandlers", m_LocalCoreStartupParameter.bUsePanicHandlers); + ini.Set("Interface", "OnScreenDisplayMessages", m_LocalCoreStartupParameter.bOnScreenDisplayMessages); ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor); ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor); ini.Set("Interface", "Theme", m_LocalCoreStartupParameter.iTheme); @@ -296,6 +297,7 @@ void SConfig::LoadSettings() // Interface ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, false); ini.Get("Interface", "UsePanicHandlers", &m_LocalCoreStartupParameter.bUsePanicHandlers, true); + ini.Get("Interface", "OnScreenDisplayMessages", &m_LocalCoreStartupParameter.bOnScreenDisplayMessages, true); ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false); ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false); ini.Get("Interface", "Theme", &m_LocalCoreStartupParameter.iTheme, 0); diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index ba72d47ffb..dee2452cb3 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -53,7 +53,7 @@ SCoreStartupParameter::SCoreStartupParameter() bFastDiscSpeed(false), SelectedLanguage(0), bWii(false), bDisableWiimoteSpeaker(false), bConfirmStop(false), bHideCursor(false), - bAutoHideCursor(false), bUsePanicHandlers(true), + bAutoHideCursor(false), bUsePanicHandlers(true), bOnScreenDisplayMessages(true), iRenderWindowXPos(-1), iRenderWindowYPos(-1), iRenderWindowWidth(640), iRenderWindowHeight(480), bRenderWindowAutoSize(false), bKeepWindowOnTop(false), diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index 2eb261b589..e67935906b 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -122,7 +122,7 @@ struct SCoreStartupParameter bool bDisableWiimoteSpeaker; // Interface settings - bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers; + bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers, bOnScreenDisplayMessages; // Hotkeys int iHotkey[NUM_HOTKEYS]; diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index ef82810019..76508daf7c 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -125,6 +125,7 @@ EVT_SLIDER(ID_VOLUME, CConfigMain::AudioSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::DisplaySettingsChanged) EVT_CHECKBOX(ID_INTERFACE_USEPANICHANDLERS, CConfigMain::DisplaySettingsChanged) +EVT_CHECKBOX(ID_INTERFACE_ONSCREENDISPLAYMESSAGES, CConfigMain::DisplaySettingsChanged) EVT_RADIOBOX(ID_INTERFACE_THEME, CConfigMain::DisplaySettingsChanged) EVT_CHOICE(ID_INTERFACE_LANG, CConfigMain::DisplaySettingsChanged) EVT_BUTTON(ID_HOTKEY_CONFIG, CConfigMain::DisplaySettingsChanged) @@ -337,6 +338,7 @@ void CConfigMain::InitializeGUIValues() // Display - Interface ConfirmStop->SetValue(startup_params.bConfirmStop); UsePanicHandlers->SetValue(startup_params.bUsePanicHandlers); + OnScreenDisplayMessages->SetValue(startup_params.bOnScreenDisplayMessages); Theme->SetSelection(startup_params.iTheme); // need redesign for (unsigned int i = 0; i < sizeof(langIds) / sizeof(wxLanguage); i++) @@ -490,6 +492,7 @@ void CConfigMain::InitializeGUITooltips() // Display - Interface ConfirmStop->SetToolTip(_("Show a confirmation box before stopping a game.")); UsePanicHandlers->SetToolTip(_("Show a message box when a potentially serious error has occured.\nDisabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin suddenly crashes without any explanation at all.")); + OnScreenDisplayMessages->SetToolTip(_("Show messages on the emulation screen area.\nThese messages include memory card writes, video backend and CPU information, and JIT cache clearing.")); // Display - Themes: Copyright notice Theme->SetItemToolTip(0, _("Created by Milosz Wlazlo [miloszwl@miloszwl.com, miloszwl.deviantart.com]")); @@ -579,6 +582,8 @@ void CConfigMain::CreateGUIControls() wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); UsePanicHandlers = new wxCheckBox(DisplayPage, ID_INTERFACE_USEPANICHANDLERS, _("Use Panic Handlers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + OnScreenDisplayMessages = new wxCheckBox(DisplayPage, ID_INTERFACE_ONSCREENDISPLAYMESSAGES, + _("On-Screen Display Messages"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); wxBoxSizer* sInterface = new wxBoxSizer(wxHORIZONTAL); sInterface->Add(TEXT_BOX(DisplayPage, _("Language:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); @@ -588,6 +593,7 @@ void CConfigMain::CreateGUIControls() sbInterface = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Interface Settings")); sbInterface->Add(ConfirmStop, 0, wxALL, 5); sbInterface->Add(UsePanicHandlers, 0, wxALL, 5); + sbInterface->Add(OnScreenDisplayMessages, 0, wxALL, 5); sbInterface->Add(Theme, 0, wxEXPAND | wxALL, 5); sbInterface->Add(sInterface, 0, wxEXPAND | wxALL, 5); @@ -865,6 +871,10 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event) SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers = UsePanicHandlers->IsChecked(); SetEnableAlert(UsePanicHandlers->IsChecked()); break; + case ID_INTERFACE_ONSCREENDISPLAYMESSAGES: + SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages = OnScreenDisplayMessages->IsChecked(); + SetEnableAlert(OnScreenDisplayMessages->IsChecked()); + break; case ID_INTERFACE_THEME: SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme = Theme->GetSelection(); main_frame->InitBitmaps(); diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h index eae9f8996d..9b5dbf4243 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.h +++ b/Source/Core/DolphinWX/Src/ConfigMain.h @@ -86,6 +86,7 @@ private: // Interface settings ID_INTERFACE_CONFIRMSTOP, ID_INTERFACE_USEPANICHANDLERS, + ID_INTERFACE_ONSCREENDISPLAYMESSAGES, ID_INTERFACE_THEME, ID_INTERFACE_LANG, ID_HOTKEY_CONFIG, @@ -163,6 +164,7 @@ private: // Interface wxCheckBox* ConfirmStop; wxCheckBox* UsePanicHandlers; + wxCheckBox* OnScreenDisplayMessages; wxRadioBox* Theme; wxChoice* InterfaceLang; wxButton* HotkeyConfig; diff --git a/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp b/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp index f24bfc31b3..10cf5b84af 100644 --- a/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp +++ b/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp @@ -19,6 +19,7 @@ #include "Common.h" +#include "ConfigManager.h" #include "OnScreenDisplay.h" #include "RenderBase.h" #include "Timer.h" @@ -47,6 +48,8 @@ void AddMessage(const char* pstr, u32 ms) void DrawMessages() { + if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages) return; + if (s_listMsgs.size() > 0) { int left = 25, top = 15;