1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 16:54:52 +01:00

Create struct for all dropdown-related globals (#25023)

This commit is contained in:
Michael Steenbeek
2025-08-23 13:56:13 +02:00
committed by GitHub
parent 488d6f7a0d
commit 577c3336c6
30 changed files with 392 additions and 391 deletions

View File

@@ -649,12 +649,12 @@ namespace OpenRCT2::Ui::Windows
const auto numItems = std::min<size_t>(items.size(), Dropdown::kItemsMaxSize);
for (size_t i = 0; i < numItems; i++)
{
gDropdownItems[i].format = STR_OPTIONS_DROPDOWN_ITEM;
gDropdown.items[i].format = STR_OPTIONS_DROPDOWN_ITEM;
if (selectedIndex == static_cast<int32_t>(i))
gDropdownItems[i].format = STR_OPTIONS_DROPDOWN_ITEM_SELECTED;
gDropdown.items[i].format = STR_OPTIONS_DROPDOWN_ITEM_SELECTED;
auto sz = items[i].c_str();
std::memcpy(&gDropdownItems[i].args, &sz, sizeof(const char*));
std::memcpy(&gDropdown.items[i].args, &sz, sizeof(const char*));
}
WindowDropdownShowTextCustomWidth(
{ windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1,