From fcd16cb00a2be128a1a809a6a0dc485e043c01d6 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Sun, 21 Dec 2025 12:49:17 +0100 Subject: [PATCH] Close #25515: create a specific permission for the path drag tool (#25675) --- data/language/en-GB.txt | 3 ++- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Footpath.cpp | 13 +++++++++++++ src/openrct2/localisation/StringIds.h | 2 ++ src/openrct2/network/NetworkAction.cpp | 5 +++++ src/openrct2/network/NetworkAction.h | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 391cbca697..ce4f078c69 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3841,4 +3841,5 @@ STR_7008 :Unknown ride type ({INT32}) STR_7009 :Receiving scripts… STR_7010 :Could not start replay, file ‘{STRING}’ doesn’t exist or isn’t valid STR_7011 :Could not start replay -STR_7012 :Polish Złoty (PLN) \ No newline at end of file +STR_7012 :Polish Złoty (PLN) +STR_7013 :Drag areas of path diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 597204f61c..9781c7bfc0 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.30 (in development) ------------------------------------------------------------------------ - Improved: [#24912] Staff now use an appropriate standing animation while waiting at level crossings. +- Improved: [#25515] Path dragging can now be disabled via multiplayer group permissions. - Improved: [#25529] The map selection grid no longer redraws every frame if it has not changed. - Improved: [#25530] Wall dragging can now be cancelled without closing the Scenery window. - Improved: [#25575] Updated the network protocol to a new format that supports larger packets, allowing clients to connect reliably to servers with many objects or large maps. diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 7f89c38540..8d7546ab0f 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -532,6 +533,18 @@ namespace OpenRCT2::Ui::Windows ? WidgetType::imgBtn : WidgetType::empty; +#ifndef DISABLE_NETWORK + bool canDrag = true; + if (Network::GetMode() == Network::Mode::client) + { + canDrag = Network::CanPerformAction(Network::GetCurrentPlayerGroupIndex(), Network::Permission::dragPathArea); + } + if (canDrag) + disabledWidgets &= ~(1uLL << WIDX_CONSTRUCT_DRAG_AREA); + else + disabledWidgets |= (1uLL << WIDX_CONSTRUCT_DRAG_AREA); +#endif + if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull) { widgets[WIDX_RAILINGS_TYPE].type = WidgetType::flatBtn; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 07ddcc1a96..397ec2d7da 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -1762,6 +1762,8 @@ enum : StringId STR_REPLAY_FILE_NOT_FOUND = 7010, STR_REPLAY_NOT_STARTED = 7011, + STR_ACTION_PATH_DRAG_AREA = 7013, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings }; diff --git a/src/openrct2/network/NetworkAction.cpp b/src/openrct2/network/NetworkAction.cpp index a9bb710edc..f6d66ba75d 100644 --- a/src/openrct2/network/NetworkAction.cpp +++ b/src/openrct2/network/NetworkAction.cpp @@ -266,6 +266,11 @@ namespace OpenRCT2::Network GameCommand::EditScenarioOptions, }, }, + NetworkAction{ + STR_ACTION_PATH_DRAG_AREA, + "PERMISSION_DRAG_PATH_AREA", + {}, + }, }; } // namespace OpenRCT2::Network diff --git a/src/openrct2/network/NetworkAction.h b/src/openrct2/network/NetworkAction.h index d82feac9be..37b6b47baf 100644 --- a/src/openrct2/network/NetworkAction.h +++ b/src/openrct2/network/NetworkAction.h @@ -43,6 +43,7 @@ namespace OpenRCT2::Network passwordlessLogin, modifyTile, editScenarioOptions, + dragPathArea, count, };