mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
ControllerEmu: Use enum instead of bool for translatability
This commit is contained in:
@ -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_)
|
||||
{
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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_)
|
||||
{
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user