mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
Merge pull request #6564 from JosJuice/translate-certain-button-names
Translate certain button names but not all
This commit is contained in:
commit
ee955e37a9
@ -56,27 +56,27 @@ GCKeyboard::GCKeyboard(const unsigned int index) : m_index(index)
|
|||||||
// buttons
|
// buttons
|
||||||
groups.emplace_back(m_keys0x = new ControllerEmu::Buttons(_trans("Keys")));
|
groups.emplace_back(m_keys0x = new ControllerEmu::Buttons(_trans("Keys")));
|
||||||
for (const char* key : named_keys0)
|
for (const char* key : named_keys0)
|
||||||
m_keys0x->controls.emplace_back(new ControllerEmu::Input(key));
|
m_keys0x->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, key));
|
||||||
|
|
||||||
groups.emplace_back(m_keys1x = new ControllerEmu::Buttons(_trans("Keys")));
|
groups.emplace_back(m_keys1x = new ControllerEmu::Buttons(_trans("Keys")));
|
||||||
for (const char* key : named_keys1)
|
for (const char* key : named_keys1)
|
||||||
m_keys1x->controls.emplace_back(new ControllerEmu::Input(key));
|
m_keys1x->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, key));
|
||||||
|
|
||||||
groups.emplace_back(m_keys2x = new ControllerEmu::Buttons(_trans("Keys")));
|
groups.emplace_back(m_keys2x = new ControllerEmu::Buttons(_trans("Keys")));
|
||||||
for (const char* key : named_keys2)
|
for (const char* key : named_keys2)
|
||||||
m_keys2x->controls.emplace_back(new ControllerEmu::Input(key));
|
m_keys2x->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, key));
|
||||||
|
|
||||||
groups.emplace_back(m_keys3x = new ControllerEmu::Buttons(_trans("Keys")));
|
groups.emplace_back(m_keys3x = new ControllerEmu::Buttons(_trans("Keys")));
|
||||||
for (const char* key : named_keys3)
|
for (const char* key : named_keys3)
|
||||||
m_keys3x->controls.emplace_back(new ControllerEmu::Input(key));
|
m_keys3x->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, key));
|
||||||
|
|
||||||
groups.emplace_back(m_keys4x = new ControllerEmu::Buttons(_trans("Keys")));
|
groups.emplace_back(m_keys4x = new ControllerEmu::Buttons(_trans("Keys")));
|
||||||
for (const char* key : named_keys4)
|
for (const char* key : named_keys4)
|
||||||
m_keys4x->controls.emplace_back(new ControllerEmu::Input(key));
|
m_keys4x->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, key));
|
||||||
|
|
||||||
groups.emplace_back(m_keys5x = new ControllerEmu::Buttons(_trans("Keys")));
|
groups.emplace_back(m_keys5x = new ControllerEmu::Buttons(_trans("Keys")));
|
||||||
for (const char* key : named_keys5)
|
for (const char* key : named_keys5)
|
||||||
m_keys5x->controls.emplace_back(new ControllerEmu::Input(key));
|
m_keys5x->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, key));
|
||||||
|
|
||||||
// options
|
// options
|
||||||
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
||||||
|
@ -52,10 +52,12 @@ GCPad::GCPad(const unsigned int index) : m_index(index)
|
|||||||
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
||||||
for (const char* named_button : named_buttons)
|
for (const char* named_button : named_buttons)
|
||||||
{
|
{
|
||||||
const std::string& ui_name =
|
const bool is_start = named_button == std::string("Start");
|
||||||
// i18n: The START/PAUSE button on GameCube controllers
|
const ControllerEmu::Translatability translate =
|
||||||
(named_button == std::string("Start")) ? _trans("START") : named_button;
|
is_start ? ControllerEmu::Translate : ControllerEmu::DoNotTranslate;
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input(named_button, ui_name));
|
// i18n: The START/PAUSE button on GameCube controllers
|
||||||
|
const std::string& ui_name = is_start ? _trans("START") : named_button;
|
||||||
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(translate, named_button, ui_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
// sticks
|
// sticks
|
||||||
@ -67,20 +69,28 @@ GCPad::GCPad(const unsigned int index) : m_index(index)
|
|||||||
// triggers
|
// triggers
|
||||||
groups.emplace_back(m_triggers = new ControllerEmu::MixedTriggers(_trans("Triggers")));
|
groups.emplace_back(m_triggers = new ControllerEmu::MixedTriggers(_trans("Triggers")));
|
||||||
for (const char* named_trigger : named_triggers)
|
for (const char* named_trigger : named_triggers)
|
||||||
m_triggers->controls.emplace_back(new ControllerEmu::Input(named_trigger));
|
{
|
||||||
|
m_triggers->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, named_trigger));
|
||||||
|
}
|
||||||
|
|
||||||
// rumble
|
// rumble
|
||||||
groups.emplace_back(m_rumble = new ControllerEmu::ControlGroup(_trans("Rumble")));
|
groups.emplace_back(m_rumble = new ControllerEmu::ControlGroup(_trans("Rumble")));
|
||||||
m_rumble->controls.emplace_back(new ControllerEmu::Output(_trans("Motor")));
|
m_rumble->controls.emplace_back(
|
||||||
|
new ControllerEmu::Output(ControllerEmu::Translate, _trans("Motor")));
|
||||||
|
|
||||||
// Microphone
|
// Microphone
|
||||||
groups.emplace_back(m_mic = new ControllerEmu::Buttons(_trans("Microphone")));
|
groups.emplace_back(m_mic = new ControllerEmu::Buttons(_trans("Microphone")));
|
||||||
m_mic->controls.emplace_back(new ControllerEmu::Input(_trans("Button")));
|
m_mic->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, _trans("Button")));
|
||||||
|
|
||||||
// dpad
|
// dpad
|
||||||
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(_trans("D-Pad")));
|
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(_trans("D-Pad")));
|
||||||
for (const char* named_direction : named_directions)
|
for (const char* named_direction : named_directions)
|
||||||
m_dpad->controls.emplace_back(new ControllerEmu::Input(named_direction));
|
{
|
||||||
|
m_dpad->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, named_direction));
|
||||||
|
}
|
||||||
|
|
||||||
// options
|
// options
|
||||||
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
||||||
|
@ -98,7 +98,8 @@ Classic::Classic(ExtensionReg& reg) : Attachment(_trans("Classic"), reg)
|
|||||||
for (const char* button_name : classic_button_names)
|
for (const char* button_name : classic_button_names)
|
||||||
{
|
{
|
||||||
const std::string& ui_name = (button_name == std::string("Home")) ? "HOME" : button_name;
|
const std::string& ui_name = (button_name == std::string("Home")) ? "HOME" : button_name;
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input(button_name, ui_name));
|
m_buttons->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::DoNotTranslate, button_name, ui_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
// sticks
|
// sticks
|
||||||
@ -110,12 +111,18 @@ Classic::Classic(ExtensionReg& reg) : Attachment(_trans("Classic"), reg)
|
|||||||
// triggers
|
// triggers
|
||||||
groups.emplace_back(m_triggers = new ControllerEmu::MixedTriggers(_trans("Triggers")));
|
groups.emplace_back(m_triggers = new ControllerEmu::MixedTriggers(_trans("Triggers")));
|
||||||
for (const char* trigger_name : classic_trigger_names)
|
for (const char* trigger_name : classic_trigger_names)
|
||||||
m_triggers->controls.emplace_back(new ControllerEmu::Input(trigger_name));
|
{
|
||||||
|
m_triggers->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, trigger_name));
|
||||||
|
}
|
||||||
|
|
||||||
// dpad
|
// dpad
|
||||||
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(_trans("D-Pad")));
|
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(_trans("D-Pad")));
|
||||||
for (const char* named_direction : named_directions)
|
for (const char* named_direction : named_directions)
|
||||||
m_dpad->controls.emplace_back(new ControllerEmu::Input(named_direction));
|
{
|
||||||
|
m_dpad->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, named_direction));
|
||||||
|
}
|
||||||
|
|
||||||
// Set up register
|
// Set up register
|
||||||
m_calibration = classic_calibration;
|
m_calibration = classic_calibration;
|
||||||
|
@ -47,7 +47,10 @@ Drums::Drums(ExtensionReg& reg) : Attachment(_trans("Drums"), reg)
|
|||||||
// pads
|
// pads
|
||||||
groups.emplace_back(m_pads = new ControllerEmu::Buttons(_trans("Pads")));
|
groups.emplace_back(m_pads = new ControllerEmu::Buttons(_trans("Pads")));
|
||||||
for (auto& drum_pad_name : drum_pad_names)
|
for (auto& drum_pad_name : drum_pad_names)
|
||||||
m_pads->controls.emplace_back(new ControllerEmu::Input(drum_pad_name));
|
{
|
||||||
|
m_pads->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, drum_pad_name));
|
||||||
|
}
|
||||||
|
|
||||||
// stick
|
// stick
|
||||||
groups.emplace_back(
|
groups.emplace_back(
|
||||||
@ -55,8 +58,8 @@ Drums::Drums(ExtensionReg& reg) : Attachment(_trans("Drums"), reg)
|
|||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input("-"));
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "-"));
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input("+"));
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "+"));
|
||||||
|
|
||||||
// set up register
|
// set up register
|
||||||
m_id = drums_id;
|
m_id = drums_id;
|
||||||
|
@ -66,17 +66,21 @@ Guitar::Guitar(ExtensionReg& reg) : Attachment(_trans("Guitar"), reg)
|
|||||||
// frets
|
// frets
|
||||||
groups.emplace_back(m_frets = new ControllerEmu::Buttons(_trans("Frets")));
|
groups.emplace_back(m_frets = new ControllerEmu::Buttons(_trans("Frets")));
|
||||||
for (auto& guitar_fret_name : guitar_fret_names)
|
for (auto& guitar_fret_name : guitar_fret_names)
|
||||||
m_frets->controls.emplace_back(new ControllerEmu::Input(guitar_fret_name));
|
{
|
||||||
|
m_frets->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, guitar_fret_name));
|
||||||
|
}
|
||||||
|
|
||||||
// strum
|
// strum
|
||||||
groups.emplace_back(m_strum = new ControllerEmu::Buttons(_trans("Strum")));
|
groups.emplace_back(m_strum = new ControllerEmu::Buttons(_trans("Strum")));
|
||||||
m_strum->controls.emplace_back(new ControllerEmu::Input(_trans("Up")));
|
m_strum->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::Translate, _trans("Up")));
|
||||||
m_strum->controls.emplace_back(new ControllerEmu::Input(_trans("Down")));
|
m_strum->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, _trans("Down")));
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input("-"));
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "-"));
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input("+"));
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "+"));
|
||||||
|
|
||||||
// stick
|
// stick
|
||||||
groups.emplace_back(
|
groups.emplace_back(
|
||||||
@ -84,7 +88,8 @@ Guitar::Guitar(ExtensionReg& reg) : Attachment(_trans("Guitar"), reg)
|
|||||||
|
|
||||||
// whammy
|
// whammy
|
||||||
groups.emplace_back(m_whammy = new ControllerEmu::Triggers(_trans("Whammy")));
|
groups.emplace_back(m_whammy = new ControllerEmu::Triggers(_trans("Whammy")));
|
||||||
m_whammy->controls.emplace_back(new ControllerEmu::Input(_trans("Bar")));
|
m_whammy->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, _trans("Bar")));
|
||||||
|
|
||||||
// slider bar
|
// slider bar
|
||||||
groups.emplace_back(m_slider_bar = new ControllerEmu::Slider(_trans("Slider Bar")));
|
groups.emplace_back(m_slider_bar = new ControllerEmu::Slider(_trans("Slider Bar")));
|
||||||
|
@ -32,8 +32,8 @@ Nunchuk::Nunchuk(ExtensionReg& reg) : Attachment(_trans("Nunchuk"), reg)
|
|||||||
{
|
{
|
||||||
// buttons
|
// buttons
|
||||||
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input("C"));
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "C"));
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input("Z"));
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "Z"));
|
||||||
|
|
||||||
// stick
|
// stick
|
||||||
groups.emplace_back(
|
groups.emplace_back(
|
||||||
@ -48,11 +48,11 @@ Nunchuk::Nunchuk(ExtensionReg& reg) : Attachment(_trans("Nunchuk"), reg)
|
|||||||
// shake
|
// shake
|
||||||
groups.emplace_back(m_shake = new ControllerEmu::Buttons(_trans("Shake")));
|
groups.emplace_back(m_shake = new ControllerEmu::Buttons(_trans("Shake")));
|
||||||
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
||||||
m_shake->controls.emplace_back(new ControllerEmu::Input(_trans("X")));
|
m_shake->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::Translate, _trans("X")));
|
||||||
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
||||||
m_shake->controls.emplace_back(new ControllerEmu::Input(_trans("Y")));
|
m_shake->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::Translate, _trans("Y")));
|
||||||
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
||||||
m_shake->controls.emplace_back(new ControllerEmu::Input(_trans("Z")));
|
m_shake->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::Translate, _trans("Z")));
|
||||||
|
|
||||||
m_id = nunchuk_id;
|
m_id = nunchuk_id;
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,6 @@ constexpr std::array<const char*, 9> turntable_button_names{{
|
|||||||
_trans("Green Right"),
|
_trans("Green Right"),
|
||||||
_trans("Red Right"),
|
_trans("Red Right"),
|
||||||
_trans("Blue Right"),
|
_trans("Blue Right"),
|
||||||
"-",
|
|
||||||
"+",
|
|
||||||
// i18n: This button name refers to a gameplay element in DJ Hero
|
|
||||||
_trans("Euphoria"),
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
Turntable::Turntable(ExtensionReg& reg) : Attachment(_trans("Turntable"), reg)
|
Turntable::Turntable(ExtensionReg& reg) : Attachment(_trans("Turntable"), reg)
|
||||||
@ -52,7 +48,17 @@ Turntable::Turntable(ExtensionReg& reg) : Attachment(_trans("Turntable"), reg)
|
|||||||
// buttons
|
// buttons
|
||||||
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
|
||||||
for (auto& turntable_button_name : turntable_button_names)
|
for (auto& turntable_button_name : turntable_button_names)
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input(turntable_button_name));
|
{
|
||||||
|
m_buttons->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, turntable_button_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "-"));
|
||||||
|
m_buttons->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::DoNotTranslate, "+"));
|
||||||
|
|
||||||
|
// i18n: This button name refers to a gameplay element in DJ Hero
|
||||||
|
m_buttons->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, _trans("Euphoria")));
|
||||||
|
|
||||||
// turntables
|
// turntables
|
||||||
// i18n: "Table" refers to a turntable
|
// i18n: "Table" refers to a turntable
|
||||||
@ -67,7 +73,8 @@ Turntable::Turntable(ExtensionReg& reg) : Attachment(_trans("Turntable"), reg)
|
|||||||
|
|
||||||
// effect dial
|
// effect dial
|
||||||
groups.emplace_back(m_effect_dial = new ControllerEmu::Triggers(_trans("Effect")));
|
groups.emplace_back(m_effect_dial = new ControllerEmu::Triggers(_trans("Effect")));
|
||||||
m_effect_dial->controls.emplace_back(new ControllerEmu::Input(_trans("Dial")));
|
m_effect_dial->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, _trans("Dial")));
|
||||||
|
|
||||||
// crossfade
|
// crossfade
|
||||||
groups.emplace_back(m_crossfade = new ControllerEmu::Slider(_trans("Crossfade")));
|
groups.emplace_back(m_crossfade = new ControllerEmu::Slider(_trans("Crossfade")));
|
||||||
|
@ -261,7 +261,8 @@ Wiimote::Wiimote(const unsigned int index) : m_index(index), ir_sin(0), ir_cos(1
|
|||||||
for (const char* named_button : named_buttons)
|
for (const char* named_button : named_buttons)
|
||||||
{
|
{
|
||||||
const std::string& ui_name = (named_button == std::string("Home")) ? "HOME" : named_button;
|
const std::string& ui_name = (named_button == std::string("Home")) ? "HOME" : named_button;
|
||||||
m_buttons->controls.emplace_back(new ControllerEmu::Input(named_button, ui_name));
|
m_buttons->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::DoNotTranslate, named_button, ui_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ir
|
// ir
|
||||||
@ -277,11 +278,11 @@ Wiimote::Wiimote(const unsigned int index) : m_index(index), ir_sin(0), ir_cos(1
|
|||||||
// shake
|
// shake
|
||||||
groups.emplace_back(m_shake = new ControllerEmu::Buttons(_trans("Shake")));
|
groups.emplace_back(m_shake = new ControllerEmu::Buttons(_trans("Shake")));
|
||||||
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
||||||
m_shake->controls.emplace_back(new ControllerEmu::Input(_trans("X")));
|
m_shake->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::Translate, _trans("X")));
|
||||||
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
||||||
m_shake->controls.emplace_back(new ControllerEmu::Input(_trans("Y")));
|
m_shake->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::Translate, _trans("Y")));
|
||||||
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
// i18n: Refers to a 3D axis (used when mapping motion controls)
|
||||||
m_shake->controls.emplace_back(new ControllerEmu::Input(_trans("Z")));
|
m_shake->controls.emplace_back(new ControllerEmu::Input(ControllerEmu::Translate, _trans("Z")));
|
||||||
|
|
||||||
// extension
|
// extension
|
||||||
groups.emplace_back(m_extension = new ControllerEmu::Extension(_trans("Extension")));
|
groups.emplace_back(m_extension = new ControllerEmu::Extension(_trans("Extension")));
|
||||||
@ -294,12 +295,16 @@ Wiimote::Wiimote(const unsigned int index) : m_index(index), ir_sin(0), ir_cos(1
|
|||||||
|
|
||||||
// rumble
|
// rumble
|
||||||
groups.emplace_back(m_rumble = new ControllerEmu::ControlGroup(_trans("Rumble")));
|
groups.emplace_back(m_rumble = new ControllerEmu::ControlGroup(_trans("Rumble")));
|
||||||
m_rumble->controls.emplace_back(m_motor = new ControllerEmu::Output(_trans("Motor")));
|
m_rumble->controls.emplace_back(
|
||||||
|
m_motor = new ControllerEmu::Output(ControllerEmu::Translate, _trans("Motor")));
|
||||||
|
|
||||||
// dpad
|
// dpad
|
||||||
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(_trans("D-Pad")));
|
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(_trans("D-Pad")));
|
||||||
for (const char* named_direction : named_directions)
|
for (const char* named_direction : named_directions)
|
||||||
m_dpad->controls.emplace_back(new ControllerEmu::Input(named_direction));
|
{
|
||||||
|
m_dpad->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, named_direction));
|
||||||
|
}
|
||||||
|
|
||||||
// options
|
// options
|
||||||
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
||||||
|
@ -270,7 +270,8 @@ HotkeyManager::HotkeyManager()
|
|||||||
groups.emplace_back(m_hotkey_groups[group]);
|
groups.emplace_back(m_hotkey_groups[group]);
|
||||||
for (int key = groups_info[group].first; key <= groups_info[group].last; key++)
|
for (int key = groups_info[group].first; key <= groups_info[group].last; key++)
|
||||||
{
|
{
|
||||||
m_keys[group]->controls.emplace_back(new ControllerEmu::Input(hotkey_labels[key]));
|
m_keys[group]->controls.emplace_back(
|
||||||
|
new ControllerEmu::Input(ControllerEmu::Translate, hotkey_labels[key]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
|
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
|
||||||
|
|
||||||
MappingBool::MappingBool(MappingWidget* widget, ControllerEmu::BooleanSetting* setting)
|
MappingBool::MappingBool(MappingWidget* widget, ControllerEmu::BooleanSetting* setting)
|
||||||
: QCheckBox(QString::fromStdString(setting->m_ui_name)), m_parent(widget), m_setting(setting)
|
: QCheckBox(tr(setting->m_ui_name.c_str())), m_parent(widget), m_setting(setting)
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
Connect();
|
Connect();
|
||||||
|
@ -82,7 +82,10 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
|
|||||||
|
|
||||||
button->setMinimumWidth(100);
|
button->setMinimumWidth(100);
|
||||||
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||||
form_layout->addRow(QString::fromStdString(control->name), button);
|
const bool translate = control->translate == ControllerEmu::Translate;
|
||||||
|
const QString translated_name =
|
||||||
|
translate ? tr(control->ui_name.c_str()) : QString::fromStdString(control->ui_name);
|
||||||
|
form_layout->addRow(translated_name, button);
|
||||||
|
|
||||||
auto* control_ref = control->control_ref.get();
|
auto* control_ref = control->control_ref.get();
|
||||||
|
|
||||||
@ -103,7 +106,7 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
|
|||||||
for (auto& numeric : group->numeric_settings)
|
for (auto& numeric : group->numeric_settings)
|
||||||
{
|
{
|
||||||
auto* spinbox = new MappingNumeric(this, numeric.get());
|
auto* spinbox = new MappingNumeric(this, numeric.get());
|
||||||
form_layout->addRow(QString::fromStdString(numeric->m_name), spinbox);
|
form_layout->addRow(tr(numeric->m_name.c_str()), spinbox);
|
||||||
m_numerics.push_back(spinbox);
|
m_numerics.push_back(spinbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -964,8 +964,11 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin
|
|||||||
control_grid->AddGrowableCol(0);
|
control_grid->AddGrowableCol(0);
|
||||||
for (const auto& control : group->controls)
|
for (const auto& control : group->controls)
|
||||||
{
|
{
|
||||||
wxStaticText* const label =
|
const wxString control_ui_name = StrToWxStr(control->ui_name);
|
||||||
new wxStaticText(parent, wxID_ANY, wxGetTranslation(StrToWxStr(control->ui_name)));
|
|
||||||
|
const bool translate = control->translate == ControllerEmu::Translate;
|
||||||
|
wxStaticText* const label = new wxStaticText(
|
||||||
|
parent, wxID_ANY, translate ? wxGetTranslation(control_ui_name) : control_ui_name);
|
||||||
|
|
||||||
ControlButton* const control_button =
|
ControlButton* const control_button =
|
||||||
new ControlButton(parent, control->control_ref.get(), control->ui_name, 80);
|
new ControlButton(parent, control->control_ref.get(), control->ui_name, 80);
|
||||||
|
@ -9,14 +9,15 @@
|
|||||||
|
|
||||||
namespace ControllerEmu
|
namespace ControllerEmu
|
||||||
{
|
{
|
||||||
Control::Control(std::unique_ptr<ControlReference> ref, const std::string& name_,
|
Control::Control(std::unique_ptr<ControlReference> ref, Translatability translate_,
|
||||||
const std::string& ui_name_)
|
const std::string& name_, const std::string& ui_name_)
|
||||||
: control_ref(std::move(ref)), name(name_), ui_name(ui_name_)
|
: control_ref(std::move(ref)), translate(translate_), name(name_), ui_name(ui_name_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Control::Control(std::unique_ptr<ControlReference> ref, const std::string& name_)
|
Control::Control(std::unique_ptr<ControlReference> ref, Translatability translate_,
|
||||||
: Control(std::move(ref), name_, name_)
|
const std::string& name_)
|
||||||
|
: Control(std::move(ref), translate_, name_, name_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,18 +11,26 @@ class ControlReference;
|
|||||||
|
|
||||||
namespace ControllerEmu
|
namespace ControllerEmu
|
||||||
{
|
{
|
||||||
|
enum Translatability
|
||||||
|
{
|
||||||
|
DoNotTranslate,
|
||||||
|
Translate
|
||||||
|
};
|
||||||
|
|
||||||
class Control
|
class Control
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Control();
|
virtual ~Control();
|
||||||
|
|
||||||
std::unique_ptr<ControlReference> const control_ref;
|
std::unique_ptr<ControlReference> const control_ref;
|
||||||
|
const Translatability translate;
|
||||||
const std::string name;
|
const std::string name;
|
||||||
const std::string ui_name;
|
const std::string ui_name;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Control(std::unique_ptr<ControlReference> ref, const std::string& name,
|
Control(std::unique_ptr<ControlReference> ref, Translatability translate, const std::string& name,
|
||||||
const std::string& ui_name);
|
const std::string& ui_name);
|
||||||
Control(std::unique_ptr<ControlReference> ref, const std::string& name);
|
Control(std::unique_ptr<ControlReference> ref, Translatability translate,
|
||||||
|
const std::string& name);
|
||||||
};
|
};
|
||||||
} // namespace ControllerEmu
|
} // namespace ControllerEmu
|
||||||
|
@ -10,12 +10,13 @@
|
|||||||
|
|
||||||
namespace ControllerEmu
|
namespace ControllerEmu
|
||||||
{
|
{
|
||||||
Input::Input(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>(), name_, ui_name_)
|
: Control(std::make_unique<InputReference>(), translate_, name_, ui_name_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Input::Input(const std::string& name_) : Control(std::make_unique<InputReference>(), name_)
|
Input::Input(Translatability translate_, const std::string& name_)
|
||||||
|
: Control(std::make_unique<InputReference>(), translate_, name_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
} // namespace ControllerEmu
|
} // namespace ControllerEmu
|
||||||
|
@ -12,7 +12,7 @@ namespace ControllerEmu
|
|||||||
class Input : public Control
|
class Input : public Control
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Input(const std::string& name, const std::string& ui_name);
|
Input(Translatability translate, const std::string& name, const std::string& ui_name);
|
||||||
explicit Input(const std::string& name);
|
Input(Translatability translate, const std::string& name);
|
||||||
};
|
};
|
||||||
} // namespace ControllerEmu
|
} // namespace ControllerEmu
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
|
|
||||||
namespace ControllerEmu
|
namespace ControllerEmu
|
||||||
{
|
{
|
||||||
Output::Output(const std::string& name_) : Control(std::make_unique<OutputReference>(), name_)
|
Output::Output(Translatability translate_, const std::string& name_)
|
||||||
|
: Control(std::make_unique<OutputReference>(), translate_, name_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
} // namespace ControllerEmu
|
} // namespace ControllerEmu
|
||||||
|
@ -12,6 +12,6 @@ namespace ControllerEmu
|
|||||||
class Output : public Control
|
class Output : public Control
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit Output(const std::string& name);
|
Output(Translatability translate, const std::string& name);
|
||||||
};
|
};
|
||||||
} // namespace ControllerEmu
|
} // namespace ControllerEmu
|
||||||
|
@ -28,9 +28,9 @@ AnalogStick::AnalogStick(const char* const name_, const char* const ui_name_,
|
|||||||
: ControlGroup(name_, ui_name_, GroupType::Stick)
|
: ControlGroup(name_, ui_name_, GroupType::Stick)
|
||||||
{
|
{
|
||||||
for (auto& named_direction : named_directions)
|
for (auto& named_direction : named_directions)
|
||||||
controls.emplace_back(std::make_unique<Input>(named_direction));
|
controls.emplace_back(std::make_unique<Input>(Translate, named_direction));
|
||||||
|
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Modifier")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Modifier")));
|
||||||
numeric_settings.emplace_back(
|
numeric_settings.emplace_back(
|
||||||
std::make_unique<NumericSetting>(_trans("Radius"), default_radius, 0, 100));
|
std::make_unique<NumericSetting>(_trans("Radius"), default_radius, 0, 100));
|
||||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
||||||
|
@ -24,12 +24,12 @@ namespace ControllerEmu
|
|||||||
Cursor::Cursor(const std::string& name_) : ControlGroup(name_, GroupType::Cursor)
|
Cursor::Cursor(const std::string& name_) : ControlGroup(name_, GroupType::Cursor)
|
||||||
{
|
{
|
||||||
for (auto& named_direction : named_directions)
|
for (auto& named_direction : named_directions)
|
||||||
controls.emplace_back(std::make_unique<Input>(named_direction));
|
controls.emplace_back(std::make_unique<Input>(Translate, named_direction));
|
||||||
|
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Forward")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Forward")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Backward")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Backward")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Hide")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Hide")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Recenter")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Recenter")));
|
||||||
|
|
||||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Center"), 0.5));
|
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Center"), 0.5));
|
||||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Width"), 0.5));
|
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Width"), 0.5));
|
||||||
|
@ -19,12 +19,12 @@ namespace ControllerEmu
|
|||||||
{
|
{
|
||||||
Force::Force(const std::string& name_) : ControlGroup(name_, GroupType::Force)
|
Force::Force(const std::string& name_) : ControlGroup(name_, GroupType::Force)
|
||||||
{
|
{
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Up")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Up")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Down")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Down")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Left")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Left")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Right")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Right")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Forward")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Forward")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Backward")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Backward")));
|
||||||
|
|
||||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ ModifySettingsButton::ModifySettingsButton(std::string button_name)
|
|||||||
|
|
||||||
void ModifySettingsButton::AddInput(std::string button_name, bool toggle)
|
void ModifySettingsButton::AddInput(std::string button_name, bool toggle)
|
||||||
{
|
{
|
||||||
controls.emplace_back(new Input(std::move(button_name)));
|
controls.emplace_back(std::make_unique<Input>(Translate, std::move(button_name)));
|
||||||
threshold_exceeded.emplace_back(false);
|
threshold_exceeded.emplace_back(false);
|
||||||
associated_settings.emplace_back(false);
|
associated_settings.emplace_back(false);
|
||||||
associated_settings_toggle.emplace_back(toggle);
|
associated_settings_toggle.emplace_back(toggle);
|
||||||
|
@ -20,8 +20,8 @@ namespace ControllerEmu
|
|||||||
Slider::Slider(const std::string& name_, const std::string& ui_name_)
|
Slider::Slider(const std::string& name_, const std::string& ui_name_)
|
||||||
: ControlGroup(name_, ui_name_, GroupType::Slider)
|
: ControlGroup(name_, ui_name_, GroupType::Slider)
|
||||||
{
|
{
|
||||||
controls.emplace_back(std::make_unique<Input>("Left"));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Left")));
|
||||||
controls.emplace_back(std::make_unique<Input>("Right"));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Right")));
|
||||||
|
|
||||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,12 @@ namespace ControllerEmu
|
|||||||
{
|
{
|
||||||
Tilt::Tilt(const std::string& name_) : ControlGroup(name_, GroupType::Tilt)
|
Tilt::Tilt(const std::string& name_) : ControlGroup(name_, GroupType::Tilt)
|
||||||
{
|
{
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Forward")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Forward")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Backward")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Backward")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Left")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Left")));
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Right")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Right")));
|
||||||
|
|
||||||
controls.emplace_back(std::make_unique<Input>(_trans("Modifier")));
|
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Modifier")));
|
||||||
|
|
||||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
|
||||||
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Circle Stick"), 0));
|
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Circle Stick"), 0));
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "Common/Common.h"
|
||||||
#include "Common/IniFile.h"
|
#include "Common/IniFile.h"
|
||||||
#include "InputCommon/ControllerInterface/Device.h"
|
#include "InputCommon/ControllerInterface/Device.h"
|
||||||
|
|
||||||
@ -16,7 +17,8 @@ class ControllerInterface;
|
|||||||
|
|
||||||
#define sign(x) ((x) ? (x) < 0 ? -1 : 1 : 0)
|
#define sign(x) ((x) ? (x) < 0 ? -1 : 1 : 0)
|
||||||
|
|
||||||
const char* const named_directions[] = {"Up", "Down", "Left", "Right"};
|
const char* const named_directions[] = {_trans("Up"), _trans("Down"), _trans("Left"),
|
||||||
|
_trans("Right")};
|
||||||
|
|
||||||
namespace ControllerEmu
|
namespace ControllerEmu
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user