diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 66c45ee384..dc7a25780a 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.18 (in development) ------------------------------------------------------------------------ - Improved: [#23260] Add diagonal (block) brakes to LSM Launched Roller Coaster. +- Improved: [#23350] Increased the maximum width of the ride graph window. - Fix: [#23286] Currency formatted incorrectly in the in game console. 0.4.17 (2024-12-08) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 5d0a27e8aa..35ce40407a 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -918,7 +918,7 @@ namespace OpenRCT2::Ui::Windows return _currentTextBox; } - void WindowResize(WindowBase& w, int32_t dw, int32_t dh) + void WindowResize(WindowBase& w, int16_t dw, int16_t dh) { if (dw == 0 && dh == 0) return; @@ -927,8 +927,8 @@ namespace OpenRCT2::Ui::Windows w.Invalidate(); // Clamp new size to minimum and maximum - w.width = std::clamp(w.width + dw, w.min_width, w.max_width); - w.height = std::clamp(w.height + dh, w.min_height, w.max_height); + w.width = std::clamp(w.width + dw, w.min_width, w.max_width); + w.height = std::clamp(w.height + dh, w.min_height, w.max_height); w.OnResize(); w.OnPrepareDraw(); @@ -1251,7 +1251,7 @@ namespace OpenRCT2::Ui::Windows }); } - void WindowSetResize(WindowBase& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight) + void WindowSetResize(WindowBase& w, int16_t minWidth, int16_t minHeight, int16_t maxWidth, int16_t maxHeight) { w.min_width = minWidth; w.min_height = minHeight; @@ -1259,8 +1259,8 @@ namespace OpenRCT2::Ui::Windows w.max_height = maxHeight; // Clamp width and height to minimum and maximum - int32_t width = std::clamp(w.width, std::min(minWidth, maxWidth), std::max(minWidth, maxWidth)); - int32_t height = std::clamp(w.height, std::min(minHeight, maxHeight), std::max(minHeight, maxHeight)); + int16_t width = std::clamp(w.width, std::min(minWidth, maxWidth), std::max(minWidth, maxWidth)); + int16_t height = std::clamp(w.height, std::min(minHeight, maxHeight), std::max(minHeight, maxHeight)); // Resize window if size has changed if (w.width != width || w.height != height) diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index fc6ca7893d..47124a7409 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -130,7 +130,7 @@ namespace OpenRCT2::Ui::Windows bool TextBoxCaretIsFlashed(); const WidgetIdentifier& GetCurrentTextBox(); - void WindowResize(WindowBase& w, int32_t dw, int32_t dh); + void WindowResize(WindowBase& w, int16_t dw, int16_t dh); void WindowInitScrollWidgets(WindowBase& w); void WindowUpdateScrollWidgets(WindowBase& w); @@ -139,7 +139,7 @@ namespace OpenRCT2::Ui::Windows void WindowMoveAndSnap(WindowBase& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity); void WindowRelocateWindows(int32_t width, int32_t height); - void WindowSetResize(WindowBase& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight); + void WindowSetResize(WindowBase& w, int16_t minWidth, int16_t minHeight, int16_t maxWidth, int16_t maxHeight); bool WindowCanResize(const WindowBase& w); void InvalidateAllWindowsAfterInput(); diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 0059c3d2bf..d91b4f8ea0 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -412,8 +412,8 @@ namespace OpenRCT2::Ui::Windows { min_width = _info.Desc.MinWidth.value_or(0); min_height = _info.Desc.MinHeight.value_or(0); - max_width = _info.Desc.MaxWidth.value_or(std::numeric_limits::max()); - max_height = _info.Desc.MaxHeight.value_or(std::numeric_limits::max()); + max_width = _info.Desc.MaxWidth.value_or(std::numeric_limits::max()); + max_height = _info.Desc.MaxHeight.value_or(std::numeric_limits::max()); } RefreshWidgets(); } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index a152c51583..4218a8c5e1 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -521,7 +521,9 @@ namespace OpenRCT2::Ui::Windows || p == WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH) { flags |= WF_RESIZABLE; - WindowSetResize(*this, WW_OTHER_TABS, WH_OTHER_TABS, 2000, 2000); + WindowSetResize( + *this, WW_OTHER_TABS, WH_OTHER_TABS, std::numeric_limits::max(), + std::numeric_limits::max()); } else { diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 599b987729..77a54a1d82 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -5946,7 +5946,7 @@ namespace OpenRCT2::Ui::Windows void GraphsResize() { - WindowSetResize(*this, 316, 182, 500, 450); + WindowSetResize(*this, 316, 182, std::numeric_limits::max(), 450); } void GraphsOnMouseDown(WidgetIndex widgetIndex)