[Project64] Fix up plugin registering settings with default setting
This commit is contained in:
parent
bdc109b0b8
commit
ec23b07302
|
@ -46,7 +46,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, const char *
|
|||
}
|
||||
|
||||
CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting, bool DeleteOnDefault ) :
|
||||
m_KeyName(Name),
|
||||
m_KeyName(StripNameSection(Name)),
|
||||
m_DefaultStr(""),
|
||||
m_DefaultValue(0),
|
||||
m_DefaultSetting(DefaultSetting),
|
||||
|
|
|
@ -524,26 +524,35 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
|
|||
switch (DataType)
|
||||
{
|
||||
case Data_DWORD:
|
||||
if (DefaultID == Default_None)
|
||||
{
|
||||
SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId;
|
||||
_this->m_NextAutoSettingId += 1;
|
||||
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value));
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting));
|
||||
}
|
||||
else
|
||||
{
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID));
|
||||
if (DefaultID == Default_None)
|
||||
{
|
||||
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value));
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting));
|
||||
}
|
||||
else
|
||||
{
|
||||
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), DefaultID));
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Data_String:
|
||||
if (DefaultID == Default_None)
|
||||
{
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), ""));
|
||||
}
|
||||
else
|
||||
{
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID));
|
||||
SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId;
|
||||
_this->m_NextAutoSettingId += 1;
|
||||
if (DefaultID == Default_None)
|
||||
{
|
||||
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), ""));
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting));
|
||||
}
|
||||
else
|
||||
{
|
||||
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), DefaultID));
|
||||
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue