1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-22 12:42:43 +01:00

Codechange: Use EncodedString for Query window. (#13528)

This removes the need to separately capture and store global parameters.
This commit is contained in:
Peter Nelson
2025-02-11 17:30:16 +00:00
committed by GitHub
parent 08e451e6d9
commit 984da2455b
15 changed files with 67 additions and 55 deletions

View File

@@ -825,14 +825,20 @@ public:
if (this->abstract_filetype == FT_SAVEGAME || this->abstract_filetype == FT_SCENARIO) {
_file_to_saveload.name = FiosMakeSavegameName(this->filename_editbox.text.GetText());
if (FioCheckFileExists(_file_to_saveload.name, Subdirectory::SAVE_DIR)) {
ShowQuery(STR_SAVELOAD_OVERWRITE_TITLE, STR_SAVELOAD_OVERWRITE_WARNING, this, SaveLoadWindow::SaveGameConfirmationCallback);
ShowQuery(
GetEncodedString(STR_SAVELOAD_OVERWRITE_TITLE),
GetEncodedString(STR_SAVELOAD_OVERWRITE_WARNING),
this, SaveLoadWindow::SaveGameConfirmationCallback);
} else {
_switch_mode = SM_SAVE_GAME;
}
} else {
_file_to_saveload.name = FiosMakeHeightmapName(this->filename_editbox.text.GetText());
if (FioCheckFileExists(_file_to_saveload.name, Subdirectory::SAVE_DIR)) {
ShowQuery(STR_SAVELOAD_OVERWRITE_TITLE, STR_SAVELOAD_OVERWRITE_WARNING, this, SaveLoadWindow::SaveHeightmapConfirmationCallback);
ShowQuery(
GetEncodedString(STR_SAVELOAD_OVERWRITE_TITLE),
GetEncodedString(STR_SAVELOAD_OVERWRITE_WARNING),
this, SaveLoadWindow::SaveHeightmapConfirmationCallback);
} else {
_switch_mode = SM_SAVE_HEIGHTMAP;
}