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

Don't close the error window if the new error will not show

This commit is contained in:
ζeh Matt
2024-02-12 23:02:31 +02:00
parent 72ca04633e
commit c24657a7f7

View File

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