From db5f56f4aabac9d6fc66f31eff8e60de2f9a4ad4 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 21 Sep 2025 17:31:36 +0200 Subject: [PATCH] Scripting: order available costumes array by display name (#25228) --- distribution/changelog.txt | 1 + src/openrct2/peep/PeepAnimations.cpp | 3 +++ src/openrct2/peep/PeepAnimations.h | 1 + 3 files changed, 5 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 15500522a3..dc8c05d9f0 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Improved: [#2296, #2307] The land tool now takes sloped track and paths into account when modifying land. - Change: [#25161] Revert to the ‘fair ride price’ calculation of vanilla RCT2. +- Change: [#25228] [Plugin] The available staff costumes array is now ordered alphabetically by name. - Fix: [#24513] Ride/track designs can now be shifted underground as well. - Fix: [#24682] The scenery window isn't enough to accommodate all tool buttons when there are multiple rows of groups/tabs. - Fix: [#24882] Guests are shown with hats and umbrellas whilst clapping. diff --git a/src/openrct2/peep/PeepAnimations.cpp b/src/openrct2/peep/PeepAnimations.cpp index c528925ad7..5b86a1fa43 100644 --- a/src/openrct2/peep/PeepAnimations.cpp +++ b/src/openrct2/peep/PeepAnimations.cpp @@ -233,11 +233,14 @@ namespace OpenRCT2 .objectId = ObjectEntryIndex(i), .group = group, .legacyPosition = animObj->GetLegacyPosition(group), + .rawName = animObj->GetCostumeName(), .scriptName = scriptName, }); } } + std::sort(groups.begin(), groups.end(), [](const auto& a, const auto& b) { return a.rawName < b.rawName; }); + return groups; } diff --git a/src/openrct2/peep/PeepAnimations.h b/src/openrct2/peep/PeepAnimations.h index 8400f0f49c..284fd6b2b8 100644 --- a/src/openrct2/peep/PeepAnimations.h +++ b/src/openrct2/peep/PeepAnimations.h @@ -85,6 +85,7 @@ namespace OpenRCT2 ObjectEntryIndex objectId; PeepAnimationGroup group; RCT12PeepAnimationGroup legacyPosition; + std::string rawName; std::string_view scriptName; };