From ea5cf169242a6c02a9c7db34d52bbf43c7df8824 Mon Sep 17 00:00:00 2001 From: TELK Date: Tue, 23 Feb 2021 16:11:53 +0900 Subject: [PATCH 1/5] Feature: Make ride construction shortcuts work for footpath too --- src/openrct2-ui/input/Shortcuts.cpp | 107 +++++++++++++++++++++++++-- src/openrct2-ui/windows/Footpath.cpp | 97 ++++++++++++++++++++++++ src/openrct2/interface/Window.h | 7 ++ 3 files changed, 205 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index ed0354c942..c1e06e440e 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -609,6 +609,101 @@ static void ShortcutToggleConsole() } } +static void ShortcutConstructionTurnLeft() +{ + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + return; + + rct_window* window = window_find_by_class(WC_FOOTPATH); + if (window != nullptr) + { + window_footpath_keyboard_shortcut_turn_left(); + } + else + { + window_ride_construction_keyboard_shortcut_turn_left(); + } +} + +static void ShortcutConstructionTurnRight() +{ + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + return; + rct_window* window = window_find_by_class(WC_FOOTPATH); + if (window != nullptr) + { + window_footpath_keyboard_shortcut_turn_right(); + } + else + { + window_ride_construction_keyboard_shortcut_turn_right(); + } +} + +static void ShortcutConstructionSlopeUp() +{ + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + return; + + rct_window* window = window_find_by_class(WC_FOOTPATH); + if (window != nullptr) + { + window_footpath_keyboard_shortcut_slope_up(); + } + else + { + window_ride_construction_keyboard_shortcut_slope_up(); + } +} + +static void ShortcutConstructionBuildCurrent() +{ + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + return; + + rct_window* window = window_find_by_class(WC_FOOTPATH); + if (window != nullptr) + { + window_footpath_keyboard_shortcut_build_current(); + } + else + { + window_ride_construction_keyboard_shortcut_build_current(); + } +} + +static void ShortcutConstructionSlopeDown() +{ + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + return; + + rct_window* window = window_find_by_class(WC_FOOTPATH); + if (window != nullptr) + { + window_footpath_keyboard_shortcut_slope_down(); + } + else + { + window_ride_construction_keyboard_shortcut_slope_down(); + } +} + +static void ShortcutConstructionDemolishCurrent() +{ + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + return; + + rct_window* window = window_find_by_class(WC_FOOTPATH); + if (window != nullptr) + { + window_footpath_keyboard_shortcut_demolish_current(); + } + else + { + window_ride_construction_keyboard_shortcut_demolish_current(); + } +} + #pragma endregion using namespace OpenRCT2::Ui; @@ -737,18 +832,18 @@ void ShortcutManager::RegisterDefaultShortcuts() RegisterShortcut(ShortcutId::ViewToggleGridlines, STR_SHORTCUT_GRIDLINES_DISPLAY_TOGGLE, "7", []() { ToggleViewFlag(VIEWPORT_FLAG_GRIDLINES); }); // Window - RegisterShortcut(ShortcutId::WindowRideConstructionTurnLeft, STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", []() { window_ride_construction_keyboard_shortcut_turn_left(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionTurnRight, STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", []() { window_ride_construction_keyboard_shortcut_turn_right(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionTurnLeft, STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", []() { ShortcutConstructionTurnLeft(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionTurnRight, STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", []() { ShortcutConstructionTurnRight(); }); RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_RIDE_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", []() { window_ride_construction_keyboard_shortcut_use_track_default(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionSlopeDown, STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", []() { window_ride_construction_keyboard_shortcut_slope_down(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionSlopeUp, STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", []() { window_ride_construction_keyboard_shortcut_slope_up(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionSlopeDown, STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", []() { ShortcutConstructionSlopeDown(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionSlopeUp, STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", []() { ShortcutConstructionSlopeUp(); }); RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_RIDE_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", []() { window_ride_construction_keyboard_shortcut_chain_lift_toggle(); }); RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_RIDE_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", []() { window_ride_construction_keyboard_shortcut_bank_left(); }); RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_RIDE_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", []() { window_ride_construction_keyboard_shortcut_bank_right(); }); RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_RIDE_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", []() { window_ride_construction_keyboard_shortcut_previous_track(); }); RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_RIDE_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", []() { window_ride_construction_keyboard_shortcut_next_track(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", []() { window_ride_construction_keyboard_shortcut_build_current(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", []() { window_ride_construction_keyboard_shortcut_demolish_current(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", []() { ShortcutConstructionBuildCurrent(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", []() { ShortcutConstructionDemolishCurrent(); }); RegisterShortcut(ShortcutId::WindowTileInspectorInsertCorrupt, STR_SHORTCUT_INSERT_CORRPUT_ELEMENT, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_CORRUPT); }); RegisterShortcut(ShortcutId::WindowTileInspectorCopy, STR_SHORTCUT_COPY_ELEMENT, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_COPY); }); diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index bd7c1a68c6..4599e43a87 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1242,3 +1242,100 @@ static bool footpath_select_default() return true; } } + +void window_footpath_keyboard_shortcut_turn_left() +{ + rct_window* w = window_find_by_class(WC_FOOTPATH); + if (w == nullptr || WidgetIsDisabled(w, WIDX_DIRECTION_NW) || WidgetIsDisabled(w, WIDX_DIRECTION_NE) + || WidgetIsDisabled(w, WIDX_DIRECTION_SW) || WidgetIsDisabled(w, WIDX_DIRECTION_SE) + || gFootpathConstructionMode != 2) + { + return; + } + int32_t currentRotation = get_current_rotation(); + int32_t turnedRotation = gFootpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? 1 : -1); + window_footpath_mousedown_direction(turnedRotation); +} + +void window_footpath_keyboard_shortcut_turn_right() +{ + rct_window* w = window_find_by_class(WC_FOOTPATH); + if (w == nullptr || WidgetIsDisabled(w, WIDX_DIRECTION_NW) || WidgetIsDisabled(w, WIDX_DIRECTION_NE) + || WidgetIsDisabled(w, WIDX_DIRECTION_SW) || WidgetIsDisabled(w, WIDX_DIRECTION_SE) + || gFootpathConstructionMode != 2) + { + return; + } + int32_t currentRotation = get_current_rotation(); + int32_t turnedRotation = gFootpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? -1 : 1); + window_footpath_mousedown_direction(turnedRotation); +} + +void window_footpath_keyboard_shortcut_slope_down() +{ + rct_window* w = window_find_by_class(WC_FOOTPATH); + if (w == nullptr || WidgetIsDisabled(w, WIDX_SLOPEDOWN) || WidgetIsDisabled(w, WIDX_LEVEL) + || WidgetIsDisabled(w, WIDX_SLOPEUP) || w->widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) + { + return; + } + + switch (gFootpathConstructSlope) + { + case 0: + window_event_mouse_down_call(w, WIDX_SLOPEDOWN); + break; + case 2: + window_event_mouse_down_call(w, WIDX_LEVEL); + break; + default: + case 6: + return; + } +} + +void window_footpath_keyboard_shortcut_slope_up() +{ + rct_window* w = window_find_by_class(WC_FOOTPATH); + if (w == nullptr || WidgetIsDisabled(w, WIDX_SLOPEDOWN) || WidgetIsDisabled(w, WIDX_LEVEL) + || WidgetIsDisabled(w, WIDX_SLOPEUP) || w->widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) + { + return; + } + + switch (gFootpathConstructSlope) + { + case 6: + window_event_mouse_down_call(w, WIDX_LEVEL); + break; + case 0: + window_event_mouse_down_call(w, WIDX_SLOPEUP); + break; + default: + case 2: + return; + } +} + +void window_footpath_keyboard_shortcut_demolish_current() +{ + rct_window* w = window_find_by_class(WC_FOOTPATH); + if (w == nullptr || WidgetIsDisabled(w, WIDX_REMOVE) || w->widgets[WIDX_REMOVE].type == WindowWidgetType::Empty + || (!gCheatsBuildInPauseMode && game_is_paused())) + { + return; + } + + window_footpath_remove(); +} + +void window_footpath_keyboard_shortcut_build_current() +{ + rct_window* w = window_find_by_class(WC_FOOTPATH); + if (w == nullptr || WidgetIsDisabled(w, WIDX_CONSTRUCT) || w->widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) + { + return; + } + + window_event_mouse_up_call(w, WIDX_CONSTRUCT); +} diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 0aa1795afa..cbd37800c8 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -876,6 +876,13 @@ void window_ride_construction_keyboard_shortcut_next_track(); void window_ride_construction_keyboard_shortcut_build_current(); void window_ride_construction_keyboard_shortcut_demolish_current(); +void window_footpath_keyboard_shortcut_turn_left(); +void window_footpath_keyboard_shortcut_turn_right(); +void window_footpath_keyboard_shortcut_slope_down(); +void window_footpath_keyboard_shortcut_slope_up(); +void window_footpath_keyboard_shortcut_build_current(); +void window_footpath_keyboard_shortcut_demolish_current(); + void window_follow_sprite(rct_window* w, size_t spriteIndex); void window_unfollow_sprite(rct_window* w); From 99e72dde3f701780645cd99ed0e48d0179260556 Mon Sep 17 00:00:00 2001 From: TELK Date: Wed, 24 Feb 2021 16:50:40 +0900 Subject: [PATCH 2/5] Change StringIds to more generic --- src/openrct2-ui/input/Shortcuts.cpp | 24 ++++++++++++------------ src/openrct2/localisation/StringIds.h | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index c1e06e440e..6f61b58bb6 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -832,18 +832,18 @@ void ShortcutManager::RegisterDefaultShortcuts() RegisterShortcut(ShortcutId::ViewToggleGridlines, STR_SHORTCUT_GRIDLINES_DISPLAY_TOGGLE, "7", []() { ToggleViewFlag(VIEWPORT_FLAG_GRIDLINES); }); // Window - RegisterShortcut(ShortcutId::WindowRideConstructionTurnLeft, STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", []() { ShortcutConstructionTurnLeft(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionTurnRight, STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", []() { ShortcutConstructionTurnRight(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_RIDE_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", []() { window_ride_construction_keyboard_shortcut_use_track_default(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionSlopeDown, STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", []() { ShortcutConstructionSlopeDown(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionSlopeUp, STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", []() { ShortcutConstructionSlopeUp(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_RIDE_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", []() { window_ride_construction_keyboard_shortcut_chain_lift_toggle(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_RIDE_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", []() { window_ride_construction_keyboard_shortcut_bank_left(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_RIDE_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", []() { window_ride_construction_keyboard_shortcut_bank_right(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_RIDE_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", []() { window_ride_construction_keyboard_shortcut_previous_track(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_RIDE_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", []() { window_ride_construction_keyboard_shortcut_next_track(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", []() { ShortcutConstructionBuildCurrent(); }); - RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", []() { ShortcutConstructionDemolishCurrent(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionTurnLeft, STR_SHORTCUT_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", []() { ShortcutConstructionTurnLeft(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionTurnRight, STR_SHORTCUT_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", []() { ShortcutConstructionTurnRight(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", []() { window_ride_construction_keyboard_shortcut_use_track_default(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionSlopeDown, STR_SHORTCUT_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", []() { ShortcutConstructionSlopeDown(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionSlopeUp, STR_SHORTCUT_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", []() { ShortcutConstructionSlopeUp(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", []() { window_ride_construction_keyboard_shortcut_chain_lift_toggle(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", []() { window_ride_construction_keyboard_shortcut_bank_left(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", []() { window_ride_construction_keyboard_shortcut_bank_right(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", []() { window_ride_construction_keyboard_shortcut_previous_track(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", []() { window_ride_construction_keyboard_shortcut_next_track(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", []() { ShortcutConstructionBuildCurrent(); }); + RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", []() { ShortcutConstructionDemolishCurrent(); }); RegisterShortcut(ShortcutId::WindowTileInspectorInsertCorrupt, STR_SHORTCUT_INSERT_CORRPUT_ELEMENT, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_CORRUPT); }); RegisterShortcut(ShortcutId::WindowTileInspectorCopy, STR_SHORTCUT_COPY_ELEMENT, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_COPY); }); diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index b8d7875761..dbbbe656a6 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3426,18 +3426,18 @@ enum STR_TILE_INSPECTOR_PATH_SLOPED = 6015, STR_ACTION_MODIFY_TILE = 6016, STR_NETWORK_ACTION_RATE_LIMIT_MESSAGE = 6017, - STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_LEFT = 6018, - STR_SHORTCUT_RIDE_CONSTRUCTION_TURN_RIGHT = 6019, - STR_SHORTCUT_RIDE_CONSTRUCTION_USE_TRACK_DEFAULT = 6020, - STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_DOWN = 6021, - STR_SHORTCUT_RIDE_CONSTRUCTION_SLOPE_UP = 6022, - STR_SHORTCUT_RIDE_CONSTRUCTION_CHAIN_LIFT_TOGGLE = 6023, - STR_SHORTCUT_RIDE_CONSTRUCTION_BANK_LEFT = 6024, - STR_SHORTCUT_RIDE_CONSTRUCTION_BANK_RIGHT = 6025, - STR_SHORTCUT_RIDE_CONSTRUCTION_PREVIOUS_TRACK = 6026, - STR_SHORTCUT_RIDE_CONSTRUCTION_NEXT_TRACK = 6027, - STR_SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT = 6028, - STR_SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT = 6029, + STR_SHORTCUT_CONSTRUCTION_TURN_LEFT = 6018, + STR_SHORTCUT_CONSTRUCTION_TURN_RIGHT = 6019, + STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT = 6020, + STR_SHORTCUT_CONSTRUCTION_SLOPE_DOWN = 6021, + STR_SHORTCUT_CONSTRUCTION_SLOPE_UP = 6022, + STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE = 6023, + STR_SHORTCUT_CONSTRUCTION_BANK_LEFT = 6024, + STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT = 6025, + STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK = 6026, + STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK = 6027, + STR_SHORTCUT_CONSTRUCTION_BUILD_CURRENT = 6028, + STR_SHORTCUT_CONSTRUCTION_DEMOLISH_CURRENT = 6029, STR_SCENERY_EYEDROPPER_TIP = 6030, From 25bbbef7d13f1718faf99f1346dfd358accd270b Mon Sep 17 00:00:00 2001 From: TELK Date: Wed, 3 Mar 2021 00:02:46 +0900 Subject: [PATCH 3/5] Fix code formatting --- src/openrct2-ui/windows/Footpath.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 4599e43a87..0aee123f88 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1247,8 +1247,7 @@ void window_footpath_keyboard_shortcut_turn_left() { rct_window* w = window_find_by_class(WC_FOOTPATH); if (w == nullptr || WidgetIsDisabled(w, WIDX_DIRECTION_NW) || WidgetIsDisabled(w, WIDX_DIRECTION_NE) - || WidgetIsDisabled(w, WIDX_DIRECTION_SW) || WidgetIsDisabled(w, WIDX_DIRECTION_SE) - || gFootpathConstructionMode != 2) + || WidgetIsDisabled(w, WIDX_DIRECTION_SW) || WidgetIsDisabled(w, WIDX_DIRECTION_SE) || gFootpathConstructionMode != 2) { return; } @@ -1261,8 +1260,7 @@ void window_footpath_keyboard_shortcut_turn_right() { rct_window* w = window_find_by_class(WC_FOOTPATH); if (w == nullptr || WidgetIsDisabled(w, WIDX_DIRECTION_NW) || WidgetIsDisabled(w, WIDX_DIRECTION_NE) - || WidgetIsDisabled(w, WIDX_DIRECTION_SW) || WidgetIsDisabled(w, WIDX_DIRECTION_SE) - || gFootpathConstructionMode != 2) + || WidgetIsDisabled(w, WIDX_DIRECTION_SW) || WidgetIsDisabled(w, WIDX_DIRECTION_SE) || gFootpathConstructionMode != 2) { return; } From 57a9b0f85e379e991f0a7ed03ee443bf5f1236dd Mon Sep 17 00:00:00 2001 From: TELK Date: Thu, 4 Mar 2021 18:06:49 +0900 Subject: [PATCH 4/5] Change Ride construction strings into "Construction" --- data/language/en-GB.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index d7a5b39ed7..731503f563 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3293,18 +3293,18 @@ STR_6014 :Guests will only pay entrance tickets for rides and services.{NEWLI STR_6015 :Sloped STR_6016 :Modify Tile STR_6017 :Please slow down -STR_6018 :Ride construction - Turn left -STR_6019 :Ride construction - Turn right -STR_6020 :Ride construction - Use default track -STR_6021 :Ride construction - Slope down -STR_6022 :Ride construction - Slope up -STR_6023 :Ride construction - Toggle chain lift -STR_6024 :Ride construction - Bank left -STR_6025 :Ride construction - Bank right -STR_6026 :Ride construction - Previous track -STR_6027 :Ride construction - Next track -STR_6028 :Ride construction - Build current -STR_6029 :Ride construction - Demolish current +STR_6018 :Construction - Turn left +STR_6019 :Construction - Turn right +STR_6020 :Construction - Use default track +STR_6021 :Construction - Slope down +STR_6022 :Construction - Slope up +STR_6023 :Construction - Toggle chain lift +STR_6024 :Construction - Bank left +STR_6025 :Construction - Bank right +STR_6026 :Construction - Previous track +STR_6027 :Construction - Next track +STR_6028 :Construction - Build current +STR_6029 :Construction - Demolish current STR_6030 :Scenery picker. Click any scenery on the map to select the same piece for construction. STR_6031 :Server Description: STR_6032 :Server Greeting: From d5646200c0b520c140f1823ea9bd275238e5cf7a Mon Sep 17 00:00:00 2001 From: TELK Date: Sat, 6 Mar 2021 10:10:46 +0900 Subject: [PATCH 5/5] Add changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 3063b045ad..4a3336dcf7 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -20,6 +20,7 @@ - Feature: [#13675] [Plugin] Add context.setInterval and context.setTimeout. - Feature: [#13848] Replace shortcut engine allowing multiple bindings from different input devices. - Feature: [#13927] [Plugin] Add isVisible and text box widget. +- Feature: [#13965] Make ride construction shortcuts work for footpath, too. - Feature: [#13969] [Plugin] Add APIs for editing title sequences. - Feature: [#14002] [Plugin] Use allowed_hosts when checking the binding IP for listening. - Feature: [#14059] [Plugin] Add optional filter to custom tools.