mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-31 02:35:46 +01:00
Fix #20616: Confirmation button in track designer's quit prompt has the wrong text
Wrapped the logic for determining the text to be displayed on title and buttons of the save prompt in an if condition, so it's not run for the pure quit prompt.
This commit is contained in:
committed by
GitHub
parent
739dd712d5
commit
62d0fd76e0
@@ -89,14 +89,10 @@ public:
|
||||
|
||||
void OnOpen() override
|
||||
{
|
||||
if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))
|
||||
{
|
||||
widgets = _quitPromptWidgets;
|
||||
}
|
||||
else
|
||||
{
|
||||
widgets = _savePromptWidgets;
|
||||
}
|
||||
bool canSave = !(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER));
|
||||
|
||||
widgets = canSave ? _savePromptWidgets : _quitPromptWidgets;
|
||||
|
||||
InitScrollWidgets();
|
||||
|
||||
// Pause the game if not network play.
|
||||
@@ -108,17 +104,20 @@ public:
|
||||
|
||||
WindowInvalidateByClass(WindowClass::TopToolbar);
|
||||
|
||||
StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0];
|
||||
if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
if (canSave)
|
||||
{
|
||||
stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE;
|
||||
StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0];
|
||||
if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE;
|
||||
}
|
||||
else if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
stringId = STR_QUIT_SCENARIO_EDITOR;
|
||||
}
|
||||
widgets[WIDX_TITLE].text = stringId;
|
||||
widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(_promptMode)][1];
|
||||
}
|
||||
else if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
stringId = STR_QUIT_SCENARIO_EDITOR;
|
||||
}
|
||||
widgets[WIDX_TITLE].text = stringId;
|
||||
widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(_promptMode)][1];
|
||||
}
|
||||
|
||||
void OnClose() override
|
||||
|
||||
Reference in New Issue
Block a user