Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added option to toggle the display of On-Screen Display messages in t…
…he Interface tab.
  • Loading branch information
TotalNerd authored and neobrain committed Nov 16, 2012
1 parent a135512 commit d6697d5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Source/Core/Core/Src/ConfigManager.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/CoreParameter.cpp
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/CoreParameter.h
Expand Up @@ -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];
Expand Down
10 changes: 10 additions & 0 deletions Source/Core/DolphinWX/Src/ConfigMain.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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++)
Expand Down Expand Up @@ -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]"));
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/Src/ConfigMain.h
Expand Up @@ -86,6 +86,7 @@ class CConfigMain : public wxDialog
// Interface settings
ID_INTERFACE_CONFIRMSTOP,
ID_INTERFACE_USEPANICHANDLERS,
ID_INTERFACE_ONSCREENDISPLAYMESSAGES,
ID_INTERFACE_THEME,
ID_INTERFACE_LANG,
ID_HOTKEY_CONFIG,
Expand Down Expand Up @@ -163,6 +164,7 @@ class CConfigMain : public wxDialog
// Interface
wxCheckBox* ConfirmStop;
wxCheckBox* UsePanicHandlers;
wxCheckBox* OnScreenDisplayMessages;
wxRadioBox* Theme;
wxChoice* InterfaceLang;
wxButton* HotkeyConfig;
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/VideoCommon/Src/OnScreenDisplay.cpp
Expand Up @@ -19,6 +19,7 @@

#include "Common.h"

#include "ConfigManager.h"
#include "OnScreenDisplay.h"
#include "RenderBase.h"
#include "Timer.h"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d6697d5

Please sign in to comment.