diff --git a/contributors.md b/contributors.md index 3d0e59c8a3..934aa6f91b 100644 --- a/contributors.md +++ b/contributors.md @@ -266,6 +266,7 @@ Appreciation for contributors who have provided substantial work, but are no lon * Daniel Rödl (danielroedl) * Michael Hlas (mhlas7) * (byteraidhost) +* Ray (RayKoopa) ## Toolchain * (Balletie) - macOS diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 531ee8c8af..73bd55d10a 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3836,3 +3836,4 @@ STR_7036 :Vehicle style STR_7037 :Operating mode STR_7038 :Wait and load STR_7039 :Ride type +STR_7040 :Footpath additions diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9483d0a763..669cf444f7 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.5.5 (in development) ------------------------------------------------------------------------ +- Feature: [#26877] Clear Scenery can remove footpath additions or walls separately. - Improved: [#26099] The ride type selection cheat has been moved into the ride operations tab. - Improved: [#26099] The ride visiblity cheat has been moved into the ride colour/appearance tab. - Improved: [#26862] Add a Liquid Glass app icon for macOS 26 and later. diff --git a/distribution/scripting/openrct2.d.ts b/distribution/scripting/openrct2.d.ts index d3c54dd343..97dee62823 100644 --- a/distribution/scripting/openrct2.d.ts +++ b/distribution/scripting/openrct2.d.ts @@ -838,9 +838,11 @@ declare global { /** * Bitmask. * - * - `1`: `(001)`: Small scenery and walls - * - `2`: `(010)`: Large scenery - * - `4`: `(100)`: Footpaths + * - `1`: `(00001)`: Small scenery (and walls prior to API version 117) + * - `2`: `(00010)`: Large scenery + * - `4`: `(00100)`: Footpaths + * - `8`: `(01000)`: Walls + * - `16`: `(10000)`: Footpath additions */ itemsToClear: number; } @@ -5047,18 +5049,19 @@ declare global { "mountain_tool_even" | "mountain_tool_odd" | "multiplayer" | "multiplayer_desync" | "multiplayer_sync" | "multiplayer_toolbar" | "multiplayer_toolbar_pressed" | "music" | "mute" | "mute_pressed" | "news_messages" | "new_ride" | "next" | "no_entry" | "open" | "paintbrush" | "palette_invisible" | "palette_invisible_pressed" | "park" | - "paste" | "path_railings" | "path_surfaces" | "paths" | "patrol" | "pause" | "pickup" | "placeholder" | "previous" | - "question" | "rct1_close_off" | "rct1_close_off_pressed" | "rct1_close_on" | "rct1_close_on_pressed" | "rct1_open_off" | - "rct1_open_off_pressed" | "rct1_open_on" | "rct1_open_on_pressed" | "rct1_simulate_off" | "rct1_simulate_off_pressed" | - "rct1_simulate_on" | "rct1_simulate_on_pressed" | "rct1_test_off" | "rct1_test_off_pressed" | "rct1_test_on" | - "rct1_test_on_pressed" | "reload" | "rename" | "research" | "ride" | "ride_stations" | "rides_gentle" | - "rides_rollercoasters" | "rides_shop" | "rides_thrill" | "rides_transport" | "rides_water" | "rotate_arrow" | "scenery" | - "scenery_cluster" | "scenery_paths" | "scenery_paths_items" | "scenery_scatter_high" | "scenery_scatter_low" | - "scenery_scatter_medium" | "scenery_signage" | "scenery_statues" | "scenery_trees" | "scenery_urban" | "scenery_walls" | - "search" | "selection_edge_ne" | "selection_edge_nw" | "selection_edge_se" | "selection_edge_sw" | "server_password" | - "shops_and_stalls" | "sideways_tab" | "sideways_tab_active" | "simulate" | "small_scenery" | "sort" | "stats" | "testing" | - "terrain_edges" | "title_play" | "title_restart" | "title_skip" | "title_stop" | "unmute" | "unmute_pressed" | "view" | - "water" | "zoom_in" | "zoom_in_background" | "zoom_out" | "zoom_out_background"; + "paste" | "path_additions" | "path_railings" | "path_surfaces" | "paths" | "patrol" | "pause" | "pickup" | "placeholder" | + "previous" | "question" | "rct1_close_off" | "rct1_close_off_pressed" | "rct1_close_on" | "rct1_close_on_pressed" | + "rct1_open_off" | "rct1_open_off_pressed" | "rct1_open_on" | "rct1_open_on_pressed" | "rct1_simulate_off" | + "rct1_simulate_off_pressed" | "rct1_simulate_on" | "rct1_simulate_on_pressed" | "rct1_test_off" | + "rct1_test_off_pressed" | "rct1_test_on" | "rct1_test_on_pressed" | "reload" | "rename" | "research" | "ride" | + "ride_stations" | "rides_gentle" | "rides_rollercoasters" | "rides_shop" | "rides_thrill" | "rides_transport" | + "rides_water" | "rotate_arrow" | "scenery" | "scenery_cluster" | "scenery_paths" | "scenery_paths_items" | + "scenery_scatter_high" | "scenery_scatter_low" | "scenery_scatter_medium" | "scenery_signage" | "scenery_statues" | + "scenery_trees" | "scenery_urban" | "scenery_walls" | "search" | "selection_edge_ne" | "selection_edge_nw" | + "selection_edge_se" | "selection_edge_sw" | "server_password" | "shops_and_stalls" | "sideways_tab" | + "sideways_tab_active" | "simulate" | "small_scenery" | "sort" | "stats" | "testing" | "terrain_edges" | "title_play" | + "title_restart" | "title_skip" | "title_stop" | "unmute" | "unmute_pressed" | "view" | "walls" | "water" | "zoom_in" | + "zoom_in_background" | "zoom_out" | "zoom_out_background"; interface WidgetBase { readonly window: Window; diff --git a/resources/g2/icons/path_additions.png b/resources/g2/icons/path_additions.png new file mode 100644 index 0000000000..9da8acfade Binary files /dev/null and b/resources/g2/icons/path_additions.png differ diff --git a/resources/g2/icons/walls.png b/resources/g2/icons/walls.png new file mode 100644 index 0000000000..4616660c7d Binary files /dev/null and b/resources/g2/icons/walls.png differ diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index bf119e2b36..83e5f1ca1e 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -656,5 +656,15 @@ "path": "icons/visibility-toggle.png", "x": 1, "y": 1 + }, + { + "path": "icons/path_additions.png", + "x": 1, + "y": 1 + }, + { + "path": "icons/walls.png", + "x": 1, + "y": 1 } ] diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index 4cdc9009de..007702ca09 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -457,6 +457,8 @@ namespace OpenRCT2 STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP = 5274, STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP = 5273, STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP = 5272, + STR_CLEAR_SCENERY_REMOVE_WALLS_TIP = 3187, + STR_CLEAR_SCENERY_REMOVE_FOOTPATH_ADDITIONS_TIP = 7040, // Window: CustomCurrency STR_CURRENCY_FORMAT = 5462, diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 8727b1ec7a..a1e4335348 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -38,23 +38,27 @@ namespace OpenRCT2::Ui::Windows WIDX_INCREMENT, WIDX_SMALL_SCENERY, WIDX_LARGE_SCENERY, - WIDX_FOOTPATH + WIDX_FOOTPATH, + WIDX_WALLS, + WIDX_FOOTPATH_ADDITIONS, }; static constexpr StringId kWindowTitle = STR_CLEAR_SCENERY; - static constexpr ScreenSize kWindowSize = { 98, 94 }; + static constexpr ScreenSize kWindowSize = { 98, 124 }; static constexpr ScreenSize kClearSceneryButtonSize = { 24, 24 }; // clang-format off static constexpr auto window_clear_scenery_widgets = makeWidgets( makeWindowShim(kWindowTitle, kWindowSize), - makeWidget ({ 27, 17 }, { 44, 32 }, WidgetType::imgBtn, WindowColour::primary, SPR_LAND_TOOL_SIZE_0, kStringIdNone ), // preview box - makeRemapWidget({ 28, 18 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP ), // decrement size - makeRemapWidget({ 54, 32 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP ), // increment size - makeRemapWidget({ 7, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_TREES, STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP), // small scenery - makeRemapWidget({ 37, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_LARGE_SCENERY, STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP), // large scenery - makeRemapWidget({ 67, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_FOOTPATH, STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP ) // footpaths + makeWidget ({ 27, 17 }, { 44, 32 }, WidgetType::imgBtn, WindowColour::primary, SPR_LAND_TOOL_SIZE_0, kStringIdNone ), // preview box + makeRemapWidget({ 28, 18 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP ), // decrement size + makeRemapWidget({ 54, 32 }, { 16, 16 }, WidgetType::trnBtn, WindowColour::secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP ), // increment size + makeRemapWidget({ 7, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_TREES, STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP ), // small scenery + makeRemapWidget({ 37, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_LARGE_SCENERY, STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP ), // large scenery + makeRemapWidget({ 22, 83 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_FOOTPATH, STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP ), // footpaths + makeRemapWidget({ 67, 53 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_WALLS, STR_CLEAR_SCENERY_REMOVE_WALLS_TIP ), // walls + makeRemapWidget({ 52, 83 }, kClearSceneryButtonSize, WidgetType::flatBtn, WindowColour::secondary, SPR_G2_BUTTON_PATH_ADDITIONS, STR_CLEAR_SCENERY_REMOVE_FOOTPATH_ADDITIONS_TIP) // footpath additions ); // clang-format on @@ -64,6 +68,8 @@ namespace OpenRCT2::Ui::Windows bool _clearSmallScenery = true; bool _clearLargeScenery = false; bool _clearFootpath = false; + bool _clearWalls = true; + bool _clearFootpathAdditions = false; money64 _clearSceneryCost = kMoney64Undefined; public: @@ -76,6 +82,8 @@ namespace OpenRCT2::Ui::Windows widgetSetPressed(*this, WIDX_SMALL_SCENERY, _clearSmallScenery); widgetSetPressed(*this, WIDX_LARGE_SCENERY, _clearLargeScenery); widgetSetPressed(*this, WIDX_FOOTPATH, _clearFootpath); + widgetSetPressed(*this, WIDX_WALLS, _clearWalls); + widgetSetPressed(*this, WIDX_FOOTPATH_ADDITIONS, _clearFootpathAdditions); WindowInitScrollWidgets(*this); WindowPushOthersBelow(*this); @@ -122,6 +130,16 @@ namespace OpenRCT2::Ui::Windows widgetSetPressed(*this, WIDX_FOOTPATH, _clearFootpath); invalidate(); break; + case WIDX_WALLS: + _clearWalls ^= 1; + widgetSetPressed(*this, WIDX_WALLS, _clearWalls); + invalidate(); + break; + case WIDX_FOOTPATH_ADDITIONS: + _clearFootpathAdditions ^= 1; + widgetSetPressed(*this, WIDX_FOOTPATH_ADDITIONS, _clearFootpathAdditions); + invalidate(); + break; } } @@ -199,7 +217,7 @@ namespace OpenRCT2::Ui::Windows auto ft = Formatter(); ft.Add(_clearSceneryCost); screenCoords.x = widgets[WIDX_PREVIEW].midX() + windowPos.x; - screenCoords.y = widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 + 27; + screenCoords.y = widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 + 57; drawText(rt, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::centre }); } } @@ -216,6 +234,10 @@ namespace OpenRCT2::Ui::Windows itemsToClear |= GameActions::CLEARABLE_ITEMS::kSceneryLarge; if (_clearFootpath) itemsToClear |= GameActions::CLEARABLE_ITEMS::kSceneryFootpath; + if (_clearWalls) + itemsToClear |= GameActions::CLEARABLE_ITEMS::kSceneryWall; + if (_clearFootpathAdditions) + itemsToClear |= GameActions::CLEARABLE_ITEMS::kPathAddition; return GameActions::ClearAction(range, itemsToClear); } diff --git a/src/openrct2/SpriteIds.h b/src/openrct2/SpriteIds.h index 3b6c7e9831..33caeddcef 100644 --- a/src/openrct2/SpriteIds.h +++ b/src/openrct2/SpriteIds.h @@ -1208,6 +1208,8 @@ enum : ImageIndex SPR_G2_ICON_ROTATE_ANTI_CLOCKWISE, SPR_G2_ICON_PATH_DRAG_TOOL, SPR_G2_ICON_VISIBILITY_TOGGLE, + SPR_G2_BUTTON_PATH_ADDITIONS, + SPR_G2_BUTTON_WALLS, SPR_G2_END, diff --git a/src/openrct2/actions/terraform/ClearAction.cpp b/src/openrct2/actions/terraform/ClearAction.cpp index 08bd4abb07..00844d0b78 100644 --- a/src/openrct2/actions/terraform/ClearAction.cpp +++ b/src/openrct2/actions/terraform/ClearAction.cpp @@ -19,6 +19,7 @@ #include "../../world/tile_element/LargeSceneryElement.h" #include "../../world/tile_element/SmallSceneryElement.h" #include "../GameActionRunner.h" +#include "../footpath/FootpathAdditionRemoveAction.h" #include "../footpath/FootpathRemoveAction.h" #include "../scenery/LargeSceneryRemoveAction.h" #include "../scenery/SmallSceneryRemoveAction.h" @@ -158,6 +159,23 @@ namespace OpenRCT2::GameActions totalCost += res.cost; } } + if (!tileEdited && _itemsToClear & CLEARABLE_ITEMS::kPathAddition) + { + auto additionRemoveAction = FootpathAdditionRemoveAction({ tilePos, tileElement->getBaseZ() }); + additionRemoveAction.SetFlags(GetFlags()); + + auto res = executing ? ExecuteNested(&additionRemoveAction, gameState) + : QueryNested(&additionRemoveAction, gameState); + + if (res.error == Status::ok) + { + totalCost += res.cost; + } + else if (res.error == Status::insufficientFunds) + { + totalCost += res.cost; + } + } break; case TileElementType::smallScenery: if (_itemsToClear & CLEARABLE_ITEMS::kScenerySmall) @@ -182,7 +200,7 @@ namespace OpenRCT2::GameActions } break; case TileElementType::wall: - if (_itemsToClear & CLEARABLE_ITEMS::kScenerySmall) + if (_itemsToClear & CLEARABLE_ITEMS::kSceneryWall) { CoordsXYZD wallLocation = { tilePos, tileElement->getBaseZ(), tileElement->getDirection() }; auto wallRemoveAction = WallRemoveAction(wallLocation); diff --git a/src/openrct2/actions/terraform/ClearAction.h b/src/openrct2/actions/terraform/ClearAction.h index cd85eca70d..98d26e8b7a 100644 --- a/src/openrct2/actions/terraform/ClearAction.h +++ b/src/openrct2/actions/terraform/ClearAction.h @@ -20,6 +20,8 @@ namespace OpenRCT2::GameActions constexpr ClearableItems kScenerySmall = 1 << 0; constexpr ClearableItems kSceneryLarge = 1 << 1; constexpr ClearableItems kSceneryFootpath = 1 << 2; + constexpr ClearableItems kSceneryWall = 1 << 3; + constexpr ClearableItems kPathAddition = 1 << 4; } // namespace CLEARABLE_ITEMS class ClearAction final : public GameActionBase diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 6f2811a2e8..6e88c81dae 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -47,7 +47,7 @@ // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -constexpr uint8_t kStreamVersion = 0; +constexpr uint8_t kStreamVersion = 1; const std::string kStreamID = std::string(kOpenRCT2Version) + "-" + std::to_string(kStreamVersion); diff --git a/src/openrct2/scripting/IconNames.hpp b/src/openrct2/scripting/IconNames.hpp index 7a16419261..747e404c6c 100644 --- a/src/openrct2/scripting/IconNames.hpp +++ b/src/openrct2/scripting/IconNames.hpp @@ -175,6 +175,8 @@ namespace OpenRCT2::Scripting { "palette_invisible_pressed_large", SPR_G2_ICON_PALETTE_INVISIBLE_PRESSED_LARGE }, { "monitor_start", SPR_G2_MONITOR_TAB_START }, { "monitor_end", SPR_G2_MONITOR_TAB_END }, + { "path_additions", SPR_G2_BUTTON_PATH_ADDITIONS }, + { "walls", SPR_G2_BUTTON_WALLS }, }; // Maps legacy G2 icons sprite indices to new sprite indices diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 39d3a87767..f2dce72a83 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -43,7 +43,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { // Grepped from CI (.github/workflows/publish-plugin-types.yml); keep the format `kPluginApiVersion = N`. - static constexpr int32_t kPluginApiVersion = 116; + static constexpr int32_t kPluginApiVersion = 117; // Versions marking breaking changes. static constexpr int32_t kApiVersionPeepDeprecation = 33;