mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
ControllerEmu: Virtualize settings
This will allow us to move Background Input to a global setting rather than a local setting.
This commit is contained in:
@ -43,6 +43,8 @@ void ControllerEmu::ControlGroup::LoadConfig(IniFile::Section *sec, const std::s
|
||||
// settings
|
||||
for (auto& s : settings)
|
||||
{
|
||||
if (s->is_virtual)
|
||||
continue;
|
||||
sec->Get(group + s->name, &s->value, s->default_value * 100);
|
||||
s->value /= 100;
|
||||
}
|
||||
@ -99,7 +101,11 @@ void ControllerEmu::ControlGroup::SaveConfig(IniFile::Section *sec, const std::s
|
||||
std::string group(base + name); group += "/";
|
||||
|
||||
for (auto& s : settings)
|
||||
{
|
||||
if (s->is_virtual)
|
||||
continue;
|
||||
sec->Set(group + s->name, s->value*100.0f, s->default_value*100.0f);
|
||||
}
|
||||
|
||||
for (auto& c : controls)
|
||||
{
|
||||
|
@ -94,12 +94,24 @@ public:
|
||||
, value(def_value)
|
||||
, default_value(def_value)
|
||||
, low(_low)
|
||||
, high(_high){}
|
||||
, high(_high)
|
||||
, is_virtual(false) {}
|
||||
|
||||
const std::string name;
|
||||
ControlState value;
|
||||
const ControlState default_value;
|
||||
const unsigned int low, high;
|
||||
bool is_virtual;
|
||||
|
||||
virtual void SetValue(ControlState new_value)
|
||||
{
|
||||
value = new_value;
|
||||
}
|
||||
|
||||
virtual ControlState GetValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
ControlGroup(const std::string& _name, const unsigned int _type = GROUP_TYPE_OTHER) : name(_name), type(_type) {}
|
||||
|
Reference in New Issue
Block a user