From f6015086e18360659552ec4f7ca898f20fad1d16 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Wed, 19 Dec 2018 06:31:26 +0000 Subject: ENGINES: Add GUIErrorMessageFormat to replace duplicated functions (#1455) --- engines/supernova/supernova.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'engines/supernova') 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; } -- cgit v1.2.3