mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 17:42:29 +01:00
Order custom menus consistently by label text (#24067)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
- Feature: [#23876] New park save files now contain a preview image, shown in the load/save window.
|
||||
- Change: [#23932] The land rights window now checks “Land Owned” by default.
|
||||
- Change: [#23936] The ‘guests prefer less/more intense rides’ settings have been turned into a dropdown.
|
||||
- Change: [#24067] [Plugin] Registered menu items are now listed alphabetically.
|
||||
- Fix: [#4225] Ride Construction window offers non-existent banked sloped to level curve (original bug).
|
||||
- Fix: [#5281] Missing supports on miniature railways built backwards.
|
||||
- Fix: [#10379] Banners outside the park can be renamed and modified (original bug).
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "ScViewport.hpp"
|
||||
#include "ScWindow.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Input.h>
|
||||
@@ -324,6 +325,7 @@ namespace OpenRCT2::Scripting
|
||||
auto& execInfo = _scriptEngine.GetExecInfo();
|
||||
auto owner = execInfo.GetCurrentPlugin();
|
||||
CustomMenuItems.emplace_back(owner, CustomToolbarMenuItemKind::Standard, text, callback);
|
||||
std::ranges::sort(CustomMenuItems, [](auto&& a, auto&& b) { return a.Text < b.Text; });
|
||||
}
|
||||
|
||||
void registerToolboxMenuItem(const std::string& text, DukValue callback)
|
||||
@@ -333,6 +335,7 @@ namespace OpenRCT2::Scripting
|
||||
if (owner->GetMetadata().Type == PluginType::Intransient)
|
||||
{
|
||||
CustomMenuItems.emplace_back(owner, CustomToolbarMenuItemKind::Toolbox, text, callback);
|
||||
std::ranges::sort(CustomMenuItems, [](auto&& a, auto&& b) { return a.Text < b.Text; });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user