From e6d439dc5be1a30d74f28a0ac3456d079c30bd35 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 8 Apr 2023 07:25:46 +0200 Subject: [PATCH] Fix #19801: Cannot resize load/save window anymore (#19872) The main issue was that the min/max sizes of the window were set in the constructor, then being overwritten by the WindowCreate function. That function calls the OnOpen function, which can be used to set them properly. The other two changes are just minor cleanups; a pixel difference in padding on the right side, and an overriden function that's identical to the base. --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/LoadSave.cpp | 16 +++++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c2b50bca13..640467fd55 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -11,6 +11,7 @@ - Fix: [#19296] Crash due to a race condition for parallel object loading. - Fix: [#19756] Crash with title sequences containing no commands. - Fix: [#19767] No message when path is not connected to ride exit and is therefore unreachable for mechanics. +- Fix: [#19801] The in-game load/save window cannot be resized anymore. - Fix: [#19854] Looping Coaster trains clipping through steep quarter turns down. 0.4.4 (2023-03-28) diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 413b12acd6..bd2fdf3b39 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -496,11 +496,6 @@ public: { widgets = window_loadsave_widgets; - min_width = WW; - min_height = WH / 2; - max_width = WW * 2; - max_height = WH * 2; - const auto uiContext = OpenRCT2::GetContext()->GetUiContext(); if (!uiContext->HasFilePicker()) { @@ -697,6 +692,10 @@ public: public: void OnOpen() override { + min_width = WW; + min_height = WH / 2; + max_width = WW * 2; + max_height = WH * 2; } void OnClose() override @@ -730,7 +729,7 @@ public: window_loadsave_widgets[WIDX_SORT_NAME].left = 4; window_loadsave_widgets[WIDX_SORT_NAME].right = window_loadsave_widgets[WIDX_SORT_DATE].left - 1; - window_loadsave_widgets[WIDX_SCROLL].right = width - 4; + window_loadsave_widgets[WIDX_SCROLL].right = width - 5; window_loadsave_widgets[WIDX_SCROLL].bottom = height - 30; window_loadsave_widgets[WIDX_BROWSE].top = height - 24; @@ -789,11 +788,6 @@ public: { COLOUR_GREY }); } - OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override - { - return { fallback, {} }; - } - void OnMouseUp(WidgetIndex widgetIndex) override { bool isSave = (_type & 0x01) == LOADSAVETYPE_SAVE;