From c24657a7f74e2af38f7478c012ec4f1cd944a803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:02:31 +0200 Subject: [PATCH] Don't close the error window if the new error will not show --- src/openrct2-ui/windows/Error.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index e736532fec..bd772f24ed 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -111,8 +111,6 @@ public: WindowBase* WindowErrorOpen(std::string_view title, std::string_view message) { - WindowCloseByClass(WindowClass::Error); - std::string buffer = "{BLACK}"; buffer.append(title); @@ -137,6 +135,9 @@ WindowBase* WindowErrorOpen(std::string_view title, std::string_view message) return nullptr; } + // Close any existing error windows if they exist. + WindowCloseByClass(WindowClass::Error); + int32_t width = GfxGetStringWidthNewLined(buffer.data(), FontStyle::Medium); width = std::clamp(width, 64, 196);