GUI: U32: Use Common::U32String::format where necessary and GUIError to u32

- Where necessary as in, where translated messages are used.
- GUIErrorMessage now takes in U32String
- error messages across some engines use U32Strings. they are changed because they show a message dialog.
This commit is contained in:
aryanrawlani28 2020-06-20 23:34:23 +05:30 committed by Eugene Sandulenko
parent 1ca1712b4d
commit e22b32abfe
48 changed files with 133 additions and 133 deletions

View file

@ -186,16 +186,16 @@ Common::ErrorCode TonyEngine::init() {
}
bool TonyEngine::loadTonyDat() {
Common::String msg;
Common::U32String msg;
Common::File in;
Common::String filename = "tony.dat";
in.open(filename.c_str());
if (!in.isOpen()) {
msg = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
msg = Common::U32String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
warning("%s", msg.encode().c_str());
return false;
}
@ -205,9 +205,9 @@ bool TonyEngine::loadTonyDat() {
buf[4] = '\0';
if (strcmp(buf, "TONY")) {
msg = Common::String::format(_("The '%s' engine data file is corrupt.").encode().c_str(), filename.c_str());
msg = Common::U32String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
warning("%s", msg.encode().c_str());
return false;
}
@ -253,9 +253,9 @@ bool TonyEngine::loadTonyDat() {
int numVariant = in.readUint16BE();
if (expectedLangVariant > numVariant - 1) {
msg = Common::String::format(_("Font variant not present in '%s' engine data file.").encode().c_str(), filename.c_str());
msg = Common::U32String::format(_("Font variant not present in '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.c_str());
warning("%s", msg.encode().c_str());
return false;
}