mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -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:
@ -104,32 +104,32 @@ void PadSettingExtension::UpdateValue()
|
||||
extension->switch_extension = ((wxChoice*)wxcontrol)->GetSelection();
|
||||
}
|
||||
|
||||
PadSettingCheckBox::PadSettingCheckBox(wxWindow* const parent, ControlState& _value, const std::string& label)
|
||||
: PadSetting(new wxCheckBox(parent, -1, wxGetTranslation(StrToWxStr(label))))
|
||||
, value(_value)
|
||||
PadSettingCheckBox::PadSettingCheckBox(wxWindow* const parent, ControllerEmu::ControlGroup::Setting* const _setting)
|
||||
: PadSetting(new wxCheckBox(parent, -1, wxGetTranslation(StrToWxStr(_setting->name))))
|
||||
, setting(_setting)
|
||||
{
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
void PadSettingCheckBox::UpdateGUI()
|
||||
{
|
||||
((wxCheckBox*)wxcontrol)->SetValue(value > 0);
|
||||
((wxCheckBox*)wxcontrol)->SetValue(setting->GetValue());
|
||||
}
|
||||
|
||||
void PadSettingCheckBox::UpdateValue()
|
||||
{
|
||||
// 0.01 so its saved to the ini file as just 1. :(
|
||||
value = 0.01 * ((wxCheckBox*)wxcontrol)->GetValue();
|
||||
setting->SetValue(0.01 * ((wxCheckBox*)wxcontrol)->GetValue());
|
||||
}
|
||||
|
||||
void PadSettingSpin::UpdateGUI()
|
||||
{
|
||||
((wxSpinCtrl*)wxcontrol)->SetValue((int)(value * 100));
|
||||
((wxSpinCtrl*)wxcontrol)->SetValue((int)(setting->GetValue() * 100));
|
||||
}
|
||||
|
||||
void PadSettingSpin::UpdateValue()
|
||||
{
|
||||
value = float(((wxSpinCtrl*)wxcontrol)->GetValue()) / 100;
|
||||
setting->SetValue(float(((wxSpinCtrl*)wxcontrol)->GetValue()) / 100);
|
||||
}
|
||||
|
||||
ControlDialog::ControlDialog(GamepadPage* const parent, InputPlugin& plugin, ControllerInterface::ControlReference* const ref)
|
||||
@ -879,7 +879,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin
|
||||
//options
|
||||
for (auto& groupSetting : group->settings)
|
||||
{
|
||||
PadSettingCheckBox* setting_cbox = new PadSettingCheckBox(parent, groupSetting->value, groupSetting->name);
|
||||
PadSettingCheckBox* setting_cbox = new PadSettingCheckBox(parent, groupSetting.get());
|
||||
setting_cbox->wxcontrol->Bind(wxEVT_CHECKBOX, &GamepadPage::AdjustSetting, eventsink);
|
||||
options.push_back(setting_cbox);
|
||||
|
||||
|
Reference in New Issue
Block a user