summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/Control
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2018-04-10 17:22:30 +0200
committerJosJuice <josjuice@gmail.com>2018-04-13 13:04:26 +0200
commit7ed28297b237779f0e4b6d7045cd27e10a8cfb0e (patch)
treebca5d06f1fddf59b5e8b9f38af7f745b40f3beb9 /Source/Core/InputCommon/ControllerEmu/Control
parent3f13dbe0878523b65d158efddc3eff37d59ca3a2 (diff)
ControllerEmu: Use enum instead of bool for translatability
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/Control')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/Control/Control.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerEmu/Control/Control.h13
-rw-r--r--Source/Core/InputCommon/ControllerEmu/Control/Input.cpp4
-rw-r--r--Source/Core/InputCommon/ControllerEmu/Control/Input.h4
-rw-r--r--Source/Core/InputCommon/ControllerEmu/Control/Output.cpp4
-rw-r--r--Source/Core/InputCommon/ControllerEmu/Control/Output.h2
6 files changed, 21 insertions, 13 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/Control/Control.cpp b/Source/Core/InputCommon/ControllerEmu/Control/Control.cpp
index 7ea3ec27d5..20ae3a3cda 100644
--- a/Source/Core/InputCommon/ControllerEmu/Control/Control.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/Control/Control.cpp
@@ -9,13 +9,14 @@
namespace ControllerEmu
{
-Control::Control(std::unique_ptr<ControlReference> ref, bool translate_, const std::string& name_,
- const std::string& ui_name_)
+Control::Control(std::unique_ptr<ControlReference> ref, Translatability translate_,
+ const std::string& name_, const std::string& ui_name_)
: control_ref(std::move(ref)), translate(translate_), name(name_), ui_name(ui_name_)
{
}
-Control::Control(std::unique_ptr<ControlReference> ref, bool translate_, const std::string& name_)
+Control::Control(std::unique_ptr<ControlReference> ref, Translatability translate_,
+ const std::string& name_)
: Control(std::move(ref), translate_, name_, name_)
{
}
diff --git a/Source/Core/InputCommon/ControllerEmu/Control/Control.h b/Source/Core/InputCommon/ControllerEmu/Control/Control.h
index f5c2e394ea..e005431873 100644
--- a/Source/Core/InputCommon/ControllerEmu/Control/Control.h
+++ b/Source/Core/InputCommon/ControllerEmu/Control/Control.h
@@ -11,19 +11,26 @@ class ControlReference;
namespace ControllerEmu
{
+enum Translatability
+{
+ DoNotTranslate,
+ Translate
+};
+
class Control
{
public:
virtual ~Control();
std::unique_ptr<ControlReference> const control_ref;
- const bool translate;
+ const Translatability translate;
const std::string name;
const std::string ui_name;
protected:
- Control(std::unique_ptr<ControlReference> ref, bool translate, const std::string& name,
+ Control(std::unique_ptr<ControlReference> ref, Translatability translate, const std::string& name,
const std::string& ui_name);
- Control(std::unique_ptr<ControlReference> ref, bool translate, const std::string& name);
+ Control(std::unique_ptr<ControlReference> ref, Translatability translate,
+ const std::string& name);
};
} // namespace ControllerEmu
diff --git a/Source/Core/InputCommon/ControllerEmu/Control/Input.cpp b/Source/Core/InputCommon/ControllerEmu/Control/Input.cpp
index ca872b5cbd..69f817705e 100644
--- a/Source/Core/InputCommon/ControllerEmu/Control/Input.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/Control/Input.cpp
@@ -10,12 +10,12 @@
namespace ControllerEmu
{
-Input::Input(bool translate_, const std::string& name_, const std::string& ui_name_)
+Input::Input(Translatability translate_, const std::string& name_, const std::string& ui_name_)
: Control(std::make_unique<InputReference>(), translate_, name_, ui_name_)
{
}
-Input::Input(bool translate_, const std::string& name_)
+Input::Input(Translatability translate_, const std::string& name_)
: Control(std::make_unique<InputReference>(), translate_, name_)
{
}
diff --git a/Source/Core/InputCommon/ControllerEmu/Control/Input.h b/Source/Core/InputCommon/ControllerEmu/Control/Input.h
index 1782249026..3fd301ae65 100644
--- a/Source/Core/InputCommon/ControllerEmu/Control/Input.h
+++ b/Source/Core/InputCommon/ControllerEmu/Control/Input.h
@@ -12,7 +12,7 @@ namespace ControllerEmu
class Input : public Control
{
public:
- Input(bool translate, const std::string& name, const std::string& ui_name);
- Input(bool translate, const std::string& name);
+ Input(Translatability translate, const std::string& name, const std::string& ui_name);
+ Input(Translatability translate, const std::string& name);
};
} // namespace ControllerEmu
diff --git a/Source/Core/InputCommon/ControllerEmu/Control/Output.cpp b/Source/Core/InputCommon/ControllerEmu/Control/Output.cpp
index 9089b15b7f..568035d106 100644
--- a/Source/Core/InputCommon/ControllerEmu/Control/Output.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/Control/Output.cpp
@@ -10,8 +10,8 @@
namespace ControllerEmu
{
-Output::Output(bool translate, const std::string& name_)
- : Control(std::make_unique<OutputReference>(), translate, name_)
+Output::Output(Translatability translate_, const std::string& name_)
+ : Control(std::make_unique<OutputReference>(), translate_, name_)
{
}
} // namespace ControllerEmu
diff --git a/Source/Core/InputCommon/ControllerEmu/Control/Output.h b/Source/Core/InputCommon/ControllerEmu/Control/Output.h
index 74aa85e165..7970c26ad0 100644
--- a/Source/Core/InputCommon/ControllerEmu/Control/Output.h
+++ b/Source/Core/InputCommon/ControllerEmu/Control/Output.h
@@ -12,6 +12,6 @@ namespace ControllerEmu
class Output : public Control
{
public:
- Output(bool translate, const std::string& name);
+ Output(Translatability translate, const std::string& name);
};
} // namespace ControllerEmu