2016-01-27 09:11:59 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
2016-04-13 07:34:19 +00:00
|
|
|
int CGuiSettings::m_RefCount = 0;
|
|
|
|
bool CGuiSettings::m_bCPURunning;
|
|
|
|
bool CGuiSettings::m_bAutoSleep;
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
CGuiSettings::CGuiSettings()
|
2016-04-13 07:34:19 +00:00
|
|
|
{
|
|
|
|
m_RefCount += 1;
|
|
|
|
if (m_RefCount == 1)
|
|
|
|
{
|
|
|
|
g_Settings->RegisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
|
|
|
|
RefreshSettings(NULL);
|
|
|
|
}
|
2016-01-27 09:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CGuiSettings::~CGuiSettings()
|
|
|
|
{
|
2016-04-13 07:34:19 +00:00
|
|
|
m_RefCount -= 1;
|
|
|
|
if (m_RefCount == 0)
|
|
|
|
{
|
|
|
|
g_Settings->UnregisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB((SettingID)(FirstUISettings + Setting_AutoSleep),NULL,RefreshSettings);
|
|
|
|
}
|
2016-01-27 09:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGuiSettings::RefreshSettings(void *)
|
|
|
|
{
|
2016-04-13 07:34:19 +00:00
|
|
|
m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
|
|
|
|
m_bAutoSleep = UISettingsLoadBool(Setting_AutoSleep);
|
2016-01-27 09:11:59 +00:00
|
|
|
}
|