GUI: U32: Reduce number of files changed and fixes

Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
This commit is contained in:
aryanrawlani28 2020-07-04 03:13:05 +05:30 committed by Eugene Sandulenko
parent ffc89d1a2b
commit 4b6976c558
78 changed files with 203 additions and 168 deletions

View File

@ -77,7 +77,7 @@ public:
error("MT32emu: Init Error - Missing PCM ROM image");
}
void showLCDMessage(const char *message) {
Common::OSDMessageQueue::instance().addMessage(Common::convertToU32String(message));
Common::OSDMessageQueue::instance().addMessage(Common::U32String(message));
}
// Unused callbacks

View File

@ -345,9 +345,7 @@ void Storage::directoryDownloadedCallback(FileArrayResponse response) {
Common::U32String message;
if (response.value.size()) {
message = Common::U32String::format(
_("Download complete.\nFailed to download %u files."),
response.value.size());
message = Common::U32String::format(_("Download complete.\nFailed to download %u files."), response.value.size());
} else {
message = _("Download complete.");
}

View File

@ -2549,10 +2549,7 @@ bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) {
endGFXTransaction();
#ifdef USE_OSD
Common::U32String message = Common::String::format("%s: %s",
_("Stretch mode").encode().c_str(),
_(s_supportedStretchModes[index].description).encode().c_str()
);
Common::U32String message = _("Stretch mode") + Common::U32String(": ") + _(s_supportedStretchModes[index].description);
displayMessageOnOSD(message);
#endif
_forceRedraw = true;

View File

@ -44,6 +44,10 @@ Keymap::Keymap(KeymapType type, const String &id, const U32String &description)
}
Keymap::Keymap(KeymapType type, const String &id, const String &description) {
Keymap(type, id, U32String(description));
}
Keymap::~Keymap() {
for (ActionArray::iterator it = _actions.begin(); it != _actions.end(); ++it)
delete *it;

View File

@ -81,6 +81,7 @@ public:
typedef Array<Action *> ActionArray;
Keymap(KeymapType type, const String &id, const U32String &description);
Keymap(KeymapType type, const String &id, const String &description);
~Keymap();
void setConfigDomain(ConfigManager::Domain *configDomain);
void setHardwareInputs(HardwareInputSet *hardwareInputSet);

View File

@ -194,7 +194,7 @@ bool SpeechDispatcherManager::say(const Common::U32String &str, Action action, C
return true;
}
Common::String strUtf8 = str.encode();;
Common::String strUtf8 = str.encode();
if (!_speechQueue.empty() && action == INTERRUPT_NO_REPEAT &&
_speechQueue.front() == strUtf8 && isSpeaking()) {

View File

@ -246,6 +246,10 @@ bool WindowsTextToSpeechManager::say(const Common::U32String &str, Action action
return false;
}
bool WindowsTextToSpeechManager::say(const Common::String &str, Action action, Common::String charset) {
return say(Common::U32String(str), action, charset);
}
bool WindowsTextToSpeechManager::stop() {
if (_speechState == BROKEN || _speechState == NO_VOICE)
return true;

View File

@ -53,6 +53,7 @@ public:
virtual ~WindowsTextToSpeechManager() override;
virtual bool say(const Common::U32String &str, Action action, Common::String charset = "") override;
virtual bool say(const Common::String &str, Action action, Common::String charset = "") override;
virtual bool stop() override;
virtual bool pause() override;

View File

@ -260,7 +260,7 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
if (token.equalsIgnoreCase("all"))
DebugMan.enableAllDebugChannels();
else if (!DebugMan.enableDebugChannel(token))
warning(Common::convertFromU32String(_("Engine does not support debug level '%s'")).c_str(), token.c_str());
warning("Engine does not support debug level '%s'", token.c_str());
}
#ifdef USE_TRANSLATION

View File

@ -159,6 +159,7 @@ public:
* encoding used for the GUI.
*/
bool say(const U32String &str, String charset = "") { return say(str, INTERRUPT_NO_REPEAT, charset); }
bool say(const String &str, String charset = "") { return say(U32String(str), charset); }
/**
* Says the given string
@ -179,6 +180,7 @@ public:
* encoding used for the GUI.
*/
virtual bool say(const U32String &str, Action action, String charset = "") { return false; }
virtual bool say(const String &str, Action action, String charset = "") { return false; }
/**
* Stops the speech

View File

@ -332,7 +332,7 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const {
delete in;
saveList.push_back(SaveStateDescriptor(slotNr, Common::U32String(description)));
saveList.push_back(SaveStateDescriptor(slotNr, description));
}
}
}
@ -375,11 +375,11 @@ SaveStateDescriptor AgiMetaEngine::querySaveMetaInfos(const char *target, int sl
// broken description, ignore it
delete in;
SaveStateDescriptor descriptor(slotNr, Common::U32String("[broken saved game]"));
SaveStateDescriptor descriptor(slotNr, "[broken saved game]");
return descriptor;
}
SaveStateDescriptor descriptor(slotNr, Common::U32String(description));
SaveStateDescriptor descriptor(slotNr, description);
// Do not allow save slot 0 (used for auto-saving) to be deleted or
// overwritten.

View File

@ -767,7 +767,7 @@ int AgiEngine::scummVMSaveLoadDialog(bool isSave) {
}
if (desc.size() > 28)
desc = Common::U32String(desc.encode().c_str(), 28);
desc = Common::U32String(desc.begin(), desc.begin() + 28);
} else {
dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
slot = dialog->runModalWithCurrentTarget();

View File

@ -37,6 +37,7 @@
// PKWARE data compression library decompressor required for Simon 2
#include "common/dcl.h"
#include "common/translation.h"
#include "gui/message.h"
@ -139,12 +140,12 @@ int MidiPlayer::open(int gameType, bool isDemo) {
case MT_GM:
if (!ConfMan.getBool("native_mt32")) {
// Not a real MT32 / no MUNT
::GUI::MessageDialog dialog(Common::convertToU32String((
::GUI::MessageDialog dialog(_(
"You appear to be using a General MIDI device,\n"
"but your game only supports Roland MT32 MIDI.\n"
"We try to map the Roland MT32 instruments to\n"
"General MIDI ones. It is still possible that\n"
"some tracks sound incorrect.")));
"some tracks sound incorrect."));
dialog.runModal();
}
// Switch to MT32 driver in any case

View File

@ -134,7 +134,7 @@ void AGOSEngine::quickLoadOrSave() {
if ((getGameType() == GType_SIMON2 && _boxStarHeight == 200) ||
(getGameType() == GType_SIMON1 && (getFeatures() & GF_DEMO)) ||
_mouseHideCount || _showPreposition) {
buf = Common::String::format("Quick load or save game isn't supported in this location");
buf = Common::U32String::format(_("Quick load or save game isn't supported in this location"));
GUI::MessageDialog dialog(buf);
dialog.runModal();
return;

View File

@ -192,7 +192,7 @@ void MainMenu::gotoMenuScreen(int screen) {
} else {
btn = &kMenuButtons[screen * 5 + i];
}
_buttons[i]->setLabel(Common::U32String(btn->label));
_buttons[i]->setLabel(btn->label);
_buttons[i]->setCmd(btn->cmd);
_buttons[i]->setEnabled(btn->cmd != 0);
}

View File

@ -225,7 +225,7 @@ Common::Error CGEEngine::run() {
// If game is finished, display ending message
if (_flag[3]) {
Common::U32String msg = Common::U32String(_text->getText(kSayTheEnd));
Common::String msg = Common::String(_text->getText(kSayTheEnd));
if (!msg.empty()) {
g_system->delayMillis(10);
GUI::MessageDialog dialog(msg);

View File

@ -214,9 +214,9 @@ void MainMenuDialog::save() {
Common::Error status = _engine->saveGameState(slot, Common::convertFromU32String(result));
if (status.getCode() != Common::kNoError) {
Common::U32String failMessage = Common::U32String::format(_("Failed to save game (%s)! "),
Common::U32String failMessage = Common::U32String::format(_("Failed to save game (%s)! "
"Please consult the README for basic information, and for "
"instructions on how to obtain further assistance.");
"instructions on how to obtain further assistance."), status.getDesc().c_str());
GUI::MessageDialog dialog(failMessage);
dialog.runModal();
}

View File

@ -930,7 +930,7 @@ bool DrasculaEngine::loadDrasculaDat() {
if (!in.isOpen()) {
Common::U32String errorMessage = Common::U32String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.encode().c_str());
warning("Unable to locate the '%s' engine data file.", filename.c_str());
return false;
}
@ -944,7 +944,7 @@ bool DrasculaEngine::loadDrasculaDat() {
if (strcmp(buf, "DRASCULA") != 0) {
Common::U32String errorMessage = Common::U32String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.encode().c_str());
warning("The '%s' engine data file is corrupt.", filename.c_str());
return false;
}
@ -956,7 +956,8 @@ bool DrasculaEngine::loadDrasculaDat() {
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
filename.c_str(), DRASCULA_DAT_VER, 0, ver, 0);
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.encode().c_str());
warning("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.",
filename.c_str(), DRASCULA_DAT_VER, 0, ver, 0);
return false;
}

View File

@ -320,7 +320,7 @@ void initGraphics(int width, int height, const Graphics::PixelFormat *format) {
_("Could not switch to resolution '%dx%d'."), width, height);
GUIErrorMessage(message);
error("%s", message.encode().c_str());
error("Could not switch to resolution '%dx%d'.", width, height);
}
// Just show warnings then these occur:
@ -335,8 +335,7 @@ void initGraphics(int width, int height, const Graphics::PixelFormat *format) {
if (gfxError & OSystem::kTransactionModeSwitchFailed) {
Common::U32String message;
message = Common::U32String::format(
_("Could not switch to video mode '%s'."), ConfMan.get("gfx_mode").c_str());
message = Common::U32String::format(_("Could not switch to video mode '%s'."), ConfMan.get("gfx_mode").c_str());
GUI::MessageDialog dialog(message);
dialog.runModal();
@ -344,8 +343,7 @@ void initGraphics(int width, int height, const Graphics::PixelFormat *format) {
if (gfxError & OSystem::kTransactionStretchModeSwitchFailed) {
Common::U32String message;
message = Common::U32String::format(
_("Could not switch to stretch mode '%s'."), ConfMan.get("stretch_mode").c_str());
message = Common::U32String::format(_("Could not switch to stretch mode '%s'."), ConfMan.get("stretch_mode").c_str());
GUI::MessageDialog dialog(message);
dialog.runModal();
@ -402,6 +400,14 @@ void GUIErrorMessageWithURL(const Common::U32String &msg, const char *url) {
GUIErrorMessage(msg, url);
}
void GUIErrorMessageWithURL(const Common::String &msg, const char *url) {
GUIErrorMessage(Common::U32String(msg), url);
}
void GUIErrorMessage(const Common::String &msg, const char *url) {
GUIErrorMessage(Common::U32String(msg), url);
}
void GUIErrorMessage(const Common::U32String &msg, const char *url) {
g_system->setWindowCaption("Error");
g_system->beginGFXTransaction();

View File

@ -54,7 +54,9 @@ class Dialog;
* Initializes graphics and shows error message.
*/
void GUIErrorMessage(const Common::U32String &msg, const char *url = nullptr);
void GUIErrorMessage(const Common::String &msg, const char *url = nullptr); // Redirect to GUIErrorMessage with U32Strings
void GUIErrorMessageWithURL(const Common::U32String &msg, const char *url);
void GUIErrorMessageWithURL(const Common::String &msg, const char *url); // Redirect to GUIErrorMessageWithURL with U32Strings
void GUIErrorMessageFormat(Common::U32String fmt, ...);
void GUIErrorMessageFormat(const char *fmt, ...) GCC_PRINTF(1, 2);

View File

@ -169,9 +169,9 @@ Common::String generateUnknownGameReport(const DetectedGames &detectedGames, boo
assert(!detectedGames.empty());
const char *reportStart = _s("The game in '%s' seems to be an unknown game variant.\n\n"
"Please report the following data to the ScummVM team at %s "
"along with the name of the game you tried to add and "
"its version, language, etc.:");
"Please report the following data to the ScummVM team at %s "
"along with the name of the game you tried to add and "
"its version, language, etc.:");
const char *reportEngineHeader = _s("Matched game IDs for the %s engine:");
Common::String report = Common::String::format(

View File

@ -85,7 +85,7 @@ bool Alan2::initialize() {
// Open up the text file
txtfil = new Common::File();
if (!txtfil->open(Common::String::format("%s.dat", _advName.c_str()))) {
GUIErrorMessage(Common::convertToU32String("Could not open adventure text data file"));
GUIErrorMessage("Could not open adventure text data file");
delete txtfil;
return false;
}

View File

@ -94,7 +94,7 @@ bool Alan3::initialize() {
// In Alan 3, the text data comes from the adventure file itself
Common::File *txt = new Common::File();
if (!txt->open(getFilename())) {
GUIErrorMessage(Common::convertToU32String("Could not open adventure file for text data"));
GUIErrorMessage("Could not open adventure file for text data");
delete txt;
return false;
}

View File

@ -184,7 +184,7 @@ Start:
// Handle any savegame selected directly from the ScummVM launcher
if (_savegameSlot != -1) {
if (loadGameState(_savegameSlot).getCode() != Common::kNoError) {
GUIErrorMessage(Common::convertToU32String("Loading failed"));
GUIErrorMessage("Loading failed");
_savegameSlot = -1;
}
}

View File

@ -23,6 +23,7 @@
#include "glk/hugo/hugo.h"
#include "glk/hugo/resource_archive.h"
#include "common/config-manager.h"
#include "common/translation.h"
namespace Glk {
namespace Hugo {
@ -179,14 +180,14 @@ Common::Error Hugo::readSaveData(Common::SeekableReadStream *rs) {
if (hugo_ferror(rs)) goto RestoreError;
if (strcmp(testid, id)) {
GUIErrorMessage(Common::convertToU32String("Incorrect rs file."));
GUIErrorMessage(_("Incorrect rs file."));
goto RestoreError;
}
/* Check serial number */
if (!hugo_fgets(testserial, 9, rs)) goto RestoreError;
if (strcmp(testserial, serial)) {
GUIErrorMessage(Common::convertToU32String("Save file created by different version."));
GUIErrorMessage(_("Save file created by different version."));
goto RestoreError;
}

View File

@ -123,7 +123,7 @@ Common::Error ZCode::loadGameState(int slot) {
|| h_screen_cols != old_screen_cols))
erase_window(1);
} else {
error("%s", _("Error reading save file").encode().c_str());
error("%s", ("Error reading save file"));
}
return Common::kNoError;

View File

@ -254,7 +254,7 @@ SaveStateList HDBMetaEngine::listSaves(const char *target) const {
if (slotNum < 8)
desc.setDescription(Common::String::format("Auto: %s", mapName));
else
desc.setDescription(Common::convertToU32String(mapName));
desc.setDescription(mapName);
saveList.push_back(desc);
}
@ -284,7 +284,7 @@ SaveStateDescriptor HDBMetaEngine::querySaveMetaInfos(const char *target, int sl
desc.setSaveSlot(slot);
desc.setPlayTime(timeSeconds * 1000);
desc.setDescription(Common::convertToU32String(mapName));
desc.setDescription(mapName);
return desc;
}

View File

@ -435,7 +435,7 @@ bool HugoEngine::loadHugoDat() {
if (!in.isOpen()) {
Common::U32String errorMessage = Common::U32String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.encode().c_str());
warning("Unable to locate the '%s' engine data file.", filename.c_str());
return false;
}
@ -453,9 +453,9 @@ bool HugoEngine::loadHugoDat() {
int minVer = in.readByte();
if ((majVer != HUGO_DAT_VER_MAJ) || (minVer != HUGO_DAT_VER_MIN)) {
Common::String errorMessage = Common::String::format(
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.").encode().c_str(),
filename.c_str(),HUGO_DAT_VER_MAJ, HUGO_DAT_VER_MIN, majVer, minVer);
Common::U32String errorMessage = Common::U32String::format(
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
filename.c_str(), HUGO_DAT_VER_MAJ, HUGO_DAT_VER_MIN, majVer, minVer);
GUIErrorMessage(errorMessage);
return false;
}

View File

@ -697,7 +697,7 @@ MenuActionSaveGame::MenuActionSaveGame(BaseMenuSystem *menuSystem, uint choiceIn
void MenuActionSaveGame::execute() {
GUI::SaveLoadChooser *dialog;
Common::U32String desc;
Common::String desc;
int slot;
dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);

View File

@ -122,7 +122,7 @@ void LabEngine::handleTrialWarning() {
// Wyrmkeep trial version
_extraGameFeatures = GF_WINDOWS_TRIAL;
GUI::MessageDialog trialMessage(Common::convertToU32String("This is a trial Windows version of the game. To play the full version, you will need to use the original interpreter and purchase a key from Wyrmkeep"));
GUI::MessageDialog trialMessage(_("This is a trial Windows version of the game. To play the full version, you will need to use the original interpreter and purchase a key from Wyrmkeep"));
trialMessage.runModal();
}
else {

View File

@ -327,7 +327,7 @@ void LabEngine::doActions(const ActionList &actionList) {
// This is a Wyrmkeep Windows trial version, thus stop at this
// point, since we can't check for game payment status
_graphics->readPict(getPictName(true));
GUI::MessageDialog trialMessage(Common::convertToU32String("This is the end of the trial version. You can play the full game using the original interpreter from Wyrmkeep"));
GUI::MessageDialog trialMessage(_("This is the end of the trial version. You can play the full game using the original interpreter from Wyrmkeep"));
trialMessage.runModal();
break;
}

View File

@ -146,7 +146,7 @@ void SpecialLocks::changeTile(uint16 col, uint16 row) {
if (scrolltype != -1) {
if (_vm->getFeatures() & GF_WINDOWS_TRIAL) {
GUI::MessageDialog trialMessage(Common::convertToU32String("This puzzle is not available in the trial version of the game"));
GUI::MessageDialog trialMessage(_("This puzzle is not available in the trial version of the game"));
trialMessage.runModal();
return;
}

View File

@ -491,7 +491,7 @@ Surface *Surface::newDialog(uint16 width, uint8 numLines, const char **lines, bo
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
if (ttsMan != nullptr) {
ttsMan->stop();
ttsMan->say(Common::convertToU32String(text.c_str()));
ttsMan->say(text.c_str());
}
}
#endif

View File

@ -393,7 +393,7 @@ void TextDialog::draw() {
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
if (ttsMan != nullptr) {
ttsMan->stop();
ttsMan->say(Common::convertToU32String(text.c_str()));
ttsMan->say(text.c_str());
}
}
#endif

View File

@ -142,7 +142,7 @@ MystOptionsWidget::MystOptionsWidget(GuiObject *boss, const Common::String &name
const MystLanguage *languages = MohawkEngine_Myst::listLanguages();
while (languages->language != Common::UNK_LANG) {
_languagePopUp->appendEntry(Common::convertToU32String(Common::getLanguageDescription(languages->language)), languages->language);
_languagePopUp->appendEntry(Common::getLanguageDescription(languages->language), languages->language);
languages++;
}
}
@ -344,7 +344,7 @@ RivenOptionsWidget::RivenOptionsWidget(GuiObject *boss, const Common::String &na
const RivenLanguage *languages = MohawkEngine_Riven::listLanguages();
while (languages->language != Common::UNK_LANG) {
_languagePopUp->appendEntry(Common::convertToU32String(Common::getLanguageDescription(languages->language)), languages->language);
_languagePopUp->appendEntry(Common::getLanguageDescription(languages->language), languages->language);
languages++;
}
}

View File

@ -560,7 +560,7 @@ Common::KeymapArray MohawkEngine_Myst::initKeymaps(const char *target) {
bool is25th = checkGameGUIOption(GAMEOPTION_25TH, guiOptions);
bool isDemo = checkGameGUIOption(GAMEOPTION_DEMO, guiOptions);
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "myst", Common::convertToU32String("Myst"));
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "myst", "Myst");
Action *act;

View File

@ -29,6 +29,7 @@
#include "mohawk/myst_stacks/preview.h"
#include "common/system.h"
#include "common/translation.h"
#include "gui/message.h"
namespace Mohawk {
@ -86,7 +87,7 @@ void Preview::o_fadeFromBlack(uint16 var, const ArgumentsArray &args) {
void Preview::o_stayHere(uint16 var, const ArgumentsArray &args) {
// Nuh-uh! No leaving the library in the demo!
GUI::MessageDialog dialog(Common::convertToU32String("You can't leave the library in the demo."));
GUI::MessageDialog dialog(_("You can't leave the library in the demo."));
dialog.runModal();
}

View File

@ -156,7 +156,8 @@ Common::Error MohawkEngine_Riven::run() {
Common::U32String message = _("You're missing a Riven executable. The Windows executable is 'riven.exe' or 'rivendmo.exe'. ");
message += _("Using the 'arcriven.z' installer file also works. In addition, you can use the Mac 'Riven' executable.");
GUIErrorMessage(message);
warning("%s", message.encode().c_str());
warning("You're missing a Riven executable. The Windows executable is 'riven.exe' or 'rivendmo.exe'. \
Using the 'arcriven.z' installer file also works. In addition, you can use the Mac 'Riven' executable.");
return Common::kNoGameDataFoundError;
}
@ -167,7 +168,7 @@ Common::Error MohawkEngine_Riven::run() {
if (!_extrasFile->openFile("extras.mhk")) {
Common::U32String message = _("You're missing 'extras.mhk'. Using the 'arcriven.z' installer file also works.");
GUIErrorMessage(message);
warning("%s", message.encode().c_str());
warning("You're missing 'extras.mhk'. Using the 'arcriven.z' installer file also works.");
return Common::kNoGameDataFoundError;
}
@ -498,8 +499,8 @@ bool MohawkEngine_Riven::checkDatafiles() {
return true;
}
Common::U32String message = _("You are missing the following required Riven data files:\n") + Common::convertToU32String(missingFiles.c_str());
warning("%s", message.encode().c_str());
Common::U32String message = _("You are missing the following required Riven data files:\n") + Common::U32String(missingFiles);
warning("You are missing the following required Riven data files:\n%s", missingFiles.c_str());
GUIErrorMessage(message);
return false;
@ -829,7 +830,7 @@ Common::KeymapArray MohawkEngine_Riven::initKeymaps(const char *target) {
bool is25th = checkGameGUIOption(GAMEOPTION_25TH, guiOptions);
bool isDemo = checkGameGUIOption(GAMEOPTION_DEMO, guiOptions);
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "riven", Common::convertToU32String("Riven"));
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "riven", "Riven");
Action *act;

View File

@ -32,7 +32,7 @@ namespace MutationOfJB {
void reportFileMissingError(const char *fileName) {
Common::U32String errorMessage = Common::U32String::format(_("Unable to locate the '%s' engine data file"), fileName);
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.encode().c_str());
warning("Unable to locate the '%s' engine data file", fileName);
}
Common::String toUpperCP895(const Common::String &str) {

View File

@ -2476,7 +2476,7 @@ uint PegasusEngine::getNeighborhoodCD(const NeighborhoodID neighborhood) const {
Common::KeymapArray PegasusEngine::initKeymaps() {
using namespace Common;
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "pegasus", Common::convertToU32String("Pegasus Prime"));
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "pegasus", "Pegasus Prime");
Action *act;

View File

@ -25,6 +25,7 @@
#include "common/config-manager.h"
#include "common/system.h"
#include "common/events.h"
#include "common/translation.h"
#include "audio/mixer.h"
@ -243,7 +244,7 @@ Common::Error SagaEngine::run() {
// Detect game and open resource files
if (!initGame()) {
GUIErrorMessage(Common::convertToU32String("Error loading game resources."));
GUIErrorMessage(_("Error loading game resources."));
return Common::kUnknownError;
}

View File

@ -69,6 +69,7 @@ public:
* @param desc A human readable description of the save state.
*/
void setDescription(const Common::U32String &desc) { _description = desc; }
void setDescription(const Common::String &desc) { _description = Common::U32String(desc); }
/**
* @return A human readable description of the save state.

View File

@ -1017,7 +1017,7 @@ SaveStateDescriptor SciMetaEngine::querySaveMetaInfos(const char *target, int sl
// invalid
delete in;
descriptor.setDescription(Common::convertToU32String("*Invalid*"));
descriptor.setDescription("*Invalid*");
return descriptor;
}
@ -1028,7 +1028,7 @@ SaveStateDescriptor SciMetaEngine::querySaveMetaInfos(const char *target, int sl
// invalid
delete in;
descriptor.setDescription(Common::convertToU32String("*Invalid*"));
descriptor.setDescription("*Invalid*");
return descriptor;
}
descriptor.setThumbnail(thumbnail);

View File

@ -23,6 +23,7 @@
#include "common/config-manager.h"
#include "common/savefile.h"
#include "common/system.h"
#include "common/translation.h"
#include "sci/sci.h"
#include "sci/debug.h"
@ -870,7 +871,7 @@ reg_t kWinDLL(EngineState *s, int argc, reg_t *argv) {
switch (operation) {
case 0: // load DLL
if (dllName == "PENGIN16.DLL")
showScummVMDialog(Common::convertToU32String("The Poker logic is hardcoded in an external DLL, and is not implemented yet. There exists some dummy logic for now, where opponent actions are chosen randomly"));
showScummVMDialog(_("The Poker logic is hardcoded in an external DLL, and is not implemented yet. There exists some dummy logic for now, where opponent actions are chosen randomly"));
// This is originally a call to LoadLibrary() and to the Watcom function GetIndirectFunctionHandle
return make_reg(0, 1000); // fake ID for loaded DLL, normally returned from Windows LoadLibrary()

View File

@ -160,7 +160,7 @@ void SciMusic::init() {
Common::U32String message = _(
"The selected audio driver requires the following file(s):\n\n"
);
message += Common::convertToU32String(missingFiles);
message += Common::U32String(missingFiles);
message += _("\n\n"
"Some audio drivers (at least for some games) were made\n"
"available by Sierra as aftermarket patches and thus might not\n"

View File

@ -609,7 +609,7 @@ void SubtitleSettingsDialog::cycleValue() {
_value = 0;
if (_value == 1 && g_system->getOverlayWidth() <= 320)
setInfoText(Common::convertToU32String(_sc("Speech & Subs", "lowres")));
setInfoText(Common::U32String(_sc("Speech & Subs", "lowres")));
else
setInfoText(_(subtitleDesc[_value]));
@ -617,7 +617,7 @@ void SubtitleSettingsDialog::cycleValue() {
}
Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)
: InfoDialog(scumm, U32String(text)) {
: InfoDialog(scumm, Common::U32String(text)) {
}
void Indy3IQPointsDialog::handleKeyDown(Common::KeyState state) {

View File

@ -232,7 +232,7 @@ void ScummEngine::askForDisk(const char *filename, int disknum) {
#endif
} else {
sprintf(buf, "Cannot find file: '%s'", filename);
InfoDialog dialog(this, Common::convertToU32String(buf));
InfoDialog dialog(this, Common::U32String(buf));
runDialog(dialog);
error("Cannot find file: '%s'", filename);
}

View File

@ -2476,7 +2476,7 @@ void ScummEngine::scummLoop_handleSaveLoad() {
char buf[256];
snprintf(buf, sizeof(buf), _("Successfully saved game in file:\n\n%s").encode().c_str(), filename.c_str());
GUI::TimedMessageDialog dialog(Common::convertToU32String(buf), 1500);
GUI::TimedMessageDialog dialog(Common::U32String(buf), 1500);
runDialog(dialog);
}
if (success && _saveLoadFlag != 1)

View File

@ -115,7 +115,7 @@ void ScummEngine::showMessageDialog(const byte *msg) {
if (_string[3].color == 0)
_string[3].color = 4;
InfoDialog dialog(this, Common::convertToU32String((char *)buf));
InfoDialog dialog(this, Common::U32String((char *)buf));
VAR(VAR_KEYPRESS) = runDialog(dialog);
}

View File

@ -2069,7 +2069,7 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
if (ttsMan != nullptr) {
ttsMan->stop();
ttsMan->say(Common::convertToU32String(str.c_str()));
ttsMan->say(str.c_str());
}
}
#endif

View File

@ -362,7 +362,7 @@ void Talk::talkTo(const Common::String filename) {
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
if (ttsMan != nullptr) {
ttsMan->stop();
ttsMan->say(Common::convertToU32String(_statements[select]._reply.c_str()));
ttsMan->say(_statements[select]._reply.c_str());
}
}
#endif

View File

@ -130,7 +130,7 @@ SkyCompact::SkyCompact() {
if (!_cptFile->open(filename.c_str())) {
Common::U32String msg = Common::U32String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
error("%s", msg.encode().c_str());
error("Unable to locate the '%s' engine data file.", filename.c_str());
}
uint16 fileVersion = _cptFile->readUint16LE();

View File

@ -209,7 +209,7 @@ Common::KeymapArray SkyMetaEngine::initKeymaps(const char *target) const {
using namespace Common;
using namespace Sky;
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, "sky-main", Common::convertToU32String("Beneath a Steel Sky"));
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, "sky-main", "Beneath a Steel Sky");
Action *act;
@ -237,7 +237,7 @@ Common::KeymapArray SkyMetaEngine::initKeymaps(const char *target) const {
act->addDefaultInputMapping("JOY_Y");
mainKeymap->addAction(act);
Keymap *shortcutsKeymap = new Keymap(Keymap::kKeymapTypeGame, SkyEngine::shortcutsKeymapId, Common::convertToU32String("Beneath a Steel Sky - Shortcuts"));
Keymap *shortcutsKeymap = new Keymap(Keymap::kKeymapTypeGame, SkyEngine::shortcutsKeymapId, "Beneath a Steel Sky - Shortcuts");
act = new Action(kStandardActionOpenMainMenu, _("Open control panel"));
act->setCustomEngineActionEvent(kSkyActionOpenControlPanel);

View File

@ -824,8 +824,8 @@ bool SupernovaEngine::saveGame(int slot, const Common::String &description) {
void SupernovaEngine::errorTempSave(bool saving) {
GUIErrorMessage(saving
? Common::convertToU32String("Failed to save temporary game state. Make sure your save game directory is set in ScummVM and that you can write to it.")
: Common::convertToU32String("Failed to load temporary game state."));
? _("Failed to save temporary game state. Make sure your save game directory is set in ScummVM and that you can write to it.")
: _("Failed to load temporary game state."));
error("Unrecoverable error");
}

View File

@ -305,7 +305,7 @@ byte *Sword2Engine::fetchPsxBackground(uint32 location) {
byte *buffer;
if (!file.open("screens.clu")) {
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Cannot open screens.clu"));
GUIErrorMessage("Broken Sword II: Cannot open screens.clu");
return NULL;
}
@ -373,7 +373,7 @@ byte *Sword2Engine::fetchPsxParallax(uint32 location, uint8 level) {
return NULL;
if (!file.open("screens.clu")) {
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Cannot open screens.clu"));
GUIErrorMessage("Broken Sword II: Cannot open screens.clu");
return NULL;
}

View File

@ -104,7 +104,7 @@ bool ResourceManager::init() {
Common::File file;
if (!file.open("resource.inf")) {
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Cannot open resource.inf"));
GUIErrorMessage("Broken Sword II: Cannot open resource.inf");
return false;
}
@ -125,7 +125,7 @@ bool ResourceManager::init() {
_resFiles[_totalClusters].numEntries = -1;
_resFiles[_totalClusters].entryTab = NULL;
if (++_totalClusters >= MAX_res_files) {
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Too many entries in resource.inf"));
GUIErrorMessage("Broken Sword II: Too many entries in resource.inf");
return false;
}
}
@ -134,7 +134,7 @@ bool ResourceManager::init() {
// Now load in the binary id to res conversion table
if (!file.open("resource.tab")) {
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Cannot open resource.tab"));
GUIErrorMessage("Broken Sword II: Cannot open resource.tab");
return false;
}
@ -151,7 +151,7 @@ bool ResourceManager::init() {
if (file.eos() || file.err()) {
file.close();
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Cannot read resource.tab"));
GUIErrorMessage("Broken Sword II: Cannot read resource.tab");
return false;
}
@ -161,7 +161,7 @@ bool ResourceManager::init() {
// version, which has all files on one disc.
if (!file.open("cd.inf") && !Sword2Engine::isPsx()) {
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Cannot open cd.inf"));
GUIErrorMessage("Broken Sword II: Cannot open cd.inf");
return false;
}
@ -179,7 +179,7 @@ bool ResourceManager::init() {
if (file.eos() || file.err()) {
delete[] cdInf;
file.close();
GUIErrorMessage(Common::convertToU32String("Broken Sword II: Cannot read cd.inf"));
GUIErrorMessage("Broken Sword II: Cannot read cd.inf");
return false;
}

View File

@ -95,7 +95,7 @@ bool Resources::loadArchives(const ADGameDescription *gd) {
if (!dat_file->open(filename.c_str())) {
delete dat_file;
Common::U32String errorMessage = Common::U32String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
warning("%s", errorMessage.encode().c_str());
warning("Unable to locate the '%s' engine data file.", filename.c_str());
GUIErrorMessage(errorMessage);
return false;
}

View File

@ -34,8 +34,8 @@ TestbedOptionsDialog::TestbedOptionsDialog(Common::Array<Testsuite *> &tsList, T
GUI::Dialog("TestbedOptions"),
_testbedConfMan(tsConfMan) {
new GUI::StaticTextWidget(this, "TestbedOptions.Headline", Common::convertToU32String("Select Testsuites to Execute"));
new GUI::StaticTextWidget(this, "TestbedOptions.Info", Common::convertToU32String("Use Doubleclick to select/deselect"));
new GUI::StaticTextWidget(this, "TestbedOptions.Headline", Common::U32String("Select Testsuites to Execute"));
new GUI::StaticTextWidget(this, "TestbedOptions.Info", Common::U32String("Use Doubleclick to select/deselect"));
// Construct a String Array
Common::Array<Testsuite *>::const_iterator iter;
@ -63,12 +63,12 @@ TestbedOptionsDialog::TestbedOptionsDialog(Common::Array<Testsuite *> &tsList, T
_testListDisplay->setEditable(false);
if (selected > (tsList.size() - selected)) {
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", Common::convertToU32String("Deselect All"), Common::U32String(""), kTestbedDeselectAll, 0);
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", Common::U32String("Deselect All"), Common::U32String(""), kTestbedDeselectAll, 0);
} else {
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", Common::convertToU32String("Select All"), Common::U32String(""), kTestbedSelectAll, 0);
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", Common::U32String("Select All"), Common::U32String(""), kTestbedSelectAll, 0);
}
new GUI::ButtonWidget(this, "TestbedOptions.RunTests", Common::convertToU32String("Run tests"), Common::U32String(""), GUI::kCloseCmd);
new GUI::ButtonWidget(this, "TestbedOptions.Quit", Common::convertToU32String("Exit Testbed"), Common::U32String(""), kTestbedQuitCmd);
new GUI::ButtonWidget(this, "TestbedOptions.RunTests", Common::U32String("Run tests"), Common::U32String(""), GUI::kCloseCmd);
new GUI::ButtonWidget(this, "TestbedOptions.Quit", Common::U32String("Exit Testbed"), Common::U32String(""), kTestbedQuitCmd);
}
TestbedOptionsDialog::~TestbedOptionsDialog() {}
@ -102,7 +102,7 @@ void TestbedOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd,
break;
case kTestbedDeselectAll:
_selectButton->setLabel(Common::convertToU32String("Select All"));
_selectButton->setLabel("Select All");
_selectButton->setCmd(kTestbedSelectAll);
for (uint i = 0; i < _testSuiteArray.size(); i++) {
_testListDisplay->markAsDeselected(i);
@ -114,7 +114,7 @@ void TestbedOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd,
break;
case kTestbedSelectAll:
_selectButton->setLabel(Common::convertToU32String("Deselect All"));
_selectButton->setLabel("Deselect All");
_selectButton->setCmd(kTestbedDeselectAll);
for (uint i = 0; i < _testSuiteArray.size(); i++) {
_testListDisplay->markAsSelected(i);

View File

@ -73,7 +73,7 @@ public:
void markAsSelected(int i) {
if (!_list[i].encode().contains("selected")) {
_list[i] += Common::convertToU32String(" (selected)");
_list[i] += Common::U32String(" (selected)");
}
_listColors[i] = GUI::ThemeEngine::kFontColorNormal;
draw();

View File

@ -59,7 +59,7 @@ TestExitStatus Speechtests::testMale() {
return kTestFailed;
}
ttsMan->setVoice(maleVoices[0]);
ttsMan->say(Common::convertToU32String("Testing text to speech with male voice."));
ttsMan->say("Testing text to speech with male voice.");
if (!ttsMan->isSpeaking()) {
Testsuite::logDetailedPrintf("Male TTS failed\n");
return kTestFailed;
@ -96,7 +96,7 @@ TestExitStatus Speechtests::testFemale() {
return kTestFailed;
}
ttsMan->setVoice(femaleVoices[0]);
ttsMan->say(Common::convertToU32String("Testing text to speech with female voice."));
ttsMan->say("Testing text to speech with female voice.");
if (!ttsMan->isSpeaking()) {
Testsuite::logDetailedPrintf("Female TTS failed\n");
return kTestFailed;
@ -128,7 +128,7 @@ TestExitStatus Speechtests::testStop() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("Testing text to speech, the speech should stop after approximately a second after it started, so it shouldn't have the time to read this."));
ttsMan->say("Testing text to speech, the speech should stop after approximately a second after it started, so it shouldn't have the time to read this.");
g_system->delayMillis(1000);
ttsMan->stop();
// It is allright if the voice isn't available right away, but a second should be
@ -164,11 +164,11 @@ TestExitStatus Speechtests::testStopAndSpeak() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("Testing text to speech, the speech should stop after approximately a second after it started, so it shouldn't have the time to read this."));
ttsMan->say("Testing text to speech, the speech should stop after approximately a second after it started, so it shouldn't have the time to read this.");
g_system->delayMillis(1000);
ttsMan->stop();
ttsMan->say(Common::convertToU32String("Now starting the second sentence."), Common::TextToSpeechManager::QUEUE);
ttsMan->say(Common::convertToU32String("You should hear that one in totality."), Common::TextToSpeechManager::QUEUE);
ttsMan->say("Now starting the second sentence.", Common::TextToSpeechManager::QUEUE);
ttsMan->say("You should hear that one in totality.", Common::TextToSpeechManager::QUEUE);
if (!ttsMan->isSpeaking()) {
Testsuite::logDetailedPrintf("Male TTS failed\n");
return kTestFailed;
@ -201,14 +201,14 @@ TestExitStatus Speechtests::testPauseResume() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("Testing text to speech, the speech should pause after a second"));
ttsMan->say("Testing text to speech, the speech should pause after a second");
g_system->delayMillis(1000);
ttsMan->pause();
if (!ttsMan->isPaused()) {
Testsuite::logDetailedPrintf("TTS pause failed\n");
return kTestFailed;
}
ttsMan->say(Common::convertToU32String("and then resume again"), Common::TextToSpeechManager::QUEUE);
ttsMan->say("and then resume again", Common::TextToSpeechManager::QUEUE);
g_system->delayMillis(3000);
if (!ttsMan->isPaused()) {
Testsuite::logDetailedPrintf("TTS pause failed\n");
@ -247,10 +247,10 @@ TestExitStatus Speechtests::testRate() {
}
ttsMan->setRate(-100);
ttsMan->say(Common::convertToU32String("Text to speech slow rate."));
ttsMan->say("Text to speech slow rate.");
waitForSpeechEnd(ttsMan);
ttsMan->setRate(100);
ttsMan->say(Common::convertToU32String("Text to speech fast rate."));
ttsMan->say("Text to speech fast rate.");
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a voice saying: \"Text to speech slow rate.\" slowly and then \"Text to speech fast rate.\" fast?";
@ -280,10 +280,10 @@ TestExitStatus Speechtests::testVolume() {
}
ttsMan->setVolume(20);
ttsMan->say(Common::convertToU32String("Text to speech low volume."));
ttsMan->say("Text to speech low volume.");
waitForSpeechEnd(ttsMan);
ttsMan->setVolume(100);
ttsMan->say(Common::convertToU32String("Text to speech max volume."));
ttsMan->say("Text to speech max volume.");
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a voice saying: \"Text to speech low volume.\" quietly and then \"Text to speech max volume.\" at a higher volume?";
if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
@ -312,10 +312,10 @@ TestExitStatus Speechtests::testPitch() {
}
ttsMan->setPitch(100);
ttsMan->say(Common::convertToU32String("Text to speech high pitch."));
ttsMan->say("Text to speech high pitch.");
waitForSpeechEnd(ttsMan);
ttsMan->setPitch(-100);
ttsMan->say(Common::convertToU32String("Text to speech low pitch."));
ttsMan->say("Text to speech low pitch.");
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a high pitched voice saying: \"Text to speech high pitch.\" and then a low pitched voice: \"Text to speech low pitch.\" ?";
if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
@ -343,7 +343,7 @@ TestExitStatus Speechtests::testStateStacking() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("Voice number 1 is speaking"));
ttsMan->say("Voice number 1 is speaking");
waitForSpeechEnd(ttsMan);
ttsMan->pushState();
Common::Array<int> femaleVoices = ttsMan->getVoiceIndicesByGender(Common::TTSVoice::FEMALE);
@ -355,20 +355,20 @@ TestExitStatus Speechtests::testStateStacking() {
ttsMan->setVolume(80);
ttsMan->setPitch(40);
ttsMan->setRate(-30);
ttsMan->say(Common::convertToU32String("Voice number 2 is speaking"));
ttsMan->say("Voice number 2 is speaking");
waitForSpeechEnd(ttsMan);
ttsMan->pushState();
ttsMan->setVoice(2 % allVoices.size());
ttsMan->setVolume(90);
ttsMan->setPitch(-80);
ttsMan->setRate(-50);
ttsMan->say(Common::convertToU32String("Voice number 3 is speaking"));
ttsMan->say("Voice number 3 is speaking");
waitForSpeechEnd(ttsMan);
ttsMan->popState();
ttsMan->say(Common::convertToU32String("Voice number 2 is speaking"));
ttsMan->say("Voice number 2 is speaking");
waitForSpeechEnd(ttsMan);
ttsMan->popState();
ttsMan->say(Common::convertToU32String("Voice number 1 is speaking"));
ttsMan->say("Voice number 1 is speaking");
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear three different voices speaking in this order: 1, 2, 3, 2, 1 and each time the same voice spoke, it sounded the same?";
@ -397,8 +397,8 @@ TestExitStatus Speechtests::testQueueing() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("This is first speech."));
ttsMan->say(Common::convertToU32String("This is second speech."), Common::TextToSpeechManager::QUEUE);
ttsMan->say("This is first speech.");
ttsMan->say("This is second speech.", Common::TextToSpeechManager::QUEUE);
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a voice saying: \"This is first speech. This is second speech\" ?";
if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
@ -426,9 +426,9 @@ TestExitStatus Speechtests::testInterrupting() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z"));
ttsMan->say("A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z");
g_system->delayMillis(1000);
ttsMan->say(Common::convertToU32String("Speech interrupted"), Common::TextToSpeechManager::INTERRUPT);
ttsMan->say("Speech interrupted", Common::TextToSpeechManager::INTERRUPT);
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a voice saying the engilsh alphabet, but it got interrupted and said: \"Speech interrupted\" instead?";
if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
@ -456,8 +456,8 @@ TestExitStatus Speechtests::testDroping() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("Today is a really nice weather, perfect day to use ScummVM, don't you think?"));
ttsMan->say(Common::convertToU32String("Speech interrupted, fail"), Common::TextToSpeechManager::DROP);
ttsMan->say("Today is a really nice weather, perfect day to use ScummVM, don't you think?");
ttsMan->say("Speech interrupted, fail", Common::TextToSpeechManager::DROP);
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a voice say: \"Today is a really nice weather, perfect day to use ScummVM, don't you think?\" and nothing else?";
if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
@ -485,16 +485,16 @@ TestExitStatus Speechtests::testInterruptNoRepeat() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("This is the first sentence, this should get interrupted"));
ttsMan->say(Common::convertToU32String("Failure"), Common::TextToSpeechManager::QUEUE);
ttsMan->say("This is the first sentence, this should get interrupted");
ttsMan->say("Failure", Common::TextToSpeechManager::QUEUE);
g_system->delayMillis(1000);
ttsMan->say(Common::convertToU32String("This is the second sentence, it should play only once"), Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
ttsMan->say(Common::convertToU32String("Failure"), Common::TextToSpeechManager::QUEUE);
ttsMan->say("This is the second sentence, it should play only once", Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
ttsMan->say("Failure", Common::TextToSpeechManager::QUEUE);
g_system->delayMillis(1000);
ttsMan->say(Common::convertToU32String("This is the second sentence, it should play only once"), Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
ttsMan->say(Common::convertToU32String("Failure"), Common::TextToSpeechManager::QUEUE);
ttsMan->say("This is the second sentence, it should play only once", Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
ttsMan->say("Failure", Common::TextToSpeechManager::QUEUE);
g_system->delayMillis(1000);
ttsMan->say(Common::convertToU32String("This is the second sentence, it should play only once"), Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
ttsMan->say("This is the second sentence, it should play only once", Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a voice say: \"This is the first sentence, this should get interrupted\", but it got interrupted and \"This is the second sentence, it should play only once.\" got said instead?";
if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
@ -522,14 +522,14 @@ TestExitStatus Speechtests::testQueueNoRepeat() {
return kTestSkipped;
}
ttsMan->say(Common::convertToU32String("This is the first sentence."));
ttsMan->say(Common::convertToU32String("This is the first sentence."), Common::TextToSpeechManager::QUEUE_NO_REPEAT);
ttsMan->say("This is the first sentence.");
ttsMan->say("This is the first sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
g_system->delayMillis(1000);
ttsMan->say(Common::convertToU32String("This is the first sentence."), Common::TextToSpeechManager::QUEUE_NO_REPEAT);
ttsMan->say(Common::convertToU32String("This is the second sentence."), Common::TextToSpeechManager::QUEUE_NO_REPEAT);
ttsMan->say(Common::convertToU32String("This is the second sentence."), Common::TextToSpeechManager::QUEUE_NO_REPEAT);
ttsMan->say("This is the first sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
ttsMan->say("This is the second sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
ttsMan->say("This is the second sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
g_system->delayMillis(1000);
ttsMan->say(Common::convertToU32String("This is the second sentence."), Common::TextToSpeechManager::QUEUE_NO_REPEAT);
ttsMan->say("This is the second sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
waitForSpeechEnd(ttsMan);
Common::String prompt = "Did you hear a voice say: \"This is the first sentence. This the second sentence\" and nothing else?";
if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {

View File

@ -67,7 +67,7 @@ void TestbedExitDialog::init() {
if ((*i)->isEnabled()) {
strArray.push_back(Common::String::format("Passed: %d Failed: %d Skipped: %d", (*i)->getNumTestsPassed(), (*i)->getNumTestsFailed(), (*i)->getNumTestsSkipped()));
} else {
strArray.push_back(Common::convertToU32String("Skipped"));
strArray.push_back(Common::U32String("Skipped"));
}
colors.push_back(GUI::ThemeEngine::kFontColorAlternate);
}

View File

@ -483,12 +483,12 @@ void SoundManager::setSFXVolumes(uint8 volume) {
}
void SoundManager::showSoundError(const char *errorMsg, const char *soundFile) {
Common::U32String msg;
Common::String msg;
msg = Common::String::format(errorMsg, soundFile);
GUI::MessageDialog dialog(msg);
GUI::MessageDialog dialog(msg.c_str(), "OK");
dialog.runModal();
error("%s", msg.encode().c_str());
error("%s", msg.c_str());
}
/**

View File

@ -39,19 +39,19 @@ CFilesManager::~CFilesManager() {
bool CFilesManager::loadResourceIndex() {
if (!_datFile.open("titanic.dat")) {
GUIErrorMessage(Common::convertToU32String("Could not find titanic.dat data file"));
GUIErrorMessage("Could not find titanic.dat data file");
return false;
}
uint headerId = _datFile.readUint32BE();
_version = _datFile.readUint16LE();
if (headerId != MKTAG('S', 'V', 'T', 'N')) {
GUIErrorMessage(Common::convertToU32String("titanic.dat has invalid contents"));
GUIErrorMessage("titanic.dat has invalid contents");
return false;
}
if (_version != 5) {
GUIErrorMessage(Common::convertToU32String("titanic.dat is out of date"));
GUIErrorMessage("titanic.dat is out of date");
return false;
}

View File

@ -195,7 +195,7 @@ bool TonyEngine::loadTonyDat() {
if (!in.isOpen()) {
msg = Common::U32String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("Unable to locate the '%s' engine data file.", filename.c_str());
return false;
}
@ -207,7 +207,7 @@ bool TonyEngine::loadTonyDat() {
if (strcmp(buf, "TONY")) {
msg = Common::U32String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("The '%s' engine data file is corrupt.", filename.c_str());
return false;
}
@ -219,7 +219,8 @@ bool TonyEngine::loadTonyDat() {
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
filename.c_str(), TONY_DAT_VER_MAJ, TONY_DAT_VER_MIN, majVer, minVer);
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.",
filename.c_str(), TONY_DAT_VER_MAJ, TONY_DAT_VER_MIN, majVer, minVer);
return false;
}
@ -255,7 +256,7 @@ bool TonyEngine::loadTonyDat() {
if (expectedLangVariant > numVariant - 1) {
msg = Common::U32String::format(_("Font variant not present in '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("Font variant not present in '%s' engine data file.", filename.c_str());
return false;
}

View File

@ -245,7 +245,7 @@ void ToonEngine::parseInput() {
} else {
Common::U32String buf = Common::U32String::format(_("Could not quick load the saved game #%d"), slotNum);
GUI::MessageDialog dialog(buf);
warning("%s", buf.encode().c_str());
warning("Could not quick load the saved game #%d", slotNum);
dialog.runModal();
}
}
@ -1526,7 +1526,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) {
if (!resources()->openPackage(createRoomFilename(locationName + ".PAK"))) {
Common::U32String msg = Common::U32String::format(_("Unable to locate the '%s' data file."), createRoomFilename(locationName + ".PAK").c_str());
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("Unable to locate the '%s' data file.", createRoomFilename(locationName + ".PAK").c_str());
_shouldQuit = true;
return;
}
@ -4951,7 +4951,7 @@ bool ToonEngine::loadToonDat() {
if (!in.isOpen()) {
msg = Common::U32String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("Unable to locate the '%s' engine data file.", filename.c_str());
return false;
}
@ -4963,7 +4963,7 @@ bool ToonEngine::loadToonDat() {
if (strcmp(buf, "TOON")) {
msg = Common::U32String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("The '%s' engine data file is corrupt.", filename.c_str());
return false;
}
@ -4975,7 +4975,8 @@ bool ToonEngine::loadToonDat() {
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
filename.c_str(), TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer);
GUIErrorMessage(msg);
warning("%s", msg.encode().c_str());
warning("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.",
filename.c_str(), TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer);
return false;
}

View File

@ -1622,7 +1622,7 @@ void SceneItem::doAction(int action) {
break;
}
GUIErrorMessage(Common::convertToU32String(msg));
GUIErrorMessage(msg);
}
}
@ -4436,7 +4436,7 @@ void SceneHandler::dispatch() {
// FIXME: Make use of the description string in err to enhance
// the error reported to the user.
if (err.getCode() != Common::kNoError)
GUIErrorMessage(Common::convertToU32String(SAVE_ERROR_MSG));
GUIErrorMessage(SAVE_ERROR_MSG);
}
if (_loadGameSlot != -1) {
int priorSceneBeforeLoad = GLOBALS._sceneManager._previousScene;

View File

@ -201,7 +201,7 @@ Common::KeymapArray MetaEngine::initKeymaps(KeybindingMode mode) {
for (int kCtr = 0; recPtr->_id; ++recPtr, ++kCtr) {
// Core keymaps
keyMap = new Common::Keymap(Common::Keymap::kKeymapTypeGame,
recPtr->_id, Common::convertToU32String(recPtr->_desc));
recPtr->_id, recPtr->_desc);
keymapArray.push_back(keyMap);
if (kCtr == 0) {

View File

@ -153,7 +153,7 @@ void BasePersistenceManager::getSaveStateDesc(int slot, SaveStateDescriptor &des
return;
}
desc.setSaveSlot(slot);
desc.setDescription(Common::convertToU32String(_savedDescription));
desc.setDescription(_savedDescription);
desc.setDeletableFlag(true);
desc.setWriteProtectedFlag(false);

View File

@ -209,7 +209,7 @@ public:
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override {
Wintermute::BasePersistenceManager pm(target, true);
SaveStateDescriptor retVal;
retVal.setDescription(Common::convertToU32String("Invalid savegame"));
retVal.setDescription("Invalid savegame");
pm.getSaveStateDesc(slot, retVal);
return retVal;
}

View File

@ -34,9 +34,9 @@ inline Common::KeymapArray getWintermuteKeymaps(const char *target, const Common
using namespace Common;
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "wintermute", Common::convertToU32String("Wintermute engine"));
Keymap *gameKeyMap = new Keymap(Keymap::kKeymapTypeGame, gameId, Common::convertToU32String(gameDescr));
Keymap *extraKeyMap = new Keymap(Keymap::kKeymapTypeGame, "extras", Common::convertToU32String("ScummVM extra actions"));
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "wintermute", "Wintermute engine");
Keymap *gameKeyMap = new Keymap(Keymap::kKeymapTypeGame, gameId, gameDescr);
Keymap *extraKeyMap = new Keymap(Keymap::kKeymapTypeGame, "extras", "ScummVM extra actions");
Action *act;

View File

@ -255,14 +255,14 @@ bool FileManager::setup() {
// Ensure the custom CC archive is present
File f;
if (!f.exists("xeen.ccs")) {
GUIErrorMessage(Common::convertToU32String("Could not find xeen.ccs data file"));
GUIErrorMessage("Could not find xeen.ccs data file");
return false;
}
// Verify the version of the CC is correct
CCArchive *dataCc = new CCArchive("xeen.ccs", "data", true);
if (!f.open("VERSION", *dataCc) || f.readUint32LE() != 3) {
GUIErrorMessage(Common::convertToU32String("xeen.ccs is out of date"));
GUIErrorMessage("xeen.ccs is out of date");
return false;
}
SearchMan.add("data", dataCc);

View File

@ -129,7 +129,7 @@ Common::KeymapArray ZVisionMetaEngine::initKeymaps(const char *target) const {
using namespace Common;
using namespace ZVision;
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, mainKeymapId, Common::convertToU32String("Z-Vision"));
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, mainKeymapId, "Z-Vision");
Action *act;
@ -145,7 +145,7 @@ Common::KeymapArray ZVisionMetaEngine::initKeymaps(const char *target) const {
act->addDefaultInputMapping("JOY_B");
mainKeymap->addAction(act);
Keymap *gameKeymap = new Keymap(Keymap::kKeymapTypeGame, gameKeymapId, Common::convertToU32String("Z-Vision - Game"));
Keymap *gameKeymap = new Keymap(Keymap::kKeymapTypeGame, gameKeymapId, "Z-Vision - Game");
act = new Action(kStandardActionMoveUp, _("Look Up"));
act->setCustomEngineActionEvent(kZVisionActionUp);
@ -232,7 +232,7 @@ Common::KeymapArray ZVisionMetaEngine::initKeymaps(const char *target) const {
act->addDefaultInputMapping("C+p");
gameKeymap->addAction(act);
Keymap *cutscenesKeymap = new Keymap(Keymap::kKeymapTypeGame, cutscenesKeymapId, Common::convertToU32String("Z-Vision - Cutscenes"));
Keymap *cutscenesKeymap = new Keymap(Keymap::kKeymapTypeGame, cutscenesKeymapId, "Z-Vision - Cutscenes");
act = new Action(kStandardActionSkip, _("Skip cutscene"));
act->setCustomEngineActionEvent(kZVisionActionSkipCutscene);

View File

@ -44,6 +44,7 @@
#include "common/debug-channels.h"
#include "common/textconsole.h"
#include "common/timer.h"
#include "common/translation.h"
#include "common/error.h"
#include "common/system.h"
#include "common/file.h"
@ -308,7 +309,7 @@ Common::Error ZVision::run() {
}
if (!foundAllFonts) {
GUI::MessageDialog dialog(Common::convertToU32String(
GUI::MessageDialog dialog(_(
"Before playing this game, you'll need to copy the required "
"fonts into ScummVM's extras directory, or into the game directory. "
"On Windows, you'll need the following font files from the Windows "

View File

@ -392,6 +392,10 @@ void ButtonWidget::setLabel(const Common::U32String &label) {
StaticTextWidget::setLabel(cleanupHotkey(label));
}
void ButtonWidget::setLabel(const Common::String &label) {
ButtonWidget::setLabel(Common::U32String(label));
}
ButtonWidget *addClearButton(GuiObject *boss, const Common::String &name, uint32 cmd, int x, int y, int w, int h) {
ButtonWidget *button;

View File

@ -230,6 +230,7 @@ public:
uint32 getCmd() const { return _cmd; }
void setLabel(const Common::U32String &label);
void setLabel(const Common::String &label);
void handleMouseUp(int x, int y, int button, int clickCount) override;
void handleMouseDown(int x, int y, int button, int clickCount) override;

View File

@ -503,6 +503,10 @@ void PopUpWidget::appendEntry(const U32String &entry, uint32 tag) {
_entries.push_back(e);
}
void PopUpWidget::appendEntry(const String &entry, uint32 tag) {
appendEntry(U32String(entry), tag);
}
void PopUpWidget::clearEntries() {
_entries.clear();
_selectedItem = -1;

View File

@ -65,6 +65,7 @@ public:
void handleMouseWheel(int x, int y, int direction) override;
void appendEntry(const U32String &entry, uint32 tag = (uint32)-1);
void appendEntry(const String &entry, uint32 tag = (uint32)-1);
void clearEntries();
int numEntries() { return _entries.size(); }

View File

@ -1,6 +1,5 @@
POTFILE := $(srcdir)/po/scummvm.pot
POFILES := $(wildcard $(srcdir)/po/*.po)
CPFILES := $(wildcard $(srcdir)/po/*.cp)
ENGINE_INPUT_POTFILES := $(sort $(wildcard $(srcdir)/engines/*/POTFILES))
updatepot:
@ -37,12 +36,12 @@ updatepot:
fi;
translations-dat: devtools/create_translations
devtools/create_translations/create_translations $(POFILES) $(CPFILES)
devtools/create_translations/create_translations $(POFILES)
mv translations.dat $(srcdir)/gui/themes/
update-translations: updatepot $(POFILES) $(CPFILES) translations-dat
update-translations: updatepot $(POFILES) translations-dat
update-translations: updatepot $(POFILES) $(CPFILES)
update-translations: updatepot $(POFILES)
@$(foreach file, $(POFILES), echo -n $(notdir $(basename $(file)))": ";msgfmt --statistic $(file);)
@rm -f messages.mo