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

Implement strings for GameAction errors

This commit is contained in:
Ted John
2020-03-03 21:11:26 +00:00
parent 2ad37db817
commit 83fe0cf5c5
18 changed files with 135 additions and 41 deletions

View File

@@ -140,8 +140,14 @@ money32 maze_set_track(
// NOTE: ride_construction_tooldown_construct requires them to be set.
// Refactor result type once theres no C code referencing this function.
gGameCommandErrorText = res->ErrorMessage;
gGameCommandErrorTitle = res->ErrorTitle;
if (auto title = std::get_if<rct_string_id>(&res->ErrorTitle))
gGameCommandErrorTitle = *title;
else
gGameCommandErrorTitle = STR_NONE;
if (auto message = std::get_if<rct_string_id>(&res->ErrorMessage))
gGameCommandErrorText = *message;
else
gGameCommandErrorText = STR_NONE;
if (res->Error != GA_ERROR::OK)
{