ControllerEmu: Split the Setting class

The Setting class was used for both numeric values and booleans, and
other parts of the code had hacks to make it work with booleans.

By splitting Setting into NumericSetting and BooleanSetting, it is
clear which settings are numeric, and which are boolean, so there is
no need to guess by checking the default values or anything like that.
Also, booleans are stored as booleans in config files, instead of 1.0.
This commit is contained in:
Léo Lam 2016-07-11 19:35:32 +02:00
parent 7530a2d206
commit 5e829f4527
10 changed files with 172 additions and 141 deletions

View file

@ -222,9 +222,10 @@ HotkeyManager::HotkeyManager()
}
groups.emplace_back(m_options = new ControlGroup(_trans("Options")));
m_options->settings.emplace_back(
new ControlGroup::BackgroundInputSetting(_trans("Background Input")));
m_options->settings.emplace_back(new ControlGroup::IterateUI(_trans("Iterative Input")));
m_options->boolean_settings.emplace_back(
std::make_unique<ControlGroup::BackgroundInputSetting>(_trans("Background Input")));
m_options->boolean_settings.emplace_back(std::make_unique<ControlGroup::BooleanSetting>(
_trans("Iterative Input"), false, ControlGroup::SettingType::VIRTUAL));
}
HotkeyManager::~HotkeyManager()