diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b9c63b5763..3266928ffd 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -3,6 +3,7 @@ - Improved: [#23260] Add diagonal (block) brakes to LSM Launched Roller Coaster. - Improved: [#23350] Increased the maximum width of the ride graph window. - Improved: [#23404] Folders are now paired with an icon in the load/save window. +- Change: [#23413] The max number of park entrance objects has been raised to 255. - Fix: [#23286] Currency formatted incorrectly in the in game console. - Fix: [#23348] Console set commands don't print output properly. - Fix: [#23376] Peeps with balloons, hats and umbrellas may leave artifacts on screen. diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 5a74703035..9531fa6ffd 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -89,6 +89,15 @@ namespace OpenRCT2::Ui::Windows } } + size_t GetNumRows() + { + auto numRows = _entranceTypes.size() / kNumColumns; + if (_entranceTypes.size() % kNumColumns > 0) + numRows++; + + return numRows; + } + void PaintPreview(DrawPixelInfo& dpi, ImageIndex imageStart, ScreenCoordsXY screenCoords, Direction direction) { imageStart += (direction * 3); @@ -221,7 +230,7 @@ namespace OpenRCT2::Ui::Windows if (column >= 5) return OBJECT_ENTRY_INDEX_NULL; - size_t index = column + (row * 5); + size_t index = column + (row * kNumColumns); if (index >= _entranceTypes.size()) return OBJECT_ENTRY_INDEX_NULL; @@ -234,14 +243,14 @@ namespace OpenRCT2::Ui::Windows widgets = _widgets; InitScrollWidgets(); + InitParkEntranceItems(); list_information_type = 0; min_width = kWindowWidth; min_height = kWindowHeight; max_width = kWindowWidth; - max_height = kWindowHeight; + max_height = static_cast(43 + kImageSize * GetNumRows()); - InitParkEntranceItems(); pressed_widgets |= 1LL << WIDX_TAB; ToolSet(*this, WIDX_LIST, Tool::EntranceDown); @@ -274,6 +283,14 @@ namespace OpenRCT2::Ui::Windows Close(); } + void OnPrepareDraw() override + { + ResizeFrameWithPage(); + + widgets[WIDX_LIST].right = width - 30; + widgets[WIDX_LIST].bottom = height - 5; + } + void OnDraw(DrawPixelInfo& dpi) override { DrawWidgets(dpi); @@ -341,6 +358,13 @@ namespace OpenRCT2::Ui::Windows HideConstructionRights(); } + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + auto scrollHeight = static_cast(GetNumRows() * kImageSize); + + return ScreenSize(kImageSize * kNumColumns, scrollHeight); + } + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { auto highlighted = ScrollGetEntranceListItemAt(screenCoords); diff --git a/src/openrct2/object/ObjectLimits.h b/src/openrct2/object/ObjectLimits.h index 5af71860ec..795d7d90b5 100644 --- a/src/openrct2/object/ObjectLimits.h +++ b/src/openrct2/object/ObjectLimits.h @@ -21,7 +21,7 @@ constexpr uint16_t kMaxBannerObjects = 255; constexpr uint16_t kMaxPathObjects = 255; constexpr uint16_t kMaxPathAdditionObjects = 255; constexpr uint16_t kMaxSceneryGroupObjects = 255; -constexpr uint16_t kMaxParkEntranceObjects = 4; +constexpr uint16_t kMaxParkEntranceObjects = 255; constexpr uint16_t kMaxWaterObjects = 1; constexpr uint16_t kMaxScenarioTextObjects = 1; constexpr uint16_t kMaxTerrainSurfaceObjects = 255; diff --git a/src/openrct2/park/ParkFile.h b/src/openrct2/park/ParkFile.h index 1eb787d3f5..d96efaafc2 100644 --- a/src/openrct2/park/ParkFile.h +++ b/src/openrct2/park/ParkFile.h @@ -11,7 +11,7 @@ namespace OpenRCT2 struct GameState_t; // Current version that is saved. - constexpr uint32_t PARK_FILE_CURRENT_VERSION = 46; + constexpr uint32_t PARK_FILE_CURRENT_VERSION = 47; // The minimum version that is forwards compatible with the current version. constexpr uint32_t PARK_FILE_MIN_VERSION = 45; @@ -35,6 +35,7 @@ namespace OpenRCT2 constexpr uint16_t kExtendedCorkscrewCoasterVersion = 42; constexpr uint16_t kExtendedTwisterCoasterVersion = 43; constexpr uint16_t kExtendedBoatHireVersion = 46; + constexpr uint16_t kParkEntranceObjectLimitIncreased = 47; } // namespace OpenRCT2 class ParkFileExporter