Codechange: make WarningLevel a scoped enum (#15622)

This commit is contained in:
Peter Nelson
2026-05-26 17:12:21 +01:00
committed by GitHub
parent 957184ae90
commit fce33c5015
42 changed files with 135 additions and 135 deletions
+5 -5
View File
@@ -2853,7 +2853,7 @@ static std::pair<const SaveLoadFormat &, uint8_t> GetSavegameFormat(std::string_
ShowErrorMessage(
GetEncodedString(STR_CONFIG_ERROR),
GetEncodedString(STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_LEVEL, complevel),
WL_CRITICAL);
WarningLevel::Critical);
} else {
return {slf, *level};
}
@@ -2865,7 +2865,7 @@ static std::pair<const SaveLoadFormat &, uint8_t> GetSavegameFormat(std::string_
ShowErrorMessage(
GetEncodedString(STR_CONFIG_ERROR),
GetEncodedString(STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_ALGORITHM, name, def.name),
WL_CRITICAL);
WarningLevel::Critical);
}
return {def, def.default_compression};
}
@@ -2969,7 +2969,7 @@ EncodedString GetSaveLoadErrorMessage()
/** Show a gui message when saving has failed */
static void SaveFileError()
{
ShowErrorMessage(GetSaveLoadErrorType(), GetSaveLoadErrorMessage(), WL_ERROR);
ShowErrorMessage(GetSaveLoadErrorType(), GetSaveLoadErrorMessage(), WarningLevel::Error);
SaveFileDone();
}
@@ -3253,7 +3253,7 @@ SaveLoadResult SaveOrLoad(std::string_view filename, SaveLoadOperation fop, Deta
/* An instance of saving is already active, so don't go saving again */
if (_sl.saveinprogress && fop == SaveLoadOperation::Save && dft == DetailedFileType::GameFile && threaded) {
/* if not an autosave, but a user action, show error message */
if (!_do_autosave) ShowErrorMessage(GetEncodedString(STR_ERROR_SAVE_STILL_IN_PROGRESS), {}, WL_ERROR);
if (!_do_autosave) ShowErrorMessage(GetEncodedString(STR_ERROR_SAVE_STILL_IN_PROGRESS), {}, WarningLevel::Error);
return SaveLoadResult::Ok;
}
WaitTillSaved();
@@ -3349,7 +3349,7 @@ void DoAutoOrNetsave(FiosNumberedSaveName &counter)
Debug(sl, 2, "Autosaving to '{}'", filename);
if (SaveOrLoad(filename, SaveLoadOperation::Save, DetailedFileType::GameFile, Subdirectory::Autosave) != SaveLoadResult::Ok) {
ShowErrorMessage(GetEncodedString(STR_ERROR_AUTOSAVE_FAILED), {}, WL_ERROR);
ShowErrorMessage(GetEncodedString(STR_ERROR_AUTOSAVE_FAILED), {}, WarningLevel::Error);
}
}