ControllerEmu: Convert Translatability to enum class

This commit is contained in:
Dentomologist 2023-05-29 16:31:19 -07:00
parent c8559a7933
commit 527f8e783c
26 changed files with 137 additions and 111 deletions

View File

@ -81,31 +81,33 @@ enum GyroButtons
FreeLookController::FreeLookController(const unsigned int index) : m_index(index)
{
using Translatability = ControllerEmu::Translatability;
groups.emplace_back(m_move_buttons = new ControllerEmu::Buttons(_trans("Move")));
m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Up"));
m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Down"));
m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Left"));
m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Right"));
m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Forward"));
m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Backward"));
m_move_buttons->AddInput(Translatability::Translate, _trans("Up"));
m_move_buttons->AddInput(Translatability::Translate, _trans("Down"));
m_move_buttons->AddInput(Translatability::Translate, _trans("Left"));
m_move_buttons->AddInput(Translatability::Translate, _trans("Right"));
m_move_buttons->AddInput(Translatability::Translate, _trans("Forward"));
m_move_buttons->AddInput(Translatability::Translate, _trans("Backward"));
groups.emplace_back(m_speed_buttons = new ControllerEmu::Buttons(_trans("Speed")));
m_speed_buttons->AddInput(ControllerEmu::Translate, _trans("Decrease"));
m_speed_buttons->AddInput(ControllerEmu::Translate, _trans("Increase"));
m_speed_buttons->AddInput(ControllerEmu::Translate, _trans("Reset"));
m_speed_buttons->AddInput(Translatability::Translate, _trans("Decrease"));
m_speed_buttons->AddInput(Translatability::Translate, _trans("Increase"));
m_speed_buttons->AddInput(Translatability::Translate, _trans("Reset"));
groups.emplace_back(m_other_buttons = new ControllerEmu::Buttons(_trans("Other")));
m_other_buttons->AddInput(ControllerEmu::Translate, _trans("Reset View"));
m_other_buttons->AddInput(Translatability::Translate, _trans("Reset View"));
groups.emplace_back(m_fov_buttons = new ControllerEmu::Buttons(_trans("Field of View")));
m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Increase X"));
m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Decrease X"));
m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Increase Y"));
m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Decrease Y"));
m_fov_buttons->AddInput(Translatability::Translate, _trans("Increase X"));
m_fov_buttons->AddInput(Translatability::Translate, _trans("Decrease X"));
m_fov_buttons->AddInput(Translatability::Translate, _trans("Increase Y"));
m_fov_buttons->AddInput(Translatability::Translate, _trans("Decrease Y"));
groups.emplace_back(m_rotation_gyro = new ControllerEmu::IMUGyroscope(
_trans("Incremental Rotation"), _trans("Incremental Rotation")));

View File

@ -17,22 +17,24 @@ static const u16 button_bitmasks[] = {PAD_BUTTON_B, PAD_BUTTON_A, PAD_TRIGGER_
GBAPad::GBAPad(const unsigned int index) : m_reset_pending(false), m_index(index)
{
using Translatability = ControllerEmu::Translatability;
// Buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(BUTTONS_GROUP));
for (const char* named_button : {B_BUTTON, A_BUTTON, L_BUTTON, R_BUTTON})
{
m_buttons->AddInput(ControllerEmu::DoNotTranslate, named_button);
m_buttons->AddInput(Translatability::DoNotTranslate, named_button);
}
for (const char* named_button : {SELECT_BUTTON, START_BUTTON})
{
m_buttons->AddInput(ControllerEmu::Translate, named_button);
m_buttons->AddInput(Translatability::Translate, named_button);
}
// DPad
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(DPAD_GROUP));
for (const char* named_direction : named_directions)
{
m_dpad->AddInput(ControllerEmu::Translate, named_direction);
m_dpad->AddInput(Translatability::Translate, named_direction);
}
}

View File

@ -51,30 +51,32 @@ static const char* const named_keys5[] = {"LEFT", "DOWN", "UP", "RIGHT", "ENTER"
GCKeyboard::GCKeyboard(const unsigned int index) : m_index(index)
{
using Translatability = ControllerEmu::Translatability;
// buttons
groups.emplace_back(m_keys0x = new ControllerEmu::Buttons(_trans("Keys")));
for (const char* key : named_keys0)
m_keys0x->AddInput(ControllerEmu::DoNotTranslate, key);
m_keys0x->AddInput(Translatability::DoNotTranslate, key);
groups.emplace_back(m_keys1x = new ControllerEmu::Buttons(_trans("Keys")));
for (const char* key : named_keys1)
m_keys1x->AddInput(ControllerEmu::DoNotTranslate, key);
m_keys1x->AddInput(Translatability::DoNotTranslate, key);
groups.emplace_back(m_keys2x = new ControllerEmu::Buttons(_trans("Keys")));
for (const char* key : named_keys2)
m_keys2x->AddInput(ControllerEmu::DoNotTranslate, key);
m_keys2x->AddInput(Translatability::DoNotTranslate, key);
groups.emplace_back(m_keys3x = new ControllerEmu::Buttons(_trans("Keys")));
for (const char* key : named_keys3)
m_keys3x->AddInput(ControllerEmu::DoNotTranslate, key);
m_keys3x->AddInput(Translatability::DoNotTranslate, key);
groups.emplace_back(m_keys4x = new ControllerEmu::Buttons(_trans("Keys")));
for (const char* key : named_keys4)
m_keys4x->AddInput(ControllerEmu::DoNotTranslate, key);
m_keys4x->AddInput(Translatability::DoNotTranslate, key);
groups.emplace_back(m_keys5x = new ControllerEmu::Buttons(_trans("Keys")));
for (const char* key : named_keys5)
m_keys5x->AddInput(ControllerEmu::DoNotTranslate, key);
m_keys5x->AddInput(Translatability::DoNotTranslate, key);
}
std::string GCKeyboard::GetName() const

View File

@ -38,14 +38,16 @@ static const u16 dpad_bitmasks[] = {PAD_BUTTON_UP, PAD_BUTTON_DOWN, PAD_BUTTON_L
GCPad::GCPad(const unsigned int index) : m_index(index)
{
using Translatability = ControllerEmu::Translatability;
// buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(BUTTONS_GROUP));
for (const char* named_button : {A_BUTTON, B_BUTTON, X_BUTTON, Y_BUTTON, Z_BUTTON})
{
m_buttons->AddInput(ControllerEmu::DoNotTranslate, named_button);
m_buttons->AddInput(Translatability::DoNotTranslate, named_button);
}
// i18n: The START/PAUSE button on GameCube controllers
m_buttons->AddInput(ControllerEmu::Translate, START_BUTTON, _trans("START"));
m_buttons->AddInput(Translatability::Translate, START_BUTTON, _trans("START"));
// sticks
groups.emplace_back(m_main_stick = new ControllerEmu::OctagonAnalogStick(
@ -57,23 +59,23 @@ GCPad::GCPad(const unsigned int index) : m_index(index)
groups.emplace_back(m_triggers = new ControllerEmu::MixedTriggers(TRIGGERS_GROUP));
for (const char* named_trigger : {L_DIGITAL, R_DIGITAL, L_ANALOG, R_ANALOG})
{
m_triggers->AddInput(ControllerEmu::Translate, named_trigger);
m_triggers->AddInput(Translatability::Translate, named_trigger);
}
// dpad
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(DPAD_GROUP));
for (const char* named_direction : named_directions)
{
m_dpad->AddInput(ControllerEmu::Translate, named_direction);
m_dpad->AddInput(Translatability::Translate, named_direction);
}
// Microphone
groups.emplace_back(m_mic = new ControllerEmu::Buttons(MIC_GROUP));
m_mic->AddInput(ControllerEmu::Translate, _trans("Button"));
m_mic->AddInput(Translatability::Translate, _trans("Button"));
// rumble
groups.emplace_back(m_rumble = new ControllerEmu::ControlGroup(RUMBLE_GROUP));
m_rumble->AddOutput(ControllerEmu::Translate, _trans("Motor"));
m_rumble->AddOutput(Translatability::Translate, _trans("Motor"));
// options
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(OPTIONS_GROUP));

View File

@ -53,14 +53,16 @@ constexpr std::array<u16, 4> classic_dpad_bitmasks{{
Classic::Classic() : Extension1stParty("Classic", _trans("Classic Controller"))
{
using Translatability = ControllerEmu::Translatability;
// buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(BUTTONS_GROUP));
for (auto& button_name :
{A_BUTTON, B_BUTTON, X_BUTTON, Y_BUTTON, ZL_BUTTON, ZR_BUTTON, MINUS_BUTTON, PLUS_BUTTON})
{
m_buttons->AddInput(ControllerEmu::DoNotTranslate, button_name);
m_buttons->AddInput(Translatability::DoNotTranslate, button_name);
}
m_buttons->AddInput(ControllerEmu::DoNotTranslate, HOME_BUTTON, "HOME");
m_buttons->AddInput(Translatability::DoNotTranslate, HOME_BUTTON, "HOME");
// sticks
constexpr auto gate_radius = ControlState(STICK_GATE_RADIUS) / CAL_STICK_RADIUS;
@ -73,14 +75,14 @@ Classic::Classic() : Extension1stParty("Classic", _trans("Classic Controller"))
groups.emplace_back(m_triggers = new ControllerEmu::MixedTriggers(TRIGGERS_GROUP));
for (const char* trigger_name : {L_DIGITAL, R_DIGITAL, L_ANALOG, R_ANALOG})
{
m_triggers->AddInput(ControllerEmu::Translate, trigger_name);
m_triggers->AddInput(Translatability::Translate, trigger_name);
}
// dpad
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(DPAD_GROUP));
for (const char* named_direction : named_directions)
{
m_dpad->AddInput(ControllerEmu::Translate, named_direction);
m_dpad->AddInput(Translatability::Translate, named_direction);
}
}

View File

@ -30,8 +30,9 @@ DrawsomeTablet::DrawsomeTablet() : Extension3rdParty("Drawsome", _trans("Drawsom
// Touch
groups.emplace_back(m_touch = new ControllerEmu::Triggers(_trans("Touch")));
m_touch->AddInput(ControllerEmu::Translate, _trans("Pressure"));
m_touch->AddInput(ControllerEmu::Translate, _trans("Lift"));
using Translatability = ControllerEmu::Translatability;
m_touch->AddInput(Translatability::Translate, _trans("Pressure"));
m_touch->AddInput(Translatability::Translate, _trans("Lift"));
}
void DrawsomeTablet::BuildDesiredExtensionState(DesiredExtensionState* target_state)

View File

@ -55,11 +55,13 @@ constexpr std::array<u8, 2> drum_button_bitmasks{{
Drums::Drums() : Extension1stParty("Drums", _trans("Drum Kit"))
{
using Translatability = ControllerEmu::Translatability;
// Pads.
groups.emplace_back(m_pads = new ControllerEmu::Buttons(_trans("Pads")));
for (auto& drum_pad_name : drum_pad_names)
{
m_pads->AddInput(ControllerEmu::Translate, drum_pad_name);
m_pads->AddInput(Translatability::Translate, drum_pad_name);
}
m_pads->AddSetting(&m_hit_strength_setting,
@ -71,8 +73,8 @@ Drums::Drums() : Extension1stParty("Drums", _trans("Drum Kit"))
// Buttons.
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "-");
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "+");
m_buttons->AddInput(Translatability::DoNotTranslate, "-");
m_buttons->AddInput(Translatability::DoNotTranslate, "+");
// Stick.
groups.emplace_back(m_stick =

View File

@ -65,22 +65,24 @@ constexpr std::array<u16, 2> guitar_strum_bitmasks{{
Guitar::Guitar() : Extension1stParty(_trans("Guitar"))
{
using Translatability = ControllerEmu::Translatability;
// frets
groups.emplace_back(m_frets = new ControllerEmu::Buttons(_trans("Frets")));
for (auto& guitar_fret_name : guitar_fret_names)
{
m_frets->AddInput(ControllerEmu::Translate, guitar_fret_name);
m_frets->AddInput(Translatability::Translate, guitar_fret_name);
}
// strum
groups.emplace_back(m_strum = new ControllerEmu::Buttons(_trans("Strum")));
m_strum->AddInput(ControllerEmu::Translate, _trans("Up"));
m_strum->AddInput(ControllerEmu::Translate, _trans("Down"));
m_strum->AddInput(Translatability::Translate, _trans("Up"));
m_strum->AddInput(Translatability::Translate, _trans("Down"));
// buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "-");
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "+");
m_buttons->AddInput(Translatability::DoNotTranslate, "-");
m_buttons->AddInput(Translatability::DoNotTranslate, "+");
// stick
constexpr auto gate_radius = ControlState(STICK_GATE_RADIUS) / STICK_RADIUS;
@ -89,7 +91,7 @@ Guitar::Guitar() : Extension1stParty(_trans("Guitar"))
// whammy
groups.emplace_back(m_whammy = new ControllerEmu::Triggers(_trans("Whammy")));
m_whammy->AddInput(ControllerEmu::Translate, _trans("Bar"));
m_whammy->AddInput(Translatability::Translate, _trans("Bar"));
// slider bar
groups.emplace_back(m_slider_bar = new ControllerEmu::Slider(_trans("Slider Bar")));

View File

@ -38,8 +38,9 @@ Nunchuk::Nunchuk() : Extension1stParty(_trans("Nunchuk"))
{
// buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(BUTTONS_GROUP));
m_buttons->AddInput(ControllerEmu::DoNotTranslate, C_BUTTON);
m_buttons->AddInput(ControllerEmu::DoNotTranslate, Z_BUTTON);
using Translatability = ControllerEmu::Translatability;
m_buttons->AddInput(Translatability::DoNotTranslate, C_BUTTON);
m_buttons->AddInput(Translatability::DoNotTranslate, Z_BUTTON);
// stick
constexpr auto gate_radius = ControlState(STICK_GATE_RADIUS) / STICK_RADIUS;

View File

@ -22,6 +22,8 @@ constexpr std::array<u8, 6> shinkansen_id{{0x00, 0x00, 0xa4, 0x20, 0x01, 0x10}};
Shinkansen::Shinkansen() : Extension3rdParty("Shinkansen", _trans("Shinkansen Controller"))
{
using Translatability = ControllerEmu::Translatability;
// Button layout on the controller:
//
// Up Select Start D
@ -29,28 +31,28 @@ Shinkansen::Shinkansen() : Extension3rdParty("Shinkansen", _trans("Shinkansen Co
// Down B
//
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
m_buttons->AddInput(ControllerEmu::Translate, _trans("Up"));
m_buttons->AddInput(ControllerEmu::Translate, _trans("Down"));
m_buttons->AddInput(ControllerEmu::Translate, _trans("Left"));
m_buttons->AddInput(ControllerEmu::Translate, _trans("Right"));
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "A");
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "B");
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "C");
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "D");
m_buttons->AddInput(ControllerEmu::Translate, _trans("SELECT"));
m_buttons->AddInput(ControllerEmu::Translate, _trans("START"));
m_buttons->AddInput(Translatability::Translate, _trans("Up"));
m_buttons->AddInput(Translatability::Translate, _trans("Down"));
m_buttons->AddInput(Translatability::Translate, _trans("Left"));
m_buttons->AddInput(Translatability::Translate, _trans("Right"));
m_buttons->AddInput(Translatability::DoNotTranslate, "A");
m_buttons->AddInput(Translatability::DoNotTranslate, "B");
m_buttons->AddInput(Translatability::DoNotTranslate, "C");
m_buttons->AddInput(Translatability::DoNotTranslate, "D");
m_buttons->AddInput(Translatability::Translate, _trans("SELECT"));
m_buttons->AddInput(Translatability::Translate, _trans("START"));
// For easier axis mapping the right lever is inverted in Dolphin,
// so that the train coasts when no trigger is squeezed.
groups.emplace_back(m_levers = new ControllerEmu::Triggers(_trans("Levers")));
m_levers->AddInput(ControllerEmu::Translate, _trans("L"));
m_levers->AddInput(ControllerEmu::Translate, _trans("R"));
m_levers->AddInput(Translatability::Translate, _trans("L"));
m_levers->AddInput(Translatability::Translate, _trans("R"));
// i18n: Noun. This is used as a label for a control group that represents lights on controllers.
groups.emplace_back(m_led = new ControllerEmu::ControlGroup(_trans("Light")));
// i18n: A light on the Shinkansen controller that lights up when the train doors are locked.
// Labeled 戸じめ (in Japanese) on the actual controller.
m_led->AddOutput(ControllerEmu::Translate, _trans("Doors Locked"));
m_led->AddOutput(Translatability::Translate, _trans("Doors Locked"));
}
void Shinkansen::BuildDesiredExtensionState(DesiredExtensionState* target_state)

View File

@ -39,15 +39,17 @@ constexpr std::array<const char*, 2> position_names{{
// i18n: The drum controller used in "Taiko no Tatsujin" games. Also known as a "TaTaCon".
TaTaCon::TaTaCon() : Extension3rdParty("TaTaCon", _trans("Taiko Drum"))
{
using Translatability = ControllerEmu::Translatability;
// i18n: Refers to the "center" of a TaTaCon drum.
groups.emplace_back(m_center = new ControllerEmu::Buttons(_trans("Center")));
for (auto& name : position_names)
m_center->AddInput(ControllerEmu::Translate, name);
m_center->AddInput(Translatability::Translate, name);
// i18n: Refers to the "rim" of a TaTaCon drum.
groups.emplace_back(m_rim = new ControllerEmu::Buttons(_trans("Rim")));
for (auto& name : position_names)
m_rim->AddInput(ControllerEmu::Translate, name);
m_rim->AddInput(Translatability::Translate, name);
}
void TaTaCon::BuildDesiredExtensionState(DesiredExtensionState* target_state)

View File

@ -48,18 +48,20 @@ constexpr std::array<const char*, 6> turntable_button_names{{
Turntable::Turntable() : Extension1stParty("Turntable", _trans("DJ Turntable"))
{
using Translatability = ControllerEmu::Translatability;
// buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
for (auto& turntable_button_name : turntable_button_names)
{
m_buttons->AddInput(ControllerEmu::Translate, turntable_button_name);
m_buttons->AddInput(Translatability::Translate, turntable_button_name);
}
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "-");
m_buttons->AddInput(ControllerEmu::DoNotTranslate, "+");
m_buttons->AddInput(Translatability::DoNotTranslate, "-");
m_buttons->AddInput(Translatability::DoNotTranslate, "+");
// i18n: This button name refers to a gameplay element in DJ Hero
m_buttons->AddInput(ControllerEmu::Translate, _trans("Euphoria"));
m_buttons->AddInput(Translatability::Translate, _trans("Euphoria"));
// turntables
// i18n: "Table" refers to a turntable

View File

@ -34,11 +34,13 @@ constexpr std::array<const char*, 2> udraw_tablet_button_names{{
UDrawTablet::UDrawTablet() : Extension3rdParty("uDraw", _trans("uDraw GameTablet"))
{
using Translatability = ControllerEmu::Translatability;
// Buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(_trans("Buttons")));
for (auto& button_name : udraw_tablet_button_names)
{
m_buttons->AddInput(ControllerEmu::Translate, button_name);
m_buttons->AddInput(Translatability::Translate, button_name);
}
// Stylus
@ -47,8 +49,8 @@ UDrawTablet::UDrawTablet() : Extension3rdParty("uDraw", _trans("uDraw GameTablet
// Touch
groups.emplace_back(m_touch = new ControllerEmu::Triggers(_trans("Touch")));
m_touch->AddInput(ControllerEmu::Translate, _trans("Pressure"));
m_touch->AddInput(ControllerEmu::Translate, _trans("Lift"));
m_touch->AddInput(Translatability::Translate, _trans("Pressure"));
m_touch->AddInput(Translatability::Translate, _trans("Lift"));
}
void UDrawTablet::BuildDesiredExtensionState(DesiredExtensionState* target_state)

View File

@ -206,19 +206,21 @@ void Wiimote::Reset()
Wiimote::Wiimote(const unsigned int index) : m_index(index), m_bt_device_index(index)
{
using Translatability = ControllerEmu::Translatability;
// Buttons
groups.emplace_back(m_buttons = new ControllerEmu::Buttons(BUTTONS_GROUP));
for (auto& named_button : {A_BUTTON, B_BUTTON, ONE_BUTTON, TWO_BUTTON, MINUS_BUTTON, PLUS_BUTTON})
{
m_buttons->AddInput(ControllerEmu::DoNotTranslate, named_button);
m_buttons->AddInput(Translatability::DoNotTranslate, named_button);
}
m_buttons->AddInput(ControllerEmu::DoNotTranslate, HOME_BUTTON, "HOME");
m_buttons->AddInput(Translatability::DoNotTranslate, HOME_BUTTON, "HOME");
// D-Pad
groups.emplace_back(m_dpad = new ControllerEmu::Buttons(DPAD_GROUP));
for (const char* named_direction : named_directions)
{
m_dpad->AddInput(ControllerEmu::Translate, named_direction);
m_dpad->AddInput(Translatability::Translate, named_direction);
}
// i18n: "Point" refers to the action of pointing a Wii Remote.
@ -279,7 +281,7 @@ Wiimote::Wiimote(const unsigned int index) : m_index(index), m_bt_device_index(i
// Rumble
groups.emplace_back(m_rumble = new ControllerEmu::ControlGroup(_trans("Rumble")));
m_rumble->AddOutput(ControllerEmu::Translate, _trans("Motor"));
m_rumble->AddOutput(Translatability::Translate, _trans("Motor"));
// Options
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));

View File

@ -369,7 +369,7 @@ HotkeyManager::HotkeyManager()
groups.emplace_back(m_hotkey_groups[group]);
for (int key = s_groups_info[group].first; key <= s_groups_info[group].last; key++)
{
m_keys[group]->AddInput(ControllerEmu::Translate, s_hotkey_labels[key]);
m_keys[group]->AddInput(ControllerEmu::Translatability::Translate, s_hotkey_labels[key]);
}
}
}

View File

@ -281,7 +281,7 @@ void MappingWidget::CreateControl(const ControllerEmu::Control* control, QFormLa
button->setMinimumWidth(100);
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
const bool translate = control->translate == ControllerEmu::Translate;
const bool translate = control->translate == ControllerEmu::Translatability::Translate;
const QString translated_name =
translate ? tr(control->ui_name.c_str()) : QString::fromStdString(control->ui_name);
layout->addRow(translated_name, button);

View File

@ -10,7 +10,7 @@
namespace ControllerEmu
{
enum Translatability
enum class Translatability
{
DoNotTranslate,
Translate

View File

@ -27,9 +27,9 @@ AnalogStick::AnalogStick(const char* const name_, const char* const ui_name_,
: ReshapableInput(name_, ui_name_, GroupType::Stick), m_stick_gate(std::move(stick_gate))
{
for (auto& named_direction : named_directions)
AddInput(Translate, named_direction);
AddInput(Translatability::Translate, named_direction);
AddInput(Translate, _trans("Modifier"));
AddInput(Translatability::Translate, _trans("Modifier"));
}
AnalogStick::ReshapeData AnalogStick::GetReshapableState(bool adjusted) const

View File

@ -25,12 +25,12 @@ Cursor::Cursor(std::string name_, std::string ui_name_)
m_last_update(Clock::now())
{
for (auto& named_direction : named_directions)
AddInput(Translate, named_direction);
AddInput(Translatability::Translate, named_direction);
AddInput(Translate, _trans("Hide"));
AddInput(Translate, _trans("Recenter"));
AddInput(Translatability::Translate, _trans("Hide"));
AddInput(Translatability::Translate, _trans("Recenter"));
AddInput(Translate, _trans("Relative Input Hold"));
AddInput(Translatability::Translate, _trans("Relative Input Hold"));
// Default values chosen to reach screen edges in most games including the Wii Menu.

View File

@ -17,12 +17,12 @@ namespace ControllerEmu
{
Force::Force(const std::string& name_) : ReshapableInput(name_, name_, GroupType::Force)
{
AddInput(Translate, _trans("Up"));
AddInput(Translate, _trans("Down"));
AddInput(Translate, _trans("Left"));
AddInput(Translate, _trans("Right"));
AddInput(Translate, _trans("Forward"));
AddInput(Translate, _trans("Backward"));
AddInput(Translatability::Translate, _trans("Up"));
AddInput(Translatability::Translate, _trans("Down"));
AddInput(Translatability::Translate, _trans("Left"));
AddInput(Translatability::Translate, _trans("Right"));
AddInput(Translatability::Translate, _trans("Forward"));
AddInput(Translatability::Translate, _trans("Backward"));
AddSetting(&m_distance_setting,
{_trans("Distance"),
@ -126,11 +126,11 @@ Shake::Shake(const std::string& name_, ControlState default_intensity_scale)
: ControlGroup(name_, name_, GroupType::Shake)
{
// i18n: Refers to a 3D axis (used when mapping motion controls)
AddInput(ControllerEmu::Translate, _trans("X"));
AddInput(Translatability::Translate, _trans("X"));
// i18n: Refers to a 3D axis (used when mapping motion controls)
AddInput(ControllerEmu::Translate, _trans("Y"));
AddInput(Translatability::Translate, _trans("Y"));
// i18n: Refers to a 3D axis (used when mapping motion controls)
AddInput(ControllerEmu::Translate, _trans("Z"));
AddInput(Translatability::Translate, _trans("Z"));
AddDeadzoneSetting(&m_deadzone_setting, 50);

View File

@ -15,12 +15,12 @@ namespace ControllerEmu
IMUAccelerometer::IMUAccelerometer(std::string name_, std::string ui_name_)
: ControlGroup(std::move(name_), std::move(ui_name_), GroupType::IMUAccelerometer)
{
AddInput(Translate, _trans("Up"));
AddInput(Translate, _trans("Down"));
AddInput(Translate, _trans("Left"));
AddInput(Translate, _trans("Right"));
AddInput(Translate, _trans("Forward"));
AddInput(Translate, _trans("Backward"));
AddInput(Translatability::Translate, _trans("Up"));
AddInput(Translatability::Translate, _trans("Down"));
AddInput(Translatability::Translate, _trans("Left"));
AddInput(Translatability::Translate, _trans("Right"));
AddInput(Translatability::Translate, _trans("Forward"));
AddInput(Translatability::Translate, _trans("Backward"));
}
bool IMUAccelerometer::AreInputsBound() const

View File

@ -26,7 +26,7 @@ IMUCursor::IMUCursor(std::string name_, std::string ui_name_)
ControlGroup::DefaultValue::Enabled)
#endif
{
AddInput(Translate, _trans("Recenter"));
AddInput(Translatability::Translate, _trans("Recenter"));
// Default values chosen to reach screen edges in most games including the Wii Menu.

View File

@ -26,12 +26,12 @@ static constexpr auto WORST_ACCEPTABLE_CALIBRATION_UPDATE_FREQUENCY = 25;
IMUGyroscope::IMUGyroscope(std::string name_, std::string ui_name_)
: ControlGroup(std::move(name_), std::move(ui_name_), GroupType::IMUGyroscope)
{
AddInput(Translate, _trans("Pitch Up"));
AddInput(Translate, _trans("Pitch Down"));
AddInput(Translate, _trans("Roll Left"));
AddInput(Translate, _trans("Roll Right"));
AddInput(Translate, _trans("Yaw Left"));
AddInput(Translate, _trans("Yaw Right"));
AddInput(Translatability::Translate, _trans("Pitch Up"));
AddInput(Translatability::Translate, _trans("Pitch Down"));
AddInput(Translatability::Translate, _trans("Roll Left"));
AddInput(Translatability::Translate, _trans("Roll Right"));
AddInput(Translatability::Translate, _trans("Yaw Left"));
AddInput(Translatability::Translate, _trans("Yaw Right"));
AddSetting(&m_deadzone_setting,
{_trans("Dead Zone"),

View File

@ -24,7 +24,7 @@ ModifySettingsButton::ModifySettingsButton(std::string button_name)
void ModifySettingsButton::AddInput(std::string button_name, bool toggle)
{
ControlGroup::AddInput(Translate, std::move(button_name));
ControlGroup::AddInput(Translatability::Translate, std::move(button_name));
m_threshold_exceeded.emplace_back(false);
m_associated_settings.emplace_back(false);
m_associated_settings_toggle.emplace_back(toggle);

View File

@ -18,8 +18,8 @@ namespace ControllerEmu
Slider::Slider(const std::string& name_, const std::string& ui_name_)
: ControlGroup(name_, ui_name_, GroupType::Slider)
{
AddInput(Translate, _trans("Left"));
AddInput(Translate, _trans("Right"));
AddInput(Translatability::Translate, _trans("Left"));
AddInput(Translatability::Translate, _trans("Right"));
AddDeadzoneSetting(&m_deadzone_setting, 50);
}

View File

@ -17,12 +17,12 @@ namespace ControllerEmu
{
Tilt::Tilt(const std::string& name_) : ReshapableInput(name_, name_, GroupType::Tilt)
{
AddInput(Translate, _trans("Forward"));
AddInput(Translate, _trans("Backward"));
AddInput(Translate, _trans("Left"));
AddInput(Translate, _trans("Right"));
AddInput(Translatability::Translate, _trans("Forward"));
AddInput(Translatability::Translate, _trans("Backward"));
AddInput(Translatability::Translate, _trans("Left"));
AddInput(Translatability::Translate, _trans("Right"));
AddInput(Translate, _trans("Modifier"));
AddInput(Translatability::Translate, _trans("Modifier"));
AddSetting(&m_max_angle_setting,
{_trans("Angle"),