diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-03-28 15:24:14 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-03-28 20:26:35 +0200 |
commit | 7119d355eb6dfe18df5d6f505c4216791bfdbd92 (patch) | |
tree | 5d2182ed9122b8c8dfe1c856ac3f7a258c7d3b5d /core/input | |
parent | 2e8510595996478524e5d8ed48d90318f4a56777 (diff) |
String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
Diffstat (limited to 'core/input')
-rw-r--r-- | core/input/input_event.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 52c7c69315..b8ab722b12 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -382,7 +382,7 @@ String InputEventKey::to_string() { } String mods = InputEventWithModifiers::as_text(); - mods = mods.is_empty() ? TTR("none") : mods; + mods = mods.is_empty() ? "none" : mods; return vformat("InputEventKey: keycode=%s, mods=%s, physical=%s, pressed=%s, echo=%s", kc, mods, physical, p, e); } @@ -690,14 +690,14 @@ String InputEventMouseButton::to_string() { case MouseButton::WHEEL_RIGHT: case MouseButton::MB_XBUTTON1: case MouseButton::MB_XBUTTON2: - button_string += " (" + RTR(_mouse_button_descriptions[(size_t)idx - 1]) + ")"; // button index starts from 1, array index starts from 0, so subtract 1 + button_string += vformat(" (%s)", TTRGET(_mouse_button_descriptions[(size_t)idx - 1])); // button index starts from 1, array index starts from 0, so subtract 1 break; default: break; } String mods = InputEventWithModifiers::as_text(); - mods = mods.is_empty() ? TTR("none") : mods; + mods = mods.is_empty() ? "none" : mods; // Work around the fact vformat can only take 5 substitutions but 6 need to be passed. String index_and_mods = vformat("button_index=%s, mods=%s", button_index, mods); @@ -787,19 +787,19 @@ String InputEventMouseMotion::to_string() { String button_mask_string = itos((int64_t)button_mask); switch (button_mask) { case MouseButton::MASK_LEFT: - button_mask_string += " (" + RTR(_mouse_button_descriptions[(size_t)MouseButton::LEFT - 1]) + ")"; + button_mask_string += vformat(" (%s)", TTRGET(_mouse_button_descriptions[(size_t)MouseButton::LEFT - 1])); break; case MouseButton::MASK_MIDDLE: - button_mask_string += " (" + RTR(_mouse_button_descriptions[(size_t)MouseButton::MIDDLE - 1]) + ")"; + button_mask_string += vformat(" (%s)", TTRGET(_mouse_button_descriptions[(size_t)MouseButton::MIDDLE - 1])); break; case MouseButton::MASK_RIGHT: - button_mask_string += " (" + RTR(_mouse_button_descriptions[(size_t)MouseButton::RIGHT - 1]) + ")"; + button_mask_string += vformat(" (%s)", TTRGET(_mouse_button_descriptions[(size_t)MouseButton::RIGHT - 1])); break; case MouseButton::MASK_XBUTTON1: - button_mask_string += " (" + RTR(_mouse_button_descriptions[(size_t)MouseButton::MB_XBUTTON1 - 1]) + ")"; + button_mask_string += vformat(" (%s)", TTRGET(_mouse_button_descriptions[(size_t)MouseButton::MB_XBUTTON1 - 1])); break; case MouseButton::MASK_XBUTTON2: - button_mask_string += " (" + RTR(_mouse_button_descriptions[(size_t)MouseButton::MB_XBUTTON2 - 1]) + ")"; + button_mask_string += vformat(" (%s)", TTRGET(_mouse_button_descriptions[(size_t)MouseButton::MB_XBUTTON2 - 1])); break; default: break; @@ -961,9 +961,9 @@ static const char *_joy_axis_descriptions[(size_t)JoyAxis::MAX] = { }; String InputEventJoypadMotion::as_text() const { - String desc = axis < JoyAxis::MAX ? RTR(_joy_axis_descriptions[(size_t)axis]) : TTR("Unknown Joypad Axis"); + String desc = axis < JoyAxis::MAX ? TTRGET(_joy_axis_descriptions[(size_t)axis]) : RTR("Unknown Joypad Axis"); - return vformat(TTR("Joypad Motion on Axis %d (%s) with Value %.2f"), axis, desc, axis_value); + return vformat(RTR("Joypad Motion on Axis %d (%s) with Value %.2f"), axis, desc, axis_value); } String InputEventJoypadMotion::to_string() { |