diff options
author | Cameron Cawley | 2018-12-19 06:31:26 +0000 |
---|---|---|
committer | Filippos Karapetis | 2018-12-19 08:31:26 +0200 |
commit | f6015086e18360659552ec4f7ca898f20fad1d16 (patch) | |
tree | 3f132ccbeb663e74d6b408c2ce2d608d3e2b27d8 /engines/supernova | |
parent | e94ccdbe6b0d650e04872ee3cc68fe13272f81a4 (diff) | |
download | scummvm-rg350-f6015086e18360659552ec4f7ca898f20fad1d16.tar.gz scummvm-rg350-f6015086e18360659552ec4f7ca898f20fad1d16.tar.bz2 scummvm-rg350-f6015086e18360659552ec4f7ca898f20fad1d16.zip |
ENGINES: Add GUIErrorMessageFormat to replace duplicated functions (#1455)
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/supernova.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index c47e476de7..51512af7e6 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -172,8 +172,7 @@ Common::Error SupernovaEngine::loadGameStrings() { // strings anyway (actually the engine will even refuse to start). Common::File f; if (!f.open(SUPERNOVA_DAT)) { - Common::String msg = Common::String::format(_("Unable to locate the '%s' engine data file."), SUPERNOVA_DAT); - GUIErrorMessage(msg); + GUIErrorMessageFormat(_("Unable to locate the '%s' engine data file."), SUPERNOVA_DAT); return Common::kReadingFailed; } @@ -182,17 +181,15 @@ Common::Error SupernovaEngine::loadGameStrings() { id[4] = lang[4] = '\0'; f.read(id, 3); if (strncmp(id, "MSN", 3) != 0) { - Common::String msg = Common::String::format(_("The '%s' engine data file is corrupt."), SUPERNOVA_DAT); - GUIErrorMessage(msg); + GUIErrorMessageFormat(_("The '%s' engine data file is corrupt."), SUPERNOVA_DAT); return Common::kReadingFailed; } int version = f.readByte(); if (version != SUPERNOVA_DAT_VERSION) { - Common::String msg = Common::String::format( + GUIErrorMessageFormat( _("Incorrect version of the '%s' engine data file found. Expected %d but got %d."), SUPERNOVA_DAT, SUPERNOVA_DAT_VERSION, version); - GUIErrorMessage(msg); return Common::kReadingFailed; } @@ -217,8 +214,7 @@ Common::Error SupernovaEngine::loadGameStrings() { } Common::Language l = Common::parseLanguage(cur_lang); - Common::String msg = Common::String::format(_("Unable to locate the text for %s language in '%s' engine data file."), Common::getLanguageDescription(l), SUPERNOVA_DAT); - GUIErrorMessage(msg); + GUIErrorMessageFormat(_("Unable to locate the text for %s language in '%s' engine data file."), Common::getLanguageDescription(l), SUPERNOVA_DAT); return Common::kReadingFailed; } |