Merge pull request #5347 from JosJuice/do-not-translate-button-names

Don't translate button names
This commit is contained in:
shuffle2
2017-06-05 19:05:09 -07:00
committed by GitHub
12 changed files with 60 additions and 35 deletions

View File

@ -9,8 +9,14 @@
namespace ControllerEmu
{
Control::Control(std::unique_ptr<ControlReference> ref, const std::string& name_,
const std::string& ui_name_)
: control_ref(std::move(ref)), name(name_), ui_name(ui_name_)
{
}
Control::Control(std::unique_ptr<ControlReference> ref, const std::string& name_)
: control_ref(std::move(ref)), name(name_)
: Control(std::move(ref), name_, name_)
{
}

View File

@ -18,8 +18,11 @@ public:
std::unique_ptr<ControlReference> const control_ref;
const std::string name;
const std::string ui_name;
protected:
Control(std::unique_ptr<ControlReference> ref, const std::string& name,
const std::string& ui_name);
Control(std::unique_ptr<ControlReference> ref, const std::string& name);
};
} // namespace ControllerEmu

View File

@ -10,6 +10,11 @@
namespace ControllerEmu
{
Input::Input(const std::string& name_, const std::string& ui_name_)
: Control(std::make_unique<InputReference>(), name_, ui_name_)
{
}
Input::Input(const std::string& name_) : Control(std::make_unique<InputReference>(), name_)
{
}

View File

@ -12,6 +12,7 @@ namespace ControllerEmu
class Input : public Control
{
public:
Input(const std::string& name, const std::string& ui_name);
explicit Input(const std::string& name);
};
} // namespace ControllerEmu

View File

@ -54,9 +54,9 @@ void ModifySettingsButton::GetState()
associated_settings[i] = !associated_settings[i];
if (associated_settings[i])
OSD::AddMessage(controls[i]->name + ": on");
OSD::AddMessage(controls[i]->ui_name + ": on");
else
OSD::AddMessage(controls[i]->name + ": off");
OSD::AddMessage(controls[i]->ui_name + ": off");
threshold_exceeded[i] = true;
}