Added option to toggle the display of On-Screen Display messages in the Interface tab.

This commit is contained in:
XtraFear 2012-11-16 15:16:50 -05:00 committed by NeoBrainX
parent a135512f9b
commit d6697d50c7
6 changed files with 19 additions and 2 deletions

View File

@ -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);

View File

@ -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),

View File

@ -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];

View File

@ -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();

View File

@ -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;

View File

@ -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;