1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Warn or error if incompatible park version is loaded

This commit is contained in:
Ted John
2022-04-16 23:47:15 +01:00
parent 0377b2c002
commit 65878dda81
5 changed files with 72 additions and 2 deletions

View File

@@ -719,6 +719,14 @@ namespace OpenRCT2
start_silent_record();
}
#endif
if (result.SemiCompatibleVersion)
{
auto windowManager = _uiContext->GetWindowManager();
auto ft = Formatter();
ft.Add<uint32_t>(result.MinVersion);
ft.Add<uint32_t>(result.TargetVersion);
windowManager->ShowError(STR_WARNING_PARK_VERSION_TITLE, STR_WARNING_PARK_VERSION_MESSAGE, ft);
}
return true;
}
catch (const ObjectLoadException& e)
@@ -760,6 +768,18 @@ namespace OpenRCT2
auto windowManager = _uiContext->GetWindowManager();
windowManager->ShowError(STR_FILE_CONTAINS_UNSUPPORTED_RIDE_TYPES, STR_NONE, {});
}
catch (const UnsupportedVersionException& e)
{
if (loadTitleScreenFirstOnFail)
{
title_load();
}
auto windowManager = _uiContext->GetWindowManager();
Formatter ft;
ft.Add<uint32_t>(e.MinVersion);
ft.Add<uint32_t>(e.TargetVersion);
windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_MESSAGE, ft);
}
catch (const std::exception& e)
{
// If loading the SV6 or SV4 failed return to the title screen if requested.