1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Raise max number of park entrance objects to 255 (#23413)

* Raise max number of park entrance objects to 255

* Implement EditorParkEntrance::OnScrollGetSize

* Allow resizing the entrance selection window

* Amend changelog

* Bump PARK_FILE_CURRENT_VERSION
This commit is contained in:
Aaron van Geffen
2024-12-19 20:04:57 +01:00
committed by GitHub
parent ddfb644c61
commit 3eb50bb303
4 changed files with 31 additions and 5 deletions

View File

@@ -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.

View File

@@ -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<int16_t>(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<int32_t>(GetNumRows() * kImageSize);
return ScreenSize(kImageSize * kNumColumns, scrollHeight);
}
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto highlighted = ScrollGetEntranceListItemAt(screenCoords);

View File

@@ -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;

View File

@@ -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