Navigation Menu

Skip to content

Commit

Permalink
ControllerEmu/BooleanSetting: Add exclusive flag
Browse files Browse the repository at this point in the history
  • Loading branch information
spycrab committed Jul 2, 2018
1 parent 9cfcbfa commit c7c93a8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
15 changes: 11 additions & 4 deletions Source/Core/InputCommon/ControllerEmu/Setting/BooleanSetting.cpp
Expand Up @@ -7,22 +7,29 @@
namespace ControllerEmu
{
BooleanSetting::BooleanSetting(const std::string& setting_name, const std::string& ui_name,
const bool default_value, const SettingType setting_type)
const bool default_value, const SettingType setting_type,
const bool exclusive)
: m_type(setting_type), m_name(setting_name), m_ui_name(ui_name),
m_default_value(default_value), m_value(default_value)
m_default_value(default_value), m_value(default_value), m_exclusive(exclusive)
{
}

BooleanSetting::BooleanSetting(const std::string& setting_name, const bool default_value,
const SettingType setting_type)
: BooleanSetting(setting_name, setting_name, default_value, setting_type)
const SettingType setting_type, const bool exclusive)
: BooleanSetting(setting_name, setting_name, default_value, setting_type, exclusive)
{
}

bool BooleanSetting::GetValue() const
{
return m_value;
}

bool BooleanSetting::IsExclusive() const
{
return m_exclusive;
}

void BooleanSetting::SetValue(bool value)
{
m_value = value;
Expand Down
11 changes: 9 additions & 2 deletions Source/Core/InputCommon/ControllerEmu/Setting/BooleanSetting.h
Expand Up @@ -15,17 +15,24 @@ class BooleanSetting
{
public:
BooleanSetting(const std::string& setting_name, const std::string& ui_name,
const bool default_value, const SettingType setting_type = SettingType::NORMAL);
const bool default_value, const SettingType setting_type = SettingType::NORMAL,
const bool exclusive = false);
BooleanSetting(const std::string& setting_name, const bool default_value,
const SettingType setting_type = SettingType::NORMAL);
const SettingType setting_type = SettingType::NORMAL,
const bool exclusive = false);

bool GetValue() const;
void SetValue(bool value);
bool IsExclusive() const;

const SettingType m_type;
const std::string m_name;
const std::string m_ui_name;
const bool m_default_value;
bool m_value;

private:
const bool m_exclusive;
};

} // namespace ControllerEmu

0 comments on commit c7c93a8

Please sign in to comment.