From 5f60dc4081686e2e57d8fe629b5788286370a73a Mon Sep 17 00:00:00 2001 From: Ian-Polito Date: Sat, 9 Apr 2022 17:50:17 +0200 Subject: [PATCH] Take the nice additional changes from #16095 --- src/openrct2-ui/windows/Scenery.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 87d1a8b84b..7685054c02 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -32,7 +32,8 @@ constexpr int32_t WINDOW_SCENERY_MIN_WIDTH = 634; constexpr int32_t WINDOW_SCENERY_MIN_HEIGHT = 180; constexpr int32_t SCENERY_BUTTON_WIDTH = 66; constexpr int32_t SCENERY_BUTTON_HEIGHT = 80; -constexpr int32_t SceneryTabWidth = 31; +constexpr int32_t TabWidth = 31; +constexpr int32_t MaxTabs = 32; constexpr uint8_t SceneryContentScrollIndex = 0; @@ -734,8 +735,7 @@ public: { _tabEntries.clear(); - auto maxTabs = 32; - for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < maxTabs - 1; scenerySetIndex++) + for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < MaxTabs - 1; scenerySetIndex++) { const auto* sceneryGroupEntry = get_scenery_group_entry(scenerySetIndex); if (sceneryGroupEntry != nullptr && scenery_group_is_invented(scenerySetIndex)) @@ -816,7 +816,7 @@ public: } // Set required width - _requiredWidth = static_cast(_tabEntries.size()) * SceneryTabWidth + 5; + _requiredWidth = static_cast(_tabEntries.size()) * TabWidth + 5; SortTabs(); PrepareWidgets(); @@ -1024,7 +1024,7 @@ private: for (const auto& tabInfo : _tabEntries) { auto widget = MakeTab(pos, STR_STRING_DEFINED_TOOLTIP); - pos.x += 31; + pos.x += TabWidth; if (tabInfo.SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) {