forked from rosebudai/OpenRCT2-Web
Add Walls-only and Footpath Addition modes to Clear Scenery (#26877)
* Add two new modes for Clear Scenery. - Split "Walls" from "Small Scenery" into own mode - Add "Footpath Additions" mode
This commit is contained in:
1 parent
263cb53047
commit
5a814722e1
15 files changed
+91
-27
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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.
|
||||
|
||||
Vendored
+18
-15
@@ -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;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 449 B |
Binary file not shown.
|
After Width: | Height: | Size: 476 B |
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -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,
|
||||
|
||||
@@ -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<money64>(_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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<GameCommand::clearScenery>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user