Fix #19559: Vehicle descriptions spill over into preview

This commit is contained in:
Gymnasiast 2024-04-20 18:45:48 +02:00 committed by Michael Steenbeek
parent 4db5d62476
commit 9e236d1b5a
No known key found for this signature in database
GPG Key ID: 92EB181D74FDE5EF
2 changed files with 16 additions and 1 deletions

View File

@ -6,6 +6,7 @@
- Change: [#21715] [Plugin] Remove access to the internal `owner` property. Note: `ownership` is still accessible.
- Change: [#21855] Cheats menu dropdown no longer requires dragging.
- Fix: [#866] Boat Hire boats get stuck entering track.
- Fix: [#19559] Custom rides with long descriptions extend into lower widgets.
- Fix: [#21696] Fullscreen window option not correctly applied on macOS.
- Fix: [#21787] Map generator heightmap should respect increased height limits.
- Fix: [#21829] When creating a new scenario, the default name contains formatting codes.

View File

@ -2559,7 +2559,8 @@ static_assert(std::size(RatingNames) == 6);
void VehicleResize()
{
WindowSetResize(*this, 316, 221, 316, 221);
auto bottom = widgets[WIDX_VEHICLE_TRAINS].bottom + 6;
WindowSetResize(*this, 316, bottom, 316, bottom);
}
void VehicleOnMouseDown(WidgetIndex widgetIndex)
@ -2842,6 +2843,19 @@ static_assert(std::size(RatingNames) == 6);
StringId stringId = rideEntry->nausea_multiplier > 0 ? STR_NAUSEA_FACTOR : STR_NAUSEA_FACTOR_NEGATIVE;
DrawTextBasic(dpi, screenCoords, stringId, ft);
}
const auto minimumPreviewStart = screenCoords.y - windowPos.y + kListRowHeight + 5;
if (minimumPreviewStart > widgets[WIDX_VEHICLE_TRAINS_PREVIEW].top)
{
auto heightIncrease = minimumPreviewStart - widgets[WIDX_VEHICLE_TRAINS_PREVIEW].top;
height += heightIncrease;
ResizeFrameWithPage();
for (auto i = EnumValue(WIDX_VEHICLE_TRAINS_PREVIEW); i <= WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE; i++)
{
widgets[i].moveDown(heightIncrease);
}
}
}
struct VehicleDrawInfo