GUI: U32: Fix compilation errors across entire project
After the initial changes just to scummvm/gui for u32, this commit includes the whole project - Widget creations now always have u32 descriptions, labels, or tooltips - Message dialogs make use of default arguments instead of providing the same argument explicitly - encode String::format properly before passing on as argument where necessary - Modify hugo utils (yesNoBox and notify box) to use u32 - Also provide fake constructors for the above which redirect to the u32 constructor - Convert all keymap descriptions to u32 across all engines - showConfirmationDialog in mohawk now uses u32 - showScummVMDialog also uses u32 - Scumm engine has dialogs now which use u32 - General fixes and wrapping convertToU32String for setLabels and related functions - Add a fake constructor to MesssageDialog which redirects to the u32 constructor
This commit is contained in:
parent
fd763b61e5
commit
bed05ea134
88 changed files with 271 additions and 247 deletions
|
@ -41,7 +41,7 @@ bool Resources::load(Common::String &errorMessage) {
|
||||||
Common::File f;
|
Common::File f;
|
||||||
Common::String filename = "access.dat";
|
Common::String filename = "access.dat";
|
||||||
if (!f.open(filename.c_str())) {
|
if (!f.open(filename.c_str())) {
|
||||||
errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
|
errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ bool Resources::load(Common::String &errorMessage) {
|
||||||
char buffer[4];
|
char buffer[4];
|
||||||
f.read(buffer, 4);
|
f.read(buffer, 4);
|
||||||
if (strncmp(buffer, "SVMA", 4)) {
|
if (strncmp(buffer, "SVMA", 4)) {
|
||||||
errorMessage = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
|
errorMessage = Common::String::format(_("The '%s' engine data file is corrupt.").encode().c_str(), filename.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ bool Resources::load(Common::String &errorMessage) {
|
||||||
uint version = f.readUint16LE();
|
uint version = f.readUint16LE();
|
||||||
if (version != expectedVersion) {
|
if (version != expectedVersion) {
|
||||||
errorMessage = Common::String::format(
|
errorMessage = Common::String::format(
|
||||||
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
|
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.").encode().c_str(),
|
||||||
filename.c_str(), expectedVersion, 0, version, 0);
|
filename.c_str(), expectedVersion, 0, version, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -555,7 +555,7 @@ MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name) {
|
||||||
return new MoviePlayerSMK(vm, baseName);
|
return new MoviePlayerSMK(vm, baseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String buf = Common::String::format(_("Cutscene file '%s' not found!"), baseName);
|
Common::U32String buf = Common::String::format(_("Cutscene file '%s' not found!").encode().c_str(), baseName);
|
||||||
GUI::MessageDialog dialog(buf, _("OK"));
|
GUI::MessageDialog dialog(buf, _("OK"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ void AGOSEngine_Feeble::quickLoadOrSave() {
|
||||||
// was disabled
|
// was disabled
|
||||||
void AGOSEngine::quickLoadOrSave() {
|
void AGOSEngine::quickLoadOrSave() {
|
||||||
bool success;
|
bool success;
|
||||||
Common::String buf;
|
Common::U32String buf;
|
||||||
|
|
||||||
// Disable loading and saving when it was not possible in the original:
|
// Disable loading and saving when it was not possible in the original:
|
||||||
// In overhead maps areas in Simon the Sorcerer 2
|
// In overhead maps areas in Simon the Sorcerer 2
|
||||||
|
@ -135,7 +135,7 @@ void AGOSEngine::quickLoadOrSave() {
|
||||||
(getGameType() == GType_SIMON1 && (getFeatures() & GF_DEMO)) ||
|
(getGameType() == GType_SIMON1 && (getFeatures() & GF_DEMO)) ||
|
||||||
_mouseHideCount || _showPreposition) {
|
_mouseHideCount || _showPreposition) {
|
||||||
buf = Common::String::format("Quick load or save game isn't supported in this location");
|
buf = Common::String::format("Quick load or save game isn't supported in this location");
|
||||||
GUI::MessageDialog dialog(buf, "OK");
|
GUI::MessageDialog dialog(buf);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ void AGOSEngine::quickLoadOrSave() {
|
||||||
Subroutine *sub;
|
Subroutine *sub;
|
||||||
success = loadGame(genSaveName(_saveLoadSlot));
|
success = loadGame(genSaveName(_saveLoadSlot));
|
||||||
if (!success) {
|
if (!success) {
|
||||||
buf = Common::String::format(_("Failed to load saved game from file:\n\n%s"), filename.c_str());
|
buf = Common::String::format(_("Failed to load saved game from file:\n\n%s").encode().c_str(), filename.c_str());
|
||||||
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
|
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
|
||||||
drawIconArray(2, me(), 0, 0);
|
drawIconArray(2, me(), 0, 0);
|
||||||
setBitFlag(97, true);
|
setBitFlag(97, true);
|
||||||
|
@ -191,15 +191,15 @@ void AGOSEngine::quickLoadOrSave() {
|
||||||
} else {
|
} else {
|
||||||
success = saveGame(_saveLoadSlot, _saveLoadName);
|
success = saveGame(_saveLoadSlot, _saveLoadName);
|
||||||
if (!success)
|
if (!success)
|
||||||
buf = Common::String::format(_("Failed to save game to file:\n\n%s"), filename.c_str());
|
buf = Common::String::format(_("Failed to save game to file:\n\n%s").encode().c_str(), filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
GUI::MessageDialog dialog(buf, "OK");
|
GUI::MessageDialog dialog(buf);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
|
|
||||||
} else if (_saveLoadType == 1) {
|
} else if (_saveLoadType == 1) {
|
||||||
buf = Common::String::format(_("Successfully saved game in file:\n\n%s"), filename.c_str());
|
buf = Common::String::format(_("Successfully saved game in file:\n\n%s").encode().c_str(), filename.c_str());
|
||||||
GUI::TimedMessageDialog dialog(buf, 1500);
|
GUI::TimedMessageDialog dialog(buf, 1500);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
|
|
||||||
|
|
|
@ -86,11 +86,11 @@ MainMenu::~MainMenu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainMenu::init() {
|
void MainMenu::init() {
|
||||||
_buttons[0] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
|
_buttons[0] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String(""), Common::U32String(""), 0);
|
||||||
_buttons[1] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
|
_buttons[1] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String(""), Common::U32String(""), 0);
|
||||||
_buttons[2] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
|
_buttons[2] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String(""), Common::U32String(""), 0);
|
||||||
_buttons[3] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
|
_buttons[3] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String(""), Common::U32String(""), 0);
|
||||||
_buttons[4] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
|
_buttons[4] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String(""), Common::U32String(""), 0);
|
||||||
gotoMenuScreen(kMainMenuScr);
|
gotoMenuScreen(kMainMenuScr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ void MainMenu::gotoMenuScreen(int screen) {
|
||||||
} else {
|
} else {
|
||||||
btn = &kMenuButtons[screen * 5 + i];
|
btn = &kMenuButtons[screen * 5 + i];
|
||||||
}
|
}
|
||||||
_buttons[i]->setLabel(btn->label);
|
_buttons[i]->setLabel(Common::U32String(btn->label));
|
||||||
_buttons[i]->setCmd(btn->cmd);
|
_buttons[i]->setCmd(btn->cmd);
|
||||||
_buttons[i]->setEnabled(btn->cmd != 0);
|
_buttons[i]->setEnabled(btn->cmd != 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2238,13 +2238,13 @@ bool BladeRunnerEngine::loadGame(Common::SeekableReadStream &stream) {
|
||||||
if ((_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && !_cutContent)
|
if ((_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && !_cutContent)
|
||||||
|| (!_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && _cutContent)
|
|| (!_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && _cutContent)
|
||||||
) {
|
) {
|
||||||
Common::String warningMsg;
|
Common::U32String warningMsg;
|
||||||
if (!_cutContent) {
|
if (!_cutContent) {
|
||||||
warningMsg = _("WARNING: This game was saved in Restored Cut Content mode, but you are playing in Original Content mode. The mode will be adjusted to Restored Cut Content for this session until you completely Quit the game.");
|
warningMsg = _("WARNING: This game was saved in Restored Cut Content mode, but you are playing in Original Content mode. The mode will be adjusted to Restored Cut Content for this session until you completely Quit the game.");
|
||||||
} else {
|
} else {
|
||||||
warningMsg = _("WARNING: This game was saved in Original Content mode, but you are playing in Restored Cut Content mode. The mode will be adjusted to Original Content mode for this session until you completely Quit the game.");
|
warningMsg = _("WARNING: This game was saved in Original Content mode, but you are playing in Restored Cut Content mode. The mode will be adjusted to Original Content mode for this session until you completely Quit the game.");
|
||||||
}
|
}
|
||||||
GUI::MessageDialog dialog(warningMsg, _("Continue"), 0);
|
GUI::MessageDialog dialog(warningMsg, _("Continue"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
_cutContent = !_cutContent;
|
_cutContent = !_cutContent;
|
||||||
// force a Key Down event, since we need it to remove the KIA
|
// force a Key Down event, since we need it to remove the KIA
|
||||||
|
|
|
@ -270,7 +270,7 @@ void Subtitles::loadOuttakeSubsText(const Common::String &outtakesName, int fram
|
||||||
* Used for debug purposes mainly.
|
* Used for debug purposes mainly.
|
||||||
*/
|
*/
|
||||||
void Subtitles::setGameSubsText(Common::String dbgQuote, bool forceShowWhenNoSpeech) {
|
void Subtitles::setGameSubsText(Common::String dbgQuote, bool forceShowWhenNoSpeech) {
|
||||||
_currentText = _useUTF8 ? Common::convertUtf8ToUtf32(dbgQuote) : dbgQuote;
|
_currentText = _useUTF8 ? Common::convertUtf8ToUtf32(dbgQuote) : Common::convertToU32String(dbgQuote.c_str());
|
||||||
_forceShowWhenNoSpeech = forceShowWhenNoSpeech; // overrides not showing subtitles when no one is speaking
|
_forceShowWhenNoSpeech = forceShowWhenNoSpeech; // overrides not showing subtitles when no one is speaking
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,10 +225,10 @@ Common::Error CGEEngine::run() {
|
||||||
|
|
||||||
// If game is finished, display ending message
|
// If game is finished, display ending message
|
||||||
if (_flag[3]) {
|
if (_flag[3]) {
|
||||||
Common::String msg = Common::String(_text->getText(kSayTheEnd));
|
Common::U32String msg = Common::U32String(_text->getText(kSayTheEnd));
|
||||||
if (msg.size() != 0) {
|
if (!msg.empty()) {
|
||||||
g_system->delayMillis(10);
|
g_system->delayMillis(10);
|
||||||
GUI::MessageDialog dialog(msg, "OK");
|
GUI::MessageDialog dialog(msg, Common::U32String("OK"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -928,7 +928,7 @@ bool DrasculaEngine::loadDrasculaDat() {
|
||||||
in.open(filename.c_str());
|
in.open(filename.c_str());
|
||||||
|
|
||||||
if (!in.isOpen()) {
|
if (!in.isOpen()) {
|
||||||
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
|
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
warning("%s", errorMessage.c_str());
|
warning("%s", errorMessage.c_str());
|
||||||
|
|
||||||
|
@ -942,7 +942,7 @@ bool DrasculaEngine::loadDrasculaDat() {
|
||||||
buf[8] = '\0';
|
buf[8] = '\0';
|
||||||
|
|
||||||
if (strcmp(buf, "DRASCULA") != 0) {
|
if (strcmp(buf, "DRASCULA") != 0) {
|
||||||
Common::String errorMessage = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
|
Common::String errorMessage = Common::String::format(_("The '%s' engine data file is corrupt.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
warning("%s", errorMessage.c_str());
|
warning("%s", errorMessage.c_str());
|
||||||
|
|
||||||
|
@ -953,7 +953,7 @@ bool DrasculaEngine::loadDrasculaDat() {
|
||||||
|
|
||||||
if (ver != DRASCULA_DAT_VER) {
|
if (ver != DRASCULA_DAT_VER) {
|
||||||
Common::String errorMessage = Common::String::format(
|
Common::String errorMessage = Common::String::format(
|
||||||
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
|
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.").encode().c_str(),
|
||||||
filename.c_str(), DRASCULA_DAT_VER, 0, ver, 0);
|
filename.c_str(), DRASCULA_DAT_VER, 0, ver, 0);
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
warning("%s", errorMessage.c_str());
|
warning("%s", errorMessage.c_str());
|
||||||
|
|
|
@ -2811,7 +2811,7 @@ static int gsc_startup_code(Common::SeekableReadStream *game_stream, int restore
|
||||||
* Display a brief loading game message; here we have to use a timeout
|
* Display a brief loading game message; here we have to use a timeout
|
||||||
* to ensure that the text is flushed to Glk.
|
* to ensure that the text is flushed to Glk.
|
||||||
*/
|
*/
|
||||||
g_vm->glk_put_string(_("Loading game...\n"));
|
g_vm->glk_put_string(_("Loading game...\n").encode().c_str());
|
||||||
if (g_vm->glk_gestalt(gestalt_Timer, 0)) {
|
if (g_vm->glk_gestalt(gestalt_Timer, 0)) {
|
||||||
event_t event;
|
event_t event;
|
||||||
|
|
||||||
|
|
|
@ -593,7 +593,7 @@ bool VM::getWord(Common::String &line) {
|
||||||
_words.push_back(iw);
|
_words.push_back(iw);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Common::String msg = Common::String::format(_("I don't know the word \"%s\".\n"), iw._text.c_str());
|
Common::String msg = Common::String::format(_("I don't know the word \"%s\".\n").encode().c_str(), iw._text.c_str());
|
||||||
print(msg);
|
print(msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ GlkAPI::GlkAPI(OSystem *syst, const GlkGameDescription &gameDesc) :
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlkAPI::glk_exit(void) {
|
void GlkAPI::glk_exit(void) {
|
||||||
glk_put_string(_("[ press any key to exit ]"));
|
glk_put_string(_("[ press any key to exit ]").encode().c_str());
|
||||||
_events->waitForPress();
|
_events->waitForPress();
|
||||||
|
|
||||||
// Trigger a ScumMVM shutdown of game
|
// Trigger a ScumMVM shutdown of game
|
||||||
|
|
|
@ -391,7 +391,7 @@ void Scott::outputNumber(int a) {
|
||||||
|
|
||||||
void Scott::look(void) {
|
void Scott::look(void) {
|
||||||
const char *const ExitNames[6] = {
|
const char *const ExitNames[6] = {
|
||||||
_("North"), _("South"), _("East"), _("West"), _("Up"), _("Down")
|
_("North").encode().c_str(), _("South").encode().c_str(), _("East").encode().c_str(), _("West").encode().c_str(), _("Up").encode().c_str(), _("Down").encode().c_str()
|
||||||
};
|
};
|
||||||
Room *r;
|
Room *r;
|
||||||
int ct, f;
|
int ct, f;
|
||||||
|
@ -403,9 +403,9 @@ void Scott::look(void) {
|
||||||
if ((_bitFlags & (1 << DARKBIT)) && _items[LIGHT_SOURCE]._location != CARRIED
|
if ((_bitFlags & (1 << DARKBIT)) && _items[LIGHT_SOURCE]._location != CARRIED
|
||||||
&& _items[LIGHT_SOURCE]._location != MY_LOC) {
|
&& _items[LIGHT_SOURCE]._location != MY_LOC) {
|
||||||
if (_options & YOUARE)
|
if (_options & YOUARE)
|
||||||
display(_topWindow, _("You can't see. It is too dark!\n"));
|
display(_topWindow, _("You can't see. It is too dark!\n").encode().c_str());
|
||||||
else
|
else
|
||||||
display(_topWindow, _("I can't see. It is too dark!\n"));
|
display(_topWindow, _("I can't see. It is too dark!\n").encode().c_str());
|
||||||
if (_options & TRS80_STYLE)
|
if (_options & TRS80_STYLE)
|
||||||
display(_topWindow, TRS80_LINE);
|
display(_topWindow, TRS80_LINE);
|
||||||
return;
|
return;
|
||||||
|
@ -415,14 +415,14 @@ void Scott::look(void) {
|
||||||
display(_topWindow, "%s\n", r->_text.c_str() + 1);
|
display(_topWindow, "%s\n", r->_text.c_str() + 1);
|
||||||
else {
|
else {
|
||||||
if (_options & YOUARE)
|
if (_options & YOUARE)
|
||||||
display(_topWindow, _("You are in a %s\n"), r->_text.c_str());
|
display(_topWindow, _("You are in a %s\n").encode().c_str(), r->_text.c_str());
|
||||||
else
|
else
|
||||||
display(_topWindow, _("I'm in a %s\n"), r->_text.c_str());
|
display(_topWindow, _("I'm in a %s\n").encode().c_str(), r->_text.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
ct = 0;
|
ct = 0;
|
||||||
f = 0;
|
f = 0;
|
||||||
display(_topWindow, _("\nObvious exits: "));
|
display(_topWindow, _("\nObvious exits: ").encode().c_str());
|
||||||
while (ct < 6) {
|
while (ct < 6) {
|
||||||
if (r->_exits[ct] != 0) {
|
if (r->_exits[ct] != 0) {
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
|
@ -435,7 +435,7 @@ void Scott::look(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
display(_topWindow, _("none"));
|
display(_topWindow, _("none").encode().c_str());
|
||||||
display(_topWindow, ".\n");
|
display(_topWindow, ".\n");
|
||||||
ct = 0;
|
ct = 0;
|
||||||
f = 0;
|
f = 0;
|
||||||
|
@ -444,10 +444,10 @@ void Scott::look(void) {
|
||||||
if (_items[ct]._location == MY_LOC) {
|
if (_items[ct]._location == MY_LOC) {
|
||||||
if (f == 0) {
|
if (f == 0) {
|
||||||
if (_options & YOUARE) {
|
if (_options & YOUARE) {
|
||||||
display(_topWindow, _("\nYou can also see: "));
|
display(_topWindow, _("\nYou can also see: ").encode().c_str());
|
||||||
pos = 18;
|
pos = 18;
|
||||||
} else {
|
} else {
|
||||||
display(_topWindow, _("\nI can also see: "));
|
display(_topWindow, _("\nI can also see: ").encode().c_str());
|
||||||
pos = 16;
|
pos = 16;
|
||||||
}
|
}
|
||||||
f++;
|
f++;
|
||||||
|
|
|
@ -141,7 +141,7 @@ Common::Error ZCode::saveGameState(int slot, const Common::String &desc, bool is
|
||||||
bool success = q.save(*file, this, desc);
|
bool success = q.save(*file, this, desc);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
print_string(_("Error writing save file\n"));
|
print_string(_("Error writing save file\n").encode().c_str());
|
||||||
|
|
||||||
return Common::kNoError;
|
return Common::kNoError;
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ SaveStateList HDBMetaEngine::listSaves(const char *target) const {
|
||||||
if (slotNum < 8)
|
if (slotNum < 8)
|
||||||
desc.setDescription(Common::String::format("Auto: %s", mapName));
|
desc.setDescription(Common::String::format("Auto: %s", mapName));
|
||||||
else
|
else
|
||||||
desc.setDescription(mapName);
|
desc.setDescription(Common::convertToU32String(mapName));
|
||||||
|
|
||||||
saveList.push_back(desc);
|
saveList.push_back(desc);
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ SaveStateDescriptor HDBMetaEngine::querySaveMetaInfos(const char *target, int sl
|
||||||
|
|
||||||
desc.setSaveSlot(slot);
|
desc.setSaveSlot(slot);
|
||||||
desc.setPlayTime(timeSeconds * 1000);
|
desc.setPlayTime(timeSeconds * 1000);
|
||||||
desc.setDescription(mapName);
|
desc.setDescription(Common::convertToU32String(mapName));
|
||||||
|
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,15 +56,15 @@ void TopMenu::init() {
|
||||||
int x = kMenuX;
|
int x = kMenuX;
|
||||||
int y = kMenuY;
|
int y = kMenuY;
|
||||||
|
|
||||||
_whatButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "What is it?", kCmdWhat);
|
_whatButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("What is it?"), kCmdWhat);
|
||||||
_musicButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Music", kCmdMusic);
|
_musicButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Music"), kCmdMusic);
|
||||||
_soundFXButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Sound FX", kCmdSoundFX);
|
_soundFXButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Sound FX"), kCmdSoundFX);
|
||||||
_saveButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Save game", kCmdSave);
|
_saveButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Save game"), kCmdSave);
|
||||||
_loadButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Load game", kCmdLoad);
|
_loadButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Load game"), kCmdLoad);
|
||||||
_recallButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Recall last command", kCmdRecall);
|
_recallButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Recall last command"), kCmdRecall);
|
||||||
_turboButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Turbo", kCmdTurbo);
|
_turboButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Turbo"), kCmdTurbo);
|
||||||
_lookButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Description of the scene", kCmdLook);
|
_lookButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Description of the scene"), kCmdLook);
|
||||||
_inventButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Inventory", kCmdInvent);
|
_inventButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Inventory"), kCmdInvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TopMenu::reflowLayout() {
|
void TopMenu::reflowLayout() {
|
||||||
|
@ -276,14 +276,14 @@ EntryDialog::EntryDialog(const Common::String &title, const Common::String &butt
|
||||||
lines[i], Graphics::kTextAlignCenter);
|
lines[i], Graphics::kTextAlignCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
_text = new GUI::EditTextWidget(this, 10, 10 + lineCount * (kLineHeight + 1), _w - 20, kLineHeight, "", "", 0, kCmdFinishEdit);
|
_text = new GUI::EditTextWidget(this, 10, 10 + lineCount * (kLineHeight + 1), _w - 20, kLineHeight, Common::U32String(""), Common::U32String(""), 0, kCmdFinishEdit);
|
||||||
_text->setEditString(defaultValue);
|
_text->setEditString(defaultValue);
|
||||||
|
|
||||||
_h += kLineHeight + 5;
|
_h += kLineHeight + 5;
|
||||||
|
|
||||||
buttonPos = (_w - buttonWidth) / 2;
|
buttonPos = (_w - buttonWidth) / 2;
|
||||||
|
|
||||||
new GUI::ButtonWidget(this, buttonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, buttonLabel, 0, kCmdButton, Common::ASCII_RETURN); // Confirm dialog
|
new GUI::ButtonWidget(this, buttonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, buttonLabel, Common::U32String(""), kCmdButton, Common::ASCII_RETURN); // Confirm dialog
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ public:
|
||||||
|
|
||||||
void handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) override;
|
void handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) override;
|
||||||
|
|
||||||
const Common::String &getEditString() const { return _text->getEditString(); }
|
const Common::U32String &getEditString() const { return _text->getEditString(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GUI::EditTextWidget *_text;
|
GUI::EditTextWidget *_text;
|
||||||
|
|
|
@ -433,7 +433,7 @@ bool HugoEngine::loadHugoDat() {
|
||||||
in.open(filename.c_str());
|
in.open(filename.c_str());
|
||||||
|
|
||||||
if (!in.isOpen()) {
|
if (!in.isOpen()) {
|
||||||
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
|
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
warning("%s", errorMessage.c_str());
|
warning("%s", errorMessage.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
@ -444,7 +444,7 @@ bool HugoEngine::loadHugoDat() {
|
||||||
in.read(buf, 4);
|
in.read(buf, 4);
|
||||||
|
|
||||||
if (memcmp(buf, "HUGO", 4)) {
|
if (memcmp(buf, "HUGO", 4)) {
|
||||||
Common::String errorMessage = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
|
Common::String errorMessage = Common::String::format(_("The '%s' engine data file is corrupt.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,7 @@ bool HugoEngine::loadHugoDat() {
|
||||||
|
|
||||||
if ((majVer != HUGO_DAT_VER_MAJ) || (minVer != HUGO_DAT_VER_MIN)) {
|
if ((majVer != HUGO_DAT_VER_MAJ) || (minVer != HUGO_DAT_VER_MIN)) {
|
||||||
Common::String errorMessage = Common::String::format(
|
Common::String errorMessage = Common::String::format(
|
||||||
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
|
_("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);
|
filename.c_str(),HUGO_DAT_VER_MAJ, HUGO_DAT_VER_MIN, majVer, minVer);
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -87,10 +87,14 @@ void reverseByte(byte *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void notifyBox(const Common::String &msg) {
|
void notifyBox(const Common::String &msg) {
|
||||||
|
notifyBox(Common::U32String(msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
void notifyBox(const Common::U32String &msg) {
|
||||||
if (msg.empty())
|
if (msg.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GUI::MessageDialog dialog(msg, "OK");
|
GUI::MessageDialog dialog(msg);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,10 +110,14 @@ Common::String promptBox(const Common::String &msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool yesNoBox(const Common::String &msg) {
|
bool yesNoBox(const Common::String &msg) {
|
||||||
|
return yesNoBox(Common::U32String(msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool yesNoBox(const Common::U32String &msg) {
|
||||||
if (msg.empty())
|
if (msg.empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
GUI::MessageDialog dialog(msg, "YES", "NO");
|
GUI::MessageDialog dialog(msg, Common::U32String("YES"), Common::U32String("NO"));
|
||||||
return (dialog.runModal() == GUI::kMessageOK);
|
return (dialog.runModal() == GUI::kMessageOK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,8 @@ void reverseByte(byte *data);
|
||||||
* Show a dialog notifying the user about something, with
|
* Show a dialog notifying the user about something, with
|
||||||
* only a simple "OK" button to dismiss it.
|
* only a simple "OK" button to dismiss it.
|
||||||
*/
|
*/
|
||||||
void notifyBox(const Common::String &msg);
|
void notifyBox(const Common::String &msg); // Redirect to call notifyBox with u32strings
|
||||||
|
void notifyBox(const Common::U32String &msg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a dialog prompting the player to input some text.
|
* Show a dialog prompting the player to input some text.
|
||||||
|
@ -57,7 +58,8 @@ Common::String promptBox(const Common::String &msg);
|
||||||
/**
|
/**
|
||||||
* Show a dialog prompting the player for a "yes"/"no" choice.
|
* Show a dialog prompting the player for a "yes"/"no" choice.
|
||||||
*/
|
*/
|
||||||
bool yesNoBox(const Common::String &msg);
|
bool yesNoBox(const Common::String &msg); // Redirect to call yesNoBox with u32strings
|
||||||
|
bool yesNoBox(const Common::U32String &msg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a string to lower case, in place.
|
* Convert a string to lower case, in place.
|
||||||
|
|
|
@ -697,12 +697,12 @@ MenuActionSaveGame::MenuActionSaveGame(BaseMenuSystem *menuSystem, uint choiceIn
|
||||||
|
|
||||||
void MenuActionSaveGame::execute() {
|
void MenuActionSaveGame::execute() {
|
||||||
GUI::SaveLoadChooser *dialog;
|
GUI::SaveLoadChooser *dialog;
|
||||||
Common::String desc;
|
Common::U32String desc;
|
||||||
int slot;
|
int slot;
|
||||||
|
|
||||||
dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
|
dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
|
||||||
slot = dialog->runModalWithCurrentTarget();
|
slot = dialog->runModalWithCurrentTarget();
|
||||||
desc = dialog->getResultString().c_str();
|
desc = dialog->getResultString().encode().c_str();
|
||||||
|
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
|
||||||
|
|
|
@ -594,7 +594,7 @@ bool EoBCoreEngine::importOriginalSaveFile(int destSlot, const char *sourceFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fs;
|
delete fs;
|
||||||
::GUI::MessageDialog dialog(Common::String::format(_("The following original saved game file has been found in your game path:\n\n%s %s\n\nDo you wish to use this saved game file with ScummVM?\n\n"), temp.c_str(), dsc.c_str()), _("Yes"), _("No"));
|
::GUI::MessageDialog dialog(Common::String::format(_("The following original saved game file has been found in your game path:\n\n%s %s\n\nDo you wish to use this saved game file with ScummVM?\n\n").encode().c_str(), temp.c_str(), dsc.c_str()), _("Yes"), _("No"));
|
||||||
if (dialog.runModal())
|
if (dialog.runModal())
|
||||||
origFiles.push_back(temp);
|
origFiles.push_back(temp);
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ bool EoBCoreEngine::importOriginalSaveFile(int destSlot, const char *sourceFile)
|
||||||
|
|
||||||
if (destSlot != -1) {
|
if (destSlot != -1) {
|
||||||
if (Common::find(_gui->_saveSlots.begin(), _gui->_saveSlots.end(), destSlot) != _gui->_saveSlots.end()) {
|
if (Common::find(_gui->_saveSlots.begin(), _gui->_saveSlots.end(), destSlot) != _gui->_saveSlots.end()) {
|
||||||
::GUI::MessageDialog dialog(Common::String::format(_("A saved game file was found in the specified slot %d. Overwrite?\n\n"), destSlot), _("Yes"), _("No"));
|
::GUI::MessageDialog dialog(Common::String::format(_("A saved game file was found in the specified slot %d. Overwrite?\n\n").encode().c_str(), destSlot), _("Yes"), _("No"));
|
||||||
if (!dialog.runModal())
|
if (!dialog.runModal())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -660,7 +660,7 @@ bool EoBCoreEngine::importOriginalSaveFile(int destSlot, const char *sourceFile)
|
||||||
_inf->reset();
|
_inf->reset();
|
||||||
|
|
||||||
if (destSlot == -1 && importedCount) {
|
if (destSlot == -1 && importedCount) {
|
||||||
::GUI::MessageDialog dialog(Common::String::format(_("%d original saved games have been successfully imported into\nScummVM. If you want to manually import original saved game later you will\nneed to open the ScummVM debug console and use the command 'import_savefile'.\n\n"), importedCount));
|
::GUI::MessageDialog dialog(Common::String::format(_("%d original saved games have been successfully imported into\nScummVM. If you want to manually import original saved game later you will\nneed to open the ScummVM debug console and use the command 'import_savefile'.\n\n").encode().c_str(), importedCount));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ Common::Error LureEngine::init() {
|
||||||
Common::File f;
|
Common::File f;
|
||||||
VersionStructure version;
|
VersionStructure version;
|
||||||
if (!f.open(SUPPORT_FILENAME)) {
|
if (!f.open(SUPPORT_FILENAME)) {
|
||||||
GUIErrorMessageFormat(_("Unable to locate the '%s' engine data file."), SUPPORT_FILENAME);
|
GUIErrorMessageFormat(Common::convertFromU32String(_("Unable to locate the '%s' engine data file.")).c_str(), SUPPORT_FILENAME);
|
||||||
return Common::kUnknownError;
|
return Common::kUnknownError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,10 +70,10 @@ Common::Error LureEngine::init() {
|
||||||
f.close();
|
f.close();
|
||||||
|
|
||||||
if (READ_LE_UINT16(&version.id) != 0xffff) {
|
if (READ_LE_UINT16(&version.id) != 0xffff) {
|
||||||
GUIErrorMessageFormat(_("The '%s' engine data file is corrupt."), SUPPORT_FILENAME);
|
GUIErrorMessageFormat(Common::convertFromU32String(_("The '%s' engine data file is corrupt.")).c_str(), SUPPORT_FILENAME);
|
||||||
return Common::kUnknownError;
|
return Common::kUnknownError;
|
||||||
} else if ((version.vMajor != LURE_DAT_MAJOR) || (version.vMinor != LURE_DAT_MINOR)) {
|
} else if ((version.vMajor != LURE_DAT_MAJOR) || (version.vMinor != LURE_DAT_MINOR)) {
|
||||||
GUIErrorMessageFormat(_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
|
GUIErrorMessageFormat(Common::convertFromU32String(_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.")).c_str(),
|
||||||
SUPPORT_FILENAME, LURE_DAT_MAJOR, LURE_DAT_MINOR,
|
SUPPORT_FILENAME, LURE_DAT_MAJOR, LURE_DAT_MINOR,
|
||||||
version.vMajor, version.vMinor);
|
version.vMajor, version.vMinor);
|
||||||
return Common::kUnknownError;
|
return Common::kUnknownError;
|
||||||
|
|
|
@ -122,16 +122,16 @@ MystOptionsWidget::MystOptionsWidget(GuiObject *boss, const Common::String &name
|
||||||
assert(vm);
|
assert(vm);
|
||||||
|
|
||||||
// I18N: Drop book page
|
// I18N: Drop book page
|
||||||
_dropPageButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.DropPage", _("~D~rop Page"), nullptr, kDropCmd);
|
_dropPageButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.DropPage", _("~D~rop Page"), Common::U32String(""), kDropCmd);
|
||||||
|
|
||||||
// Myst ME only has maps
|
// Myst ME only has maps
|
||||||
if (vm->isGameVariant(GF_ME)) {
|
if (vm->isGameVariant(GF_ME)) {
|
||||||
_showMapButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.ShowMap", _("Show ~M~ap"), nullptr, kMapCmd);
|
_showMapButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.ShowMap", _("Show ~M~ap"), Common::U32String(""), kMapCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Myst demo only has a menu
|
// Myst demo only has a menu
|
||||||
if (vm->isGameVariant(GF_DEMO)) {
|
if (vm->isGameVariant(GF_DEMO)) {
|
||||||
_returnToMenuButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.MainMenu", _("Main Men~u~"), nullptr, kMenuCmd);
|
_returnToMenuButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.MainMenu", _("Main Men~u~"), Common::U32String(""), kMenuCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm->isGameVariant(GF_25TH)) {
|
if (vm->isGameVariant(GF_25TH)) {
|
||||||
|
@ -142,7 +142,7 @@ MystOptionsWidget::MystOptionsWidget(GuiObject *boss, const Common::String &name
|
||||||
|
|
||||||
const MystLanguage *languages = MohawkEngine_Myst::listLanguages();
|
const MystLanguage *languages = MohawkEngine_Myst::listLanguages();
|
||||||
while (languages->language != Common::UNK_LANG) {
|
while (languages->language != Common::UNK_LANG) {
|
||||||
_languagePopUp->appendEntry(Common::getLanguageDescription(languages->language), languages->language);
|
_languagePopUp->appendEntry(Common::convertToU32String(Common::getLanguageDescription(languages->language)), languages->language);
|
||||||
languages++;
|
languages++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ RivenOptionsWidget::RivenOptionsWidget(GuiObject *boss, const Common::String &na
|
||||||
|
|
||||||
const RivenLanguage *languages = MohawkEngine_Riven::listLanguages();
|
const RivenLanguage *languages = MohawkEngine_Riven::listLanguages();
|
||||||
while (languages->language != Common::UNK_LANG) {
|
while (languages->language != Common::UNK_LANG) {
|
||||||
_languagePopUp->appendEntry(Common::getLanguageDescription(languages->language), languages->language);
|
_languagePopUp->appendEntry(Common::convertToU32String(Common::getLanguageDescription(languages->language)), languages->language);
|
||||||
languages++;
|
languages++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,7 +560,7 @@ Common::KeymapArray MohawkEngine_Myst::initKeymaps(const char *target) {
|
||||||
bool is25th = checkGameGUIOption(GAMEOPTION_25TH, guiOptions);
|
bool is25th = checkGameGUIOption(GAMEOPTION_25TH, guiOptions);
|
||||||
bool isDemo = checkGameGUIOption(GAMEOPTION_DEMO, guiOptions);
|
bool isDemo = checkGameGUIOption(GAMEOPTION_DEMO, guiOptions);
|
||||||
|
|
||||||
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "myst", "Myst");
|
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "myst", Common::convertToU32String("Myst"));
|
||||||
|
|
||||||
Action *act;
|
Action *act;
|
||||||
|
|
||||||
|
|
|
@ -366,7 +366,7 @@ void Menu::introMovies_run() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Menu::showConfirmationDialog(const char *message, const char *confirmButton, const char *cancelButton) {
|
bool Menu::showConfirmationDialog(const Common::U32String &message, const Common::U32String &confirmButton, const Common::U32String &cancelButton) {
|
||||||
if (!_inGame) {
|
if (!_inGame) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ private:
|
||||||
int _introStep;
|
int _introStep;
|
||||||
void introMovies_run();
|
void introMovies_run();
|
||||||
|
|
||||||
bool showConfirmationDialog(const char *message, const char *confirmButton, const char *cancelButton);
|
bool showConfirmationDialog(const Common::U32String &message, const Common::U32String &confirmButton, const Common::U32String &cancelButton);
|
||||||
|
|
||||||
void drawButtonImages(const Common::U32String &text, MystAreaImageSwitch *area, Graphics::TextAlign align, uint16 highlightedIndex, uint16 disabledIndex) const;
|
void drawButtonImages(const Common::U32String &text, MystAreaImageSwitch *area, Graphics::TextAlign align, uint16 highlightedIndex, uint16 disabledIndex) const;
|
||||||
void replaceButtonSubImageWithText(const Common::U32String &text, const Graphics::TextAlign &align, MystAreaImageSwitch *area,
|
void replaceButtonSubImageWithText(const Common::U32String &text, const Graphics::TextAlign &align, MystAreaImageSwitch *area,
|
||||||
|
|
|
@ -498,7 +498,7 @@ bool MohawkEngine_Riven::checkDatafiles() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String message = _("You are missing the following required Riven data files:\n") + missingFiles;
|
Common::String message = _("You are missing the following required Riven data files:\n").encode() + missingFiles;
|
||||||
warning("%s", message.c_str());
|
warning("%s", message.c_str());
|
||||||
GUIErrorMessage(message);
|
GUIErrorMessage(message);
|
||||||
|
|
||||||
|
@ -829,7 +829,7 @@ Common::KeymapArray MohawkEngine_Riven::initKeymaps(const char *target) {
|
||||||
bool is25th = checkGameGUIOption(GAMEOPTION_25TH, guiOptions);
|
bool is25th = checkGameGUIOption(GAMEOPTION_25TH, guiOptions);
|
||||||
bool isDemo = checkGameGUIOption(GAMEOPTION_DEMO, guiOptions);
|
bool isDemo = checkGameGUIOption(GAMEOPTION_DEMO, guiOptions);
|
||||||
|
|
||||||
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "riven", "Riven");
|
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "riven", Common::convertToU32String("Riven"));
|
||||||
|
|
||||||
Action *act;
|
Action *act;
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@ void ASpit::xaNewGame(const ArgumentArray &args) {
|
||||||
_vm->_scriptMan->runScript(script, false);
|
_vm->_scriptMan->runScript(script, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ASpit::showConfirmationDialog(const char *message, const char *confirmButton, const char *cancelButton) {
|
bool ASpit::showConfirmationDialog(const Common::U32String &message, const Common::U32String &confirmButton, const Common::U32String &cancelButton) {
|
||||||
if (!_vm->isGameStarted()) {
|
if (!_vm->isGameStarted()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ private:
|
||||||
|
|
||||||
void cathBookDrawPage(uint32 page);
|
void cathBookDrawPage(uint32 page);
|
||||||
|
|
||||||
bool showConfirmationDialog(const char *message, const char *confirmButton, const char *cancelButton);
|
bool showConfirmationDialog(const Common::U32String &message, const Common::U32String &confirmButton, const Common::U32String &cancelButton);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace RivenStacks
|
} // End of namespace RivenStacks
|
||||||
|
|
|
@ -302,7 +302,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
|
||||||
|
|
||||||
// Open the mort.dat file
|
// Open the mort.dat file
|
||||||
if (!f.open(MORT_DAT)) {
|
if (!f.open(MORT_DAT)) {
|
||||||
GUIErrorMessageFormat(_("Unable to locate the '%s' engine data file."), MORT_DAT);
|
GUIErrorMessageFormat(_("Unable to locate the '%s' engine data file.").encode().c_str(), MORT_DAT);
|
||||||
return Common::kReadingFailed;
|
return Common::kReadingFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
|
||||||
char fileId[4];
|
char fileId[4];
|
||||||
f.read(fileId, 4);
|
f.read(fileId, 4);
|
||||||
if (strncmp(fileId, "MORT", 4) != 0) {
|
if (strncmp(fileId, "MORT", 4) != 0) {
|
||||||
GUIErrorMessageFormat(_("The '%s' engine data file is corrupt."), MORT_DAT);
|
GUIErrorMessageFormat(_("The '%s' engine data file is corrupt.").encode().c_str(), MORT_DAT);
|
||||||
return Common::kReadingFailed;
|
return Common::kReadingFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
|
||||||
|
|
||||||
if (majVer < MORT_DAT_REQUIRED_VERSION) {
|
if (majVer < MORT_DAT_REQUIRED_VERSION) {
|
||||||
GUIErrorMessageFormat(
|
GUIErrorMessageFormat(
|
||||||
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
|
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.").encode().c_str(),
|
||||||
MORT_DAT, MORT_DAT_REQUIRED_VERSION, 0, majVer, minVer);
|
MORT_DAT, MORT_DAT_REQUIRED_VERSION, 0, majVer, minVer);
|
||||||
return Common::kReadingFailed;
|
return Common::kReadingFailed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
namespace MutationOfJB {
|
namespace MutationOfJB {
|
||||||
|
|
||||||
void reportFileMissingError(const char *fileName) {
|
void reportFileMissingError(const char *fileName) {
|
||||||
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file"), fileName);
|
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file").encode().c_str(), fileName);
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
warning("%s", errorMessage.c_str());
|
warning("%s", errorMessage.c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ void SaveLoad_ns::doLoadGame(uint16 slot) {
|
||||||
void SaveLoad_ns::doSaveGame(uint16 slot, const char* name) {
|
void SaveLoad_ns::doSaveGame(uint16 slot, const char* name) {
|
||||||
Common::OutSaveFile *f = getOutSaveFile(slot);
|
Common::OutSaveFile *f = getOutSaveFile(slot);
|
||||||
if (f == 0) {
|
if (f == 0) {
|
||||||
Common::String buf = Common::String::format(_("Can't save game in slot %i\n\n"), slot);
|
Common::String buf = Common::String::format(_("Can't save game in slot %i\n\n").encode().c_str(), slot);
|
||||||
GUI::MessageDialog dialog(buf);
|
GUI::MessageDialog dialog(buf);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -384,7 +384,7 @@ Common::Error PegasusEngine::showSaveDialog() {
|
||||||
void PegasusEngine::showSaveFailedDialog(const Common::Error &status) {
|
void PegasusEngine::showSaveFailedDialog(const Common::Error &status) {
|
||||||
Common::String failMessage = Common::String::format(_("Failed to save game (%s)! "
|
Common::String failMessage = Common::String::format(_("Failed to save game (%s)! "
|
||||||
"Please consult the README for basic information, and for "
|
"Please consult the README for basic information, and for "
|
||||||
"instructions on how to obtain further assistance."), status.getDesc().c_str());
|
"instructions on how to obtain further assistance.").encode().c_str(), status.getDesc().c_str());
|
||||||
GUI::MessageDialog dialog(failMessage);
|
GUI::MessageDialog dialog(failMessage);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
|
@ -2476,7 +2476,7 @@ uint PegasusEngine::getNeighborhoodCD(const NeighborhoodID neighborhood) const {
|
||||||
Common::KeymapArray PegasusEngine::initKeymaps() {
|
Common::KeymapArray PegasusEngine::initKeymaps() {
|
||||||
using namespace Common;
|
using namespace Common;
|
||||||
|
|
||||||
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "pegasus", "Pegasus Prime");
|
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "pegasus", Common::convertToU32String("Pegasus Prime"));
|
||||||
|
|
||||||
Action *act;
|
Action *act;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,10 @@ SaveStateDescriptor::SaveStateDescriptor(int s, const Common::U32String &d)
|
||||||
_thumbnail(), _saveType(kSaveTypeUndetermined) {
|
_thumbnail(), _saveType(kSaveTypeUndetermined) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SaveStateDescriptor::SaveStateDescriptor(int s, const Common::String &d) {
|
||||||
|
SaveStateDescriptor(s, Common::U32String(d));
|
||||||
|
}
|
||||||
|
|
||||||
void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
|
void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
|
||||||
if (_thumbnail.get() == t)
|
if (_thumbnail.get() == t)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -53,6 +53,7 @@ private:
|
||||||
public:
|
public:
|
||||||
SaveStateDescriptor();
|
SaveStateDescriptor();
|
||||||
SaveStateDescriptor(int s, const Common::U32String &d);
|
SaveStateDescriptor(int s, const Common::U32String &d);
|
||||||
|
SaveStateDescriptor(int s, const Common::String &d);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param slot The saveslot id, as it would be passed to the "-x" command line switch.
|
* @param slot The saveslot id, as it would be passed to the "-x" command line switch.
|
||||||
|
|
|
@ -1017,7 +1017,7 @@ SaveStateDescriptor SciMetaEngine::querySaveMetaInfos(const char *target, int sl
|
||||||
// invalid
|
// invalid
|
||||||
delete in;
|
delete in;
|
||||||
|
|
||||||
descriptor.setDescription("*Invalid*");
|
descriptor.setDescription(Common::convertToU32String("*Invalid*"));
|
||||||
return descriptor;
|
return descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1028,7 +1028,7 @@ SaveStateDescriptor SciMetaEngine::querySaveMetaInfos(const char *target, int sl
|
||||||
// invalid
|
// invalid
|
||||||
delete in;
|
delete in;
|
||||||
|
|
||||||
descriptor.setDescription("*Invalid*");
|
descriptor.setDescription(Common::convertToU32String("*Invalid*"));
|
||||||
return descriptor;
|
return descriptor;
|
||||||
}
|
}
|
||||||
descriptor.setThumbnail(thumbnail);
|
descriptor.setThumbnail(thumbnail);
|
||||||
|
|
|
@ -672,7 +672,7 @@ reg_t GuestAdditions::promptSaveRestoreRama(EngineState *s, int argc, reg_t *arg
|
||||||
int GuestAdditions::runSaveRestore(const bool isSave, reg_t outDescription, const int forcedSaveId) const {
|
int GuestAdditions::runSaveRestore(const bool isSave, reg_t outDescription, const int forcedSaveId) const {
|
||||||
assert(!(isSave && outDescription.isNull()));
|
assert(!(isSave && outDescription.isNull()));
|
||||||
|
|
||||||
Common::String descriptionString;
|
Common::U32String descriptionString;
|
||||||
int saveId = runSaveRestore(isSave, descriptionString, forcedSaveId);
|
int saveId = runSaveRestore(isSave, descriptionString, forcedSaveId);
|
||||||
|
|
||||||
if (!outDescription.isNull()) {
|
if (!outDescription.isNull()) {
|
||||||
|
@ -686,14 +686,14 @@ int GuestAdditions::runSaveRestore(const bool isSave, reg_t outDescription, cons
|
||||||
return saveId;
|
return saveId;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GuestAdditions::runSaveRestore(const bool isSave, Common::String &outDescription, const int forcedSaveId) const {
|
int GuestAdditions::runSaveRestore(const bool isSave, Common::U32String &outDescription, const int forcedSaveId) const {
|
||||||
int saveId;
|
int saveId;
|
||||||
|
|
||||||
if (!isSave && forcedSaveId != -1) {
|
if (!isSave && forcedSaveId != -1) {
|
||||||
saveId = forcedSaveId;
|
saveId = forcedSaveId;
|
||||||
} else {
|
} else {
|
||||||
const char *title;
|
Common::U32String title;
|
||||||
const char *action;
|
Common::U32String action;
|
||||||
if (isSave) {
|
if (isSave) {
|
||||||
title = _("Save game:");
|
title = _("Save game:");
|
||||||
action = _("Save");
|
action = _("Save");
|
||||||
|
|
|
@ -271,7 +271,7 @@ public:
|
||||||
* id to this value.
|
* id to this value.
|
||||||
*/
|
*/
|
||||||
int runSaveRestore(const bool isSave, const reg_t outDescription, const int forcedSaveId = -1) const;
|
int runSaveRestore(const bool isSave, const reg_t outDescription, const int forcedSaveId = -1) const;
|
||||||
int runSaveRestore(const bool isSave, Common::String &outDescription, const int forcedSaveId = -1) const;
|
int runSaveRestore(const bool isSave, Common::U32String &outDescription, const int forcedSaveId = -1) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
|
@ -70,7 +70,7 @@ static int16 adjustGraphColor(int16 color) {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
int showScummVMDialog(const Common::String &message, const char *altButton = nullptr, bool alignCenter = true) {
|
int showScummVMDialog(const Common::U32String &message, Common::U32String altButton = Common::U32String(""), bool alignCenter = true) {
|
||||||
Graphics::TextAlign alignment = alignCenter ? Graphics::kTextAlignCenter : Graphics::kTextAlignLeft;
|
Graphics::TextAlign alignment = alignCenter ? Graphics::kTextAlignCenter : Graphics::kTextAlignLeft;
|
||||||
GUI::MessageDialog dialog(message, _("OK"), altButton, alignment);
|
GUI::MessageDialog dialog(message, _("OK"), altButton, alignment);
|
||||||
return dialog.runModal();
|
return dialog.runModal();
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
namespace Sci {
|
namespace Sci {
|
||||||
#ifdef ENABLE_SCI32
|
#ifdef ENABLE_SCI32
|
||||||
|
|
||||||
extern int showScummVMDialog(const Common::String& message, const char* altButton = nullptr, bool alignCenter = true);
|
extern int showScummVMDialog(const Common::U32String& message, Common::U32String altButton = Common::U32String(""), bool alignCenter = true);
|
||||||
|
|
||||||
reg_t kBaseSetter32(EngineState *s, int argc, reg_t *argv) {
|
reg_t kBaseSetter32(EngineState *s, int argc, reg_t *argv) {
|
||||||
reg_t object = argv[0];
|
reg_t object = argv[0];
|
||||||
|
@ -355,7 +355,7 @@ reg_t kWinHelp(EngineState *s, int argc, reg_t *argv) {
|
||||||
case 1:
|
case 1:
|
||||||
// Load a help file
|
// Load a help file
|
||||||
// Maybe in the future we can implement this, but for now this message should suffice
|
// Maybe in the future we can implement this, but for now this message should suffice
|
||||||
showScummVMDialog(Common::String::format(_("Please use an external viewer to open the game's help file: %s"), s->_segMan->getString(argv[1]).c_str()));
|
showScummVMDialog(Common::String::format(_("Please use an external viewer to open the game's help file: %s").encode().c_str(), s->_segMan->getString(argv[1]).c_str()));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// Looks like some init function
|
// Looks like some init function
|
||||||
|
|
|
@ -795,7 +795,7 @@ reg_t kPlatform(EngineState *s, int argc, reg_t *argv) {
|
||||||
return NULL_REG;
|
return NULL_REG;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int showScummVMDialog(const Common::String& message, const char* altButton = nullptr, bool alignCenter = true);
|
extern int showScummVMDialog(const Common::U32String& message, Common::U32String altButton = Common::U32String(""), bool alignCenter = true);
|
||||||
|
|
||||||
#ifdef ENABLE_SCI32
|
#ifdef ENABLE_SCI32
|
||||||
reg_t kPlatform32(EngineState *s, int argc, reg_t *argv) {
|
reg_t kPlatform32(EngineState *s, int argc, reg_t *argv) {
|
||||||
|
@ -870,7 +870,7 @@ reg_t kWinDLL(EngineState *s, int argc, reg_t *argv) {
|
||||||
switch (operation) {
|
switch (operation) {
|
||||||
case 0: // load DLL
|
case 0: // load DLL
|
||||||
if (dllName == "PENGIN16.DLL")
|
if (dllName == "PENGIN16.DLL")
|
||||||
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");
|
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"));
|
||||||
|
|
||||||
// This is originally a call to LoadLibrary() and to the Watcom function GetIndirectFunctionHandle
|
// 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()
|
return make_reg(0, 1000); // fake ID for loaded DLL, normally returned from Windows LoadLibrary()
|
||||||
|
|
|
@ -1239,7 +1239,7 @@ bool gamestate_save(EngineState *s, Common::WriteStream *fh, const Common::Strin
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int showScummVMDialog(const Common::String& message, const char* altButton = nullptr, bool alignCenter = true);
|
extern int showScummVMDialog(const Common::U32String& message, Common::U32String altButton = Common::U32String(""), bool alignCenter = true);
|
||||||
|
|
||||||
void gamestate_afterRestoreFixUp(EngineState *s, int savegameId) {
|
void gamestate_afterRestoreFixUp(EngineState *s, int savegameId) {
|
||||||
switch (g_sci->getGameId()) {
|
switch (g_sci->getGameId()) {
|
||||||
|
@ -1406,7 +1406,7 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
|
||||||
if (meta.version < MINIMUM_SAVEGAME_VERSION) {
|
if (meta.version < MINIMUM_SAVEGAME_VERSION) {
|
||||||
showScummVMDialog(_("The format of this saved game is obsolete, unable to load it"));
|
showScummVMDialog(_("The format of this saved game is obsolete, unable to load it"));
|
||||||
} else {
|
} else {
|
||||||
Common::String msg = Common::String::format(_("Savegame version is %d, maximum supported is %0d"), meta.version, CURRENT_SAVEGAME_VERSION);
|
Common::U32String msg = Common::String::format(_("Savegame version is %d, maximum supported is %0d").encode().c_str(), meta.version, CURRENT_SAVEGAME_VERSION);
|
||||||
showScummVMDialog(msg);
|
showScummVMDialog(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ public:
|
||||||
|
|
||||||
// see kmisc.cpp / kMacPlatform32
|
// see kmisc.cpp / kMacPlatform32
|
||||||
int _kq7MacSaveGameId; // the saved game id to use when saving (might not exist yet)
|
int _kq7MacSaveGameId; // the saved game id to use when saving (might not exist yet)
|
||||||
Common::String _kq7MacSaveGameDescription; // description to use when saving game
|
Common::U32String _kq7MacSaveGameDescription; // description to use when saving game
|
||||||
|
|
||||||
uint _chosenQfGImportItem; // Remembers the item selected in QfG import rooms
|
uint _chosenQfGImportItem; // Remembers the item selected in QfG import rooms
|
||||||
|
|
||||||
|
|
|
@ -907,7 +907,7 @@ void GfxControls32::destroyScrollWindow(const reg_t id) {
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Message box
|
#pragma mark Message box
|
||||||
|
|
||||||
int16 GfxControls32::showMessageBox(const Common::String &message, const char *const okLabel, const char *const altLabel, const int16 okValue, const int16 altValue) {
|
int16 GfxControls32::showMessageBox(const Common::U32String &message, const Common::U32String &okLabel, const Common::U32String &altLabel, const int16 okValue, const int16 altValue) {
|
||||||
GUI::MessageDialog dialog(message, okLabel, altLabel);
|
GUI::MessageDialog dialog(message, okLabel, altLabel);
|
||||||
return (dialog.runModal() == GUI::kMessageOK) ? okValue : altValue;
|
return (dialog.runModal() == GUI::kMessageOK) ? okValue : altValue;
|
||||||
}
|
}
|
||||||
|
@ -922,7 +922,7 @@ reg_t GfxControls32::kernelMessageBox(const Common::String &message, const Commo
|
||||||
|
|
||||||
switch (style & 0xF) {
|
switch (style & 0xF) {
|
||||||
case kMessageBoxOK:
|
case kMessageBoxOK:
|
||||||
result = showMessageBox(message, _("OK"), NULL, 1, 1);
|
result = showMessageBox(message, _("OK"), Common::U32String(""), 1, 1);
|
||||||
break;
|
break;
|
||||||
case kMessageBoxYesNo:
|
case kMessageBoxYesNo:
|
||||||
result = showMessageBox(message, _("Yes"), _("No"), 6, 7);
|
result = showMessageBox(message, _("Yes"), _("No"), 6, 7);
|
||||||
|
|
|
@ -481,7 +481,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* Convenience function for creating and showing a message box.
|
* Convenience function for creating and showing a message box.
|
||||||
*/
|
*/
|
||||||
int16 showMessageBox(const Common::String &message, const char *const okLabel, const char *const altLabel, const int16 okValue, const int16 altValue);
|
int16 showMessageBox(const Common::U32String &message, const Common::U32String &okLabel, const Common::U32String &altLabel, const int16 okValue, const int16 altValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Sci
|
} // End of namespace Sci
|
||||||
|
|
|
@ -65,8 +65,8 @@ bool VideoPlayer::open(const Common::String &fileName) {
|
||||||
// KQ7 2.00b videos are compressed in 24bpp Cinepak, so cannot play on a
|
// KQ7 2.00b videos are compressed in 24bpp Cinepak, so cannot play on a
|
||||||
// system with no RGB support
|
// system with no RGB support
|
||||||
if (_decoder->getPixelFormat().bytesPerPixel != 1) {
|
if (_decoder->getPixelFormat().bytesPerPixel != 1) {
|
||||||
void showScummVMDialog(const Common::String &message, const char* altButton = nullptr, bool alignCenter = true);
|
void showScummVMDialog(const Common::U32String &message, Common::U32String altButton = Common::U32String(""), bool alignCenter = true);
|
||||||
showScummVMDialog(Common::String::format(_("Cannot play back %dbpp video on a system with maximum color depth of 8bpp"), _decoder->getPixelFormat().bpp()));
|
showScummVMDialog(Common::String::format(_("Cannot play back %dbpp video on a system with maximum color depth of 8bpp").encode().c_str(), _decoder->getPixelFormat().bpp()));
|
||||||
_decoder->close();
|
_decoder->close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -813,7 +813,7 @@ void ResourceManager::addScriptChunkSources() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int showScummVMDialog(const Common::String& message, const char* altButton = nullptr, bool alignCenter = true);
|
extern int showScummVMDialog(const Common::U32String& message, Common::U32String altButton = Common::U32String(""), bool alignCenter = true);
|
||||||
|
|
||||||
void ResourceManager::scanNewSources() {
|
void ResourceManager::scanNewSources() {
|
||||||
_hasBadResources = false;
|
_hasBadResources = false;
|
||||||
|
|
|
@ -256,7 +256,7 @@ SciEngine::~SciEngine() {
|
||||||
g_sci = 0;
|
g_sci = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int showScummVMDialog(const Common::String& message, const char* altButton = nullptr, bool alignCenter = true);
|
extern int showScummVMDialog(const Common::U32String& message, Common::U32String altButton = Common::U32String(""), bool alignCenter = true);
|
||||||
|
|
||||||
Common::Error SciEngine::run() {
|
Common::Error SciEngine::run() {
|
||||||
_resMan = new ResourceManager();
|
_resMan = new ResourceManager();
|
||||||
|
@ -511,15 +511,15 @@ bool SciEngine::gameHasFanMadePatch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SciEngine::suggestDownloadGK2SubTitlesPatch() {
|
void SciEngine::suggestDownloadGK2SubTitlesPatch() {
|
||||||
const char* altButton;
|
Common::U32String altButton;
|
||||||
Common::String downloadMessage;
|
Common::U32String downloadMessage;
|
||||||
|
|
||||||
if (g_system->hasFeature(OSystem::kFeatureOpenUrl)) {
|
if (g_system->hasFeature(OSystem::kFeatureOpenUrl)) {
|
||||||
altButton = _("Download patch");
|
altButton = _("Download patch");
|
||||||
downloadMessage = _("(or click 'Download patch' button. But note - it only downloads, you will have to continue from there)\n");
|
downloadMessage = _("(or click 'Download patch' button. But note - it only downloads, you will have to continue from there)\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
altButton = nullptr;
|
altButton = "";
|
||||||
downloadMessage = "";
|
downloadMessage = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,10 +157,10 @@ void SciMusic::init() {
|
||||||
} else {
|
} else {
|
||||||
const char *missingFiles = _pMidiDrv->reportMissingFiles();
|
const char *missingFiles = _pMidiDrv->reportMissingFiles();
|
||||||
if (missingFiles) {
|
if (missingFiles) {
|
||||||
Common::String message = _(
|
Common::U32String message = _(
|
||||||
"The selected audio driver requires the following file(s):\n\n"
|
"The selected audio driver requires the following file(s):\n\n"
|
||||||
);
|
);
|
||||||
message += missingFiles;
|
message += Common::convertToU32String(missingFiles);
|
||||||
message += _("\n\n"
|
message += _("\n\n"
|
||||||
"Some audio drivers (at least for some games) were made\n"
|
"Some audio drivers (at least for some games) were made\n"
|
||||||
"available by Sierra as aftermarket patches and thus might not\n"
|
"available by Sierra as aftermarket patches and thus might not\n"
|
||||||
|
@ -170,7 +170,7 @@ void SciMusic::init() {
|
||||||
"separately but only as content of (patched) resource bundles.\n"
|
"separately but only as content of (patched) resource bundles.\n"
|
||||||
"In that case you may need to apply the original Sierra patch.\n\n"
|
"In that case you may need to apply the original Sierra patch.\n\n"
|
||||||
);
|
);
|
||||||
::GUI::displayErrorDialog(message.c_str());
|
::GUI::displayErrorDialog(message);
|
||||||
}
|
}
|
||||||
error("Failed to initialize sound driver");
|
error("Failed to initialize sound driver");
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "common/events.h"
|
#include "common/events.h"
|
||||||
#include "common/localization.h"
|
#include "common/localization.h"
|
||||||
#include "common/translation.h"
|
#include "common/translation.h"
|
||||||
|
#include "common/ustr.h"
|
||||||
|
|
||||||
#include "graphics/scaler.h"
|
#include "graphics/scaler.h"
|
||||||
|
|
||||||
|
@ -269,7 +270,7 @@ enum {
|
||||||
|
|
||||||
HelpDialog::HelpDialog(const GameSettings &game)
|
HelpDialog::HelpDialog(const GameSettings &game)
|
||||||
: ScummDialog("ScummHelp"), _game(game) {
|
: ScummDialog("ScummHelp"), _game(game) {
|
||||||
_title = new GUI::StaticTextWidget(this, "ScummHelp.Title", "");
|
_title = new GUI::StaticTextWidget(this, "ScummHelp.Title", Common::U32String(""));
|
||||||
|
|
||||||
_page = 1;
|
_page = 1;
|
||||||
_backgroundType = GUI::ThemeEngine::kDialogBackgroundDefault;
|
_backgroundType = GUI::ThemeEngine::kDialogBackgroundDefault;
|
||||||
|
@ -277,10 +278,10 @@ HelpDialog::HelpDialog(const GameSettings &game)
|
||||||
_numPages = ScummHelp::numPages(_game.id);
|
_numPages = ScummHelp::numPages(_game.id);
|
||||||
|
|
||||||
// I18N: Previous page button
|
// I18N: Previous page button
|
||||||
_prevButton = new GUI::ButtonWidget(this, "ScummHelp.Prev", _("~P~revious"), 0, kPrevCmd);
|
_prevButton = new GUI::ButtonWidget(this, "ScummHelp.Prev", _("~P~revious"), Common::U32String(""), kPrevCmd);
|
||||||
// I18N: Next page button
|
// I18N: Next page button
|
||||||
_nextButton = new GUI::ButtonWidget(this, "ScummHelp.Next", _("~N~ext"), 0, kNextCmd);
|
_nextButton = new GUI::ButtonWidget(this, "ScummHelp.Next", _("~N~ext"), Common::U32String(""), kNextCmd);
|
||||||
new GUI::ButtonWidget(this, "ScummHelp.Close", _("~C~lose"), 0, GUI::kCloseCmd);
|
new GUI::ButtonWidget(this, "ScummHelp.Close", _("~C~lose"), Common::U32String(""), GUI::kCloseCmd);
|
||||||
_prevButton->clearFlags(WIDGET_ENABLED);
|
_prevButton->clearFlags(WIDGET_ENABLED);
|
||||||
|
|
||||||
GUI::ContainerWidget *placeHolder = new GUI::ContainerWidget(this, "ScummHelp.HelpText");
|
GUI::ContainerWidget *placeHolder = new GUI::ContainerWidget(this, "ScummHelp.HelpText");
|
||||||
|
@ -290,8 +291,8 @@ HelpDialog::HelpDialog(const GameSettings &game)
|
||||||
|
|
||||||
// Dummy entries
|
// Dummy entries
|
||||||
for (int i = 0; i < HELP_NUM_LINES; i++) {
|
for (int i = 0; i < HELP_NUM_LINES; i++) {
|
||||||
_key[i] = new GUI::StaticTextWidget(this, 0, 0, 10, 10, "", Graphics::kTextAlignRight);
|
_key[i] = new GUI::StaticTextWidget(this, 0, 0, 10, 10, Common::U32String(""), Graphics::kTextAlignRight);
|
||||||
_dsc[i] = new GUI::StaticTextWidget(this, 0, 0, 10, 10, "", Graphics::kTextAlignLeft);
|
_dsc[i] = new GUI::StaticTextWidget(this, 0, 0, 10, 10, Common::U32String(""), Graphics::kTextAlignLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -388,7 +389,7 @@ InfoDialog::InfoDialog(ScummEngine *scumm, int res)
|
||||||
_text = new GUI::StaticTextWidget(this, 0, 0, 10, 10, _message, kTextAlignCenter);
|
_text = new GUI::StaticTextWidget(this, 0, 0, 10, 10, _message, kTextAlignCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
|
InfoDialog::InfoDialog(ScummEngine *scumm, const U32String& message)
|
||||||
: ScummDialog(0, 0, 0, 0), _vm(scumm) { // dummy x and w
|
: ScummDialog(0, 0, 0, 0), _vm(scumm) { // dummy x and w
|
||||||
|
|
||||||
_message = message;
|
_message = message;
|
||||||
|
@ -397,7 +398,7 @@ InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
|
||||||
_text = new GUI::StaticTextWidget(this, 0, 0, 10, 10, _message, kTextAlignCenter);
|
_text = new GUI::StaticTextWidget(this, 0, 0, 10, 10, _message, kTextAlignCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoDialog::setInfoText(const String& message) {
|
void InfoDialog::setInfoText(const U32String& message) {
|
||||||
_message = message;
|
_message = message;
|
||||||
_text->setLabel(_message);
|
_text->setLabel(_message);
|
||||||
//reflowLayout(); // FIXME: Should we call this here? Depends on the usage patterns, I guess...
|
//reflowLayout(); // FIXME: Should we call this here? Depends on the usage patterns, I guess...
|
||||||
|
@ -476,8 +477,8 @@ void PauseDialog::handleKeyDown(Common::KeyState state) {
|
||||||
ConfirmDialog::ConfirmDialog(ScummEngine *scumm, int res)
|
ConfirmDialog::ConfirmDialog(ScummEngine *scumm, int res)
|
||||||
: InfoDialog(scumm, res), _yesKey('y'), _noKey('n') {
|
: InfoDialog(scumm, res), _yesKey('y'), _noKey('n') {
|
||||||
|
|
||||||
if (_message.lastChar() != ')') {
|
if (_message.encode().lastChar() != ')') {
|
||||||
_yesKey = _message.lastChar();
|
_yesKey = _message.encode().lastChar();
|
||||||
_message.deleteLastChar();
|
_message.deleteLastChar();
|
||||||
|
|
||||||
if (_yesKey >= 'A' && _yesKey <= 'Z')
|
if (_yesKey >= 'A' && _yesKey <= 'Z')
|
||||||
|
@ -566,7 +567,7 @@ void ValueDisplayDialog::open() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value)
|
SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value)
|
||||||
: InfoDialog(scumm, ""), _value(value), _timer(0) {
|
: InfoDialog(scumm, U32String("")), _value(value), _timer(0) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,7 +606,7 @@ void SubtitleSettingsDialog::cycleValue() {
|
||||||
_value = 0;
|
_value = 0;
|
||||||
|
|
||||||
if (_value == 1 && g_system->getOverlayWidth() <= 320)
|
if (_value == 1 && g_system->getOverlayWidth() <= 320)
|
||||||
setInfoText(_sc("Speech & Subs", "lowres"));
|
setInfoText(Common::convertToU32String(_sc("Speech & Subs", "lowres")));
|
||||||
else
|
else
|
||||||
setInfoText(_(subtitleDesc[_value]));
|
setInfoText(_(subtitleDesc[_value]));
|
||||||
|
|
||||||
|
@ -613,7 +614,7 @@ void SubtitleSettingsDialog::cycleValue() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)
|
Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)
|
||||||
: InfoDialog(scumm, text) {
|
: InfoDialog(scumm, U32String(text)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Indy3IQPointsDialog::handleKeyDown(Common::KeyState state) {
|
void Indy3IQPointsDialog::handleKeyDown(Common::KeyState state) {
|
||||||
|
@ -624,7 +625,7 @@ void Indy3IQPointsDialog::handleKeyDown(Common::KeyState state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugInputDialog::DebugInputDialog(ScummEngine *scumm, char* text)
|
DebugInputDialog::DebugInputDialog(ScummEngine *scumm, char* text)
|
||||||
: InfoDialog(scumm, text) {
|
: InfoDialog(scumm, U32String(text)) {
|
||||||
mainText = text;
|
mainText = text;
|
||||||
done = 0;
|
done = 0;
|
||||||
}
|
}
|
||||||
|
@ -656,9 +657,9 @@ LoomTownsDifficultyDialog::LoomTownsDifficultyDialog()
|
||||||
GUI::StaticTextWidget *text2 = new GUI::StaticTextWidget(this, "LoomTownsDifficultyDialog.Description2", _("Refer to your Loom(TM) manual for help."));
|
GUI::StaticTextWidget *text2 = new GUI::StaticTextWidget(this, "LoomTownsDifficultyDialog.Description2", _("Refer to your Loom(TM) manual for help."));
|
||||||
text2->setAlign(Graphics::kTextAlignCenter);
|
text2->setAlign(Graphics::kTextAlignCenter);
|
||||||
|
|
||||||
new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Standard", _("Standard"), 0, kStandardCmd);
|
new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Standard", _("Standard"), Common::U32String(""), kStandardCmd);
|
||||||
new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Practice", _("Practice"), 0, kPracticeCmd);
|
new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Practice", _("Practice"), Common::U32String(""), kPracticeCmd);
|
||||||
new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Expert", _("Expert"), 0, kExpertCmd);
|
new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Expert", _("Expert"), Common::U32String(""), kExpertCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoomTownsDifficultyDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
|
void LoomTownsDifficultyDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
|
||||||
|
|
|
@ -45,6 +45,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef Common::String String;
|
typedef Common::String String;
|
||||||
|
typedef Common::U32String U32String;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef DISABLE_HELP
|
#ifndef DISABLE_HELP
|
||||||
|
@ -68,16 +69,16 @@ protected:
|
||||||
class InfoDialog : public ScummDialog {
|
class InfoDialog : public ScummDialog {
|
||||||
protected:
|
protected:
|
||||||
ScummEngine *_vm;
|
ScummEngine *_vm;
|
||||||
String _message;
|
U32String _message;
|
||||||
GUI::StaticTextWidget *_text;
|
GUI::StaticTextWidget *_text;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// arbitrary message
|
// arbitrary message
|
||||||
InfoDialog(ScummEngine *scumm, const String& message);
|
InfoDialog(ScummEngine *scumm, const U32String& message);
|
||||||
// from resources
|
// from resources
|
||||||
InfoDialog(ScummEngine *scumm, int res);
|
InfoDialog(ScummEngine *scumm, int res);
|
||||||
|
|
||||||
void setInfoText(const String& message);
|
void setInfoText(const U32String& message);
|
||||||
|
|
||||||
void handleMouseDown(int x, int y, int button, int clickCount) override {
|
void handleMouseDown(int x, int y, int button, int clickCount) override {
|
||||||
setResult(0);
|
setResult(0);
|
||||||
|
|
|
@ -82,9 +82,9 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo
|
||||||
#ifdef MACOSX
|
#ifdef MACOSX
|
||||||
ADD_BIND("Cmd q", _("Quit"));
|
ADD_BIND("Cmd q", _("Quit"));
|
||||||
#else
|
#else
|
||||||
ADD_BIND(String(_("Alt")) + " x, " + _("Ctrl") + " z", _("Quit"));
|
ADD_BIND(String(_("Alt")) + " x, " + _("Ctrl").encode() + " z", _("Quit").encode());
|
||||||
#endif
|
#endif
|
||||||
ADD_BIND(String(_("Alt")) + " " + _("Enter"), _("Toggle fullscreen"));
|
ADD_BIND(String(_("Alt")) + " " + _("Enter").encode(), _("Toggle fullscreen"));
|
||||||
ADD_BIND("[, ]", _("Music volume up / down"));
|
ADD_BIND("[, ]", _("Music volume up / down"));
|
||||||
ADD_BIND("-, +", _("Text speed slower / faster"));
|
ADD_BIND("-, +", _("Text speed slower / faster"));
|
||||||
ADD_BIND(_("Enter"), _("Simulate left mouse button"));
|
ADD_BIND(_("Enter"), _("Simulate left mouse button"));
|
||||||
|
@ -98,9 +98,9 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo
|
||||||
ADD_BIND(String(_("Ctrl")) + " f", _("Run in fast mode (*)"));
|
ADD_BIND(String(_("Ctrl")) + " f", _("Run in fast mode (*)"));
|
||||||
ADD_BIND(String(_("Ctrl")) + " g", _("Run in really fast mode (*)"));
|
ADD_BIND(String(_("Ctrl")) + " g", _("Run in really fast mode (*)"));
|
||||||
ADD_BIND(String(_("Ctrl")) + " m", _("Toggle mouse capture"));
|
ADD_BIND(String(_("Ctrl")) + " m", _("Toggle mouse capture"));
|
||||||
ADD_BIND(String(_("Ctrl")) + " " + _("Alt") + " 1-8", _("Switch between graphics filters"));
|
ADD_BIND(String(_("Ctrl")) + " " + _("Alt").encode() + " 1-8", _("Switch between graphics filters"));
|
||||||
ADD_BIND(String(_("Ctrl")) + " " + _("Alt") + " +, -", _("Increase / Decrease scale factor"));
|
ADD_BIND(String(_("Ctrl")) + " " + _("Alt").encode() + " +, -", _("Increase / Decrease scale factor"));
|
||||||
ADD_BIND(String(_("Ctrl")) + " " + _("Alt") + " a", _("Toggle aspect-ratio correction"));
|
ADD_BIND(String(_("Ctrl")) + " " + _("Alt").encode() + " a", _("Toggle aspect-ratio correction"));
|
||||||
ADD_LINE;
|
ADD_LINE;
|
||||||
ADD_LINE;
|
ADD_LINE;
|
||||||
// FIXME: This should use word-wrapping, and should not assume
|
// FIXME: This should use word-wrapping, and should not assume
|
||||||
|
|
|
@ -651,13 +651,13 @@ int IMuseDriver_Amiga::open() {
|
||||||
// when playing from the floppy disks. Obviously we don't need the redundancy files. The error dialog will display
|
// when playing from the floppy disks. Obviously we don't need the redundancy files. The error dialog will display
|
||||||
// only the required files. These are different for MI2 and INDY4.
|
// only the required files. These are different for MI2 and INDY4.
|
||||||
if (_missingFiles) {
|
if (_missingFiles) {
|
||||||
Common::String message = _("This AMIGA version is missing (at least) the following file(s):\n\n");
|
Common::U32String message = _("This AMIGA version is missing (at least) the following file(s):\n\n");
|
||||||
for (int i = 0; i < 11; ++i) {
|
for (int i = 0; i < 11; ++i) {
|
||||||
if (_missingFiles & (1 << i))
|
if (_missingFiles & (1 << i))
|
||||||
message += Common::String::format("AMIGA%d.IMS\n", i + 1);
|
message += Common::String::format("AMIGA%d.IMS\n", i + 1);
|
||||||
}
|
}
|
||||||
message += _("\nPlease copy these file(s) into the game data directory.\n\n");
|
message += _("\nPlease copy these file(s) into the game data directory.\n\n");
|
||||||
::GUI::displayErrorDialog(message.c_str());
|
::GUI::displayErrorDialog(message);
|
||||||
return MERR_DEVICE_NOT_AVAILABLE;
|
return MERR_DEVICE_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ void ScummEngine::askForDisk(const char *filename, int disknum) {
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "Cannot find file: '%s'", filename);
|
sprintf(buf, "Cannot find file: '%s'", filename);
|
||||||
InfoDialog dialog(this, (char *)buf);
|
InfoDialog dialog(this, Common::convertToU32String(buf));
|
||||||
runDialog(dialog);
|
runDialog(dialog);
|
||||||
error("Cannot find file: '%s'", filename);
|
error("Cannot find file: '%s'", filename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1896,8 +1896,8 @@ void ScummEngine::setupMusic(int midi) {
|
||||||
GUI::MessageDialog dialog(
|
GUI::MessageDialog dialog(
|
||||||
Common::String::format(
|
Common::String::format(
|
||||||
_("Native MIDI support requires the Roland Upgrade from LucasArts,\n"
|
_("Native MIDI support requires the Roland Upgrade from LucasArts,\n"
|
||||||
"but %s is missing. Using AdLib instead."), fileName.c_str()),
|
"but %s is missing. Using AdLib instead.").encode().c_str(), fileName.c_str()),
|
||||||
_("OK"));
|
_("OK").encode());
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
_sound->_musicType = MDT_ADLIB;
|
_sound->_musicType = MDT_ADLIB;
|
||||||
}
|
}
|
||||||
|
@ -2444,7 +2444,7 @@ void ScummEngine::scummLoop_updateScummVars() {
|
||||||
void ScummEngine::scummLoop_handleSaveLoad() {
|
void ScummEngine::scummLoop_handleSaveLoad() {
|
||||||
if (_saveLoadFlag) {
|
if (_saveLoadFlag) {
|
||||||
bool success;
|
bool success;
|
||||||
const char *errMsg = 0;
|
Common::U32String errMsg("");
|
||||||
|
|
||||||
if (_game.version == 8 && _saveTemporaryState)
|
if (_game.version == 8 && _saveTemporaryState)
|
||||||
VAR(VAR_GAME_LOADED) = 0;
|
VAR(VAR_GAME_LOADED) = 0;
|
||||||
|
@ -2470,13 +2470,13 @@ void ScummEngine::scummLoop_handleSaveLoad() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
displayMessage(0, errMsg, filename.c_str());
|
displayMessage(0, errMsg.encode().c_str(), filename.c_str());
|
||||||
} else if (_saveLoadFlag == 1 && _saveLoadSlot != 0 && !_saveTemporaryState) {
|
} else if (_saveLoadFlag == 1 && _saveLoadSlot != 0 && !_saveTemporaryState) {
|
||||||
// Display "Save successful" message, except for auto saves
|
// Display "Save successful" message, except for auto saves
|
||||||
char buf[256];
|
char buf[256];
|
||||||
snprintf(buf, sizeof(buf), _("Successfully saved game in file:\n\n%s"), filename.c_str());
|
snprintf(buf, sizeof(buf), _("Successfully saved game in file:\n\n%s").encode().c_str(), filename.c_str());
|
||||||
|
|
||||||
GUI::TimedMessageDialog dialog(buf, 1500);
|
GUI::TimedMessageDialog dialog(Common::convertToU32String(buf), 1500);
|
||||||
runDialog(dialog);
|
runDialog(dialog);
|
||||||
}
|
}
|
||||||
if (success && _saveLoadFlag != 1)
|
if (success && _saveLoadFlag != 1)
|
||||||
|
@ -2759,7 +2759,7 @@ bool ScummEngine::startManiac() {
|
||||||
eventMan->pushEvent(event);
|
eventMan->pushEvent(event);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
displayMessage(0, "%s", _("Usually, Maniac Mansion would start now. But for that to work, the game files for Maniac Mansion have to be in the 'Maniac' directory inside the Tentacle game directory, and the game has to be added to ScummVM."));
|
displayMessage(0, "%s", _("Usually, Maniac Mansion would start now. But for that to work, the game files for Maniac Mansion have to be in the 'Maniac' directory inside the Tentacle game directory, and the game has to be added to ScummVM.").encode().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2802,7 +2802,7 @@ void ScummEngine_v7::pauseEngineIntern(bool pause) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ScummEngine::messageDialog(const char *message) {
|
void ScummEngine::messageDialog(const Common::U32String &message) {
|
||||||
if (!_messageDialog)
|
if (!_messageDialog)
|
||||||
_messageDialog = new InfoDialog(this, message);
|
_messageDialog = new InfoDialog(this, message);
|
||||||
((InfoDialog *)_messageDialog)->setInfoText(message);
|
((InfoDialog *)_messageDialog)->setInfoText(message);
|
||||||
|
|
|
@ -500,7 +500,7 @@ protected:
|
||||||
void confirmExitDialog();
|
void confirmExitDialog();
|
||||||
void confirmRestartDialog();
|
void confirmRestartDialog();
|
||||||
void pauseDialog();
|
void pauseDialog();
|
||||||
void messageDialog(const char *message);
|
void messageDialog(const Common::U32String &message);
|
||||||
void versionDialog();
|
void versionDialog();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -115,7 +115,7 @@ void ScummEngine::showMessageDialog(const byte *msg) {
|
||||||
if (_string[3].color == 0)
|
if (_string[3].color == 0)
|
||||||
_string[3].color = 4;
|
_string[3].color = 4;
|
||||||
|
|
||||||
InfoDialog dialog(this, (char *)buf);
|
InfoDialog dialog(this, Common::convertToU32String((char *)buf));
|
||||||
VAR(VAR_KEYPRESS) = runDialog(dialog);
|
VAR(VAR_KEYPRESS) = runDialog(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ SkyCompact::SkyCompact() {
|
||||||
_cptFile = new Common::File();
|
_cptFile = new Common::File();
|
||||||
Common::String filename = "sky.cpt";
|
Common::String filename = "sky.cpt";
|
||||||
if (!_cptFile->open(filename.c_str())) {
|
if (!_cptFile->open(filename.c_str())) {
|
||||||
Common::String msg = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
|
Common::String msg = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
error("%s", msg.c_str());
|
error("%s", msg.c_str());
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ SkyCompact::SkyCompact() {
|
||||||
error("unknown \"sky.cpt\" version");
|
error("unknown \"sky.cpt\" version");
|
||||||
|
|
||||||
if (SKY_CPT_SIZE != _cptFile->size()) {
|
if (SKY_CPT_SIZE != _cptFile->size()) {
|
||||||
GUI::MessageDialog dialog(_("The \"sky.cpt\" engine data file has an incorrect size."), _("OK"), NULL);
|
GUI::MessageDialog dialog(_("The \"sky.cpt\" engine data file has an incorrect size."), _("OK"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
error("Incorrect sky.cpt size (%d, expected: %d)", _cptFile->size(), SKY_CPT_SIZE);
|
error("Incorrect sky.cpt size (%d, expected: %d)", _cptFile->size(), SKY_CPT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ Common::KeymapArray SkyMetaEngine::initKeymaps(const char *target) const {
|
||||||
using namespace Common;
|
using namespace Common;
|
||||||
using namespace Sky;
|
using namespace Sky;
|
||||||
|
|
||||||
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, "sky-main", "Beneath a Steel Sky");
|
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, "sky-main", Common::convertToU32String("Beneath a Steel Sky"));
|
||||||
|
|
||||||
Action *act;
|
Action *act;
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ Common::KeymapArray SkyMetaEngine::initKeymaps(const char *target) const {
|
||||||
act->addDefaultInputMapping("JOY_Y");
|
act->addDefaultInputMapping("JOY_Y");
|
||||||
mainKeymap->addAction(act);
|
mainKeymap->addAction(act);
|
||||||
|
|
||||||
Keymap *shortcutsKeymap = new Keymap(Keymap::kKeymapTypeGame, SkyEngine::shortcutsKeymapId, "Beneath a Steel Sky - Shortcuts");
|
Keymap *shortcutsKeymap = new Keymap(Keymap::kKeymapTypeGame, SkyEngine::shortcutsKeymapId, Common::convertToU32String("Beneath a Steel Sky - Shortcuts"));
|
||||||
|
|
||||||
act = new Action(kStandardActionOpenMainMenu, _("Open control panel"));
|
act = new Action(kStandardActionOpenMainMenu, _("Open control panel"));
|
||||||
act->setCustomEngineActionEvent(kSkyActionOpenControlPanel);
|
act->setCustomEngineActionEvent(kSkyActionOpenControlPanel);
|
||||||
|
@ -313,7 +313,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
|
||||||
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
|
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
|
||||||
if (in) {
|
if (in) {
|
||||||
saveList.push_back(SaveStateDescriptor(slotNum,
|
saveList.push_back(SaveStateDescriptor(slotNum,
|
||||||
(slotNum == 0) ? _("Autosave") : savenames[slotNum - 1]));
|
(slotNum == 0) ? _("Autosave").encode() : savenames[slotNum - 1]));
|
||||||
delete in;
|
delete in;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ Common::Error SupernovaEngine::loadGameStrings() {
|
||||||
|
|
||||||
if (stream == nullptr) {
|
if (stream == nullptr) {
|
||||||
Common::Language l = Common::parseLanguage(ConfMan.get("language"));
|
Common::Language l = Common::parseLanguage(ConfMan.get("language"));
|
||||||
GUIErrorMessageFormat(_("Unable to locate the text for %s language in engine data file."), Common::getLanguageDescription(l));
|
GUIErrorMessageFormat(_("Unable to locate the text for %s language in engine data file.").encode().c_str(), Common::getLanguageDescription(l));
|
||||||
return Common::kReadingFailed;
|
return Common::kReadingFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,19 +455,19 @@ Common::SeekableReadStream *SupernovaEngine::getBlockFromDatFile(Common::String
|
||||||
char id[5], lang[5];
|
char id[5], lang[5];
|
||||||
id[4] = lang[4] = '\0';
|
id[4] = lang[4] = '\0';
|
||||||
if (!f.open(SUPERNOVA_DAT)) {
|
if (!f.open(SUPERNOVA_DAT)) {
|
||||||
GUIErrorMessageFormat(_("Unable to locate the '%s' engine data file."), SUPERNOVA_DAT);
|
GUIErrorMessageFormat(_("Unable to locate the '%s' engine data file.").encode().c_str(), SUPERNOVA_DAT);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
f.read(id, 3);
|
f.read(id, 3);
|
||||||
if (strncmp(id, "MSN", 3) != 0) {
|
if (strncmp(id, "MSN", 3) != 0) {
|
||||||
GUIErrorMessageFormat(_("The '%s' engine data file is corrupt."), SUPERNOVA_DAT);
|
GUIErrorMessageFormat(_("The '%s' engine data file is corrupt.").encode().c_str(), SUPERNOVA_DAT);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int version = f.readByte();
|
int version = f.readByte();
|
||||||
if (version != SUPERNOVA_DAT_VERSION) {
|
if (version != SUPERNOVA_DAT_VERSION) {
|
||||||
GUIErrorMessageFormat(
|
GUIErrorMessageFormat(
|
||||||
_("Incorrect version of the '%s' engine data file found. Expected %d but got %d."),
|
_("Incorrect version of the '%s' engine data file found. Expected %d but got %d.").encode().c_str(),
|
||||||
SUPERNOVA_DAT, SUPERNOVA_DAT_VERSION, version);
|
SUPERNOVA_DAT, SUPERNOVA_DAT_VERSION, version);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -477,7 +477,7 @@ Common::SeekableReadStream *SupernovaEngine::getBlockFromDatFile(Common::String
|
||||||
int part = f.readByte();
|
int part = f.readByte();
|
||||||
gameBlockSize = f.readUint32LE();
|
gameBlockSize = f.readUint32LE();
|
||||||
if (f.eos()){
|
if (f.eos()){
|
||||||
GUIErrorMessageFormat(_("Unable to find block for part %d"), _MSPart);
|
GUIErrorMessageFormat(_("Unable to find block for part %d").encode().c_str(), _MSPart);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (part == _MSPart) {
|
if (part == _MSPart) {
|
||||||
|
@ -520,7 +520,7 @@ Common::Error SupernovaEngine::showTextReader(const char *extension) {
|
||||||
filename = Common::String::format("ms2.%s", extension);
|
filename = Common::String::format("ms2.%s", extension);
|
||||||
|
|
||||||
if (!file.open(filename)) {
|
if (!file.open(filename)) {
|
||||||
GUIErrorMessageFormat(_("Unable to find '%s' in game folder or the engine data file."), filename.c_str());
|
GUIErrorMessageFormat(_("Unable to find '%s' in game folder or the engine data file.").encode().c_str(), filename.c_str());
|
||||||
return Common::kReadingFailed;
|
return Common::kReadingFailed;
|
||||||
}
|
}
|
||||||
stream = file.readStream(file.size());
|
stream = file.readStream(file.size());
|
||||||
|
|
|
@ -573,7 +573,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vm->isPsx() || scumm_stricmp(sequenceList[id], "enddemo") != 0) {
|
if (!vm->isPsx() || scumm_stricmp(sequenceList[id], "enddemo") != 0) {
|
||||||
Common::String buf = Common::String::format(_("Cutscene '%s' not found"), sequenceList[id]);
|
Common::U32String buf = Common::String::format(_("Cutscene '%s' not found").encode().c_str(), sequenceList[id]);
|
||||||
GUI::MessageDialog dialog(buf, _("OK"));
|
GUI::MessageDialog dialog(buf, _("OK"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1258,8 +1258,8 @@ bool Control::convertSaveGame(uint8 slot, char *desc) {
|
||||||
if (testSave) {
|
if (testSave) {
|
||||||
delete testSave;
|
delete testSave;
|
||||||
|
|
||||||
Common::String msg = Common::String::format(_("Target new saved game already exists!\n"
|
Common::U32String msg = Common::String::format(_("Target new saved game already exists!\n"
|
||||||
"Would you like to keep the old saved game (%s) or the new one (%s)?\n"),
|
"Would you like to keep the old saved game (%s) or the new one (%s)?\n").encode().c_str(),
|
||||||
oldFileName, newFileName);
|
oldFileName, newFileName);
|
||||||
GUI::MessageDialog dialog0(msg, _("Keep the old one"), _("Keep the new one"));
|
GUI::MessageDialog dialog0(msg, _("Keep the old one"), _("Keep the new one"));
|
||||||
|
|
||||||
|
|
|
@ -1632,7 +1632,7 @@ int Logic::fnRestartGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32
|
||||||
|
|
||||||
int Logic::fnQuitGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) {
|
int Logic::fnQuitGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) {
|
||||||
if (SwordEngine::_systemVars.isDemo) {
|
if (SwordEngine::_systemVars.isDemo) {
|
||||||
GUI::MessageDialog dialog(_("This is the end of the Broken Sword 1 Demo"), _("OK"), NULL);
|
GUI::MessageDialog dialog(_("This is the end of the Broken Sword 1 Demo"), _("OK"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
Engine::quitGame();
|
Engine::quitGame();
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -471,7 +471,7 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, OSystem *system
|
||||||
// The demo tries to play some cutscenes that aren't there, so make those warnings more discreet.
|
// The demo tries to play some cutscenes that aren't there, so make those warnings more discreet.
|
||||||
// In addition, some of the later re-releases of the game don't have the "eye" Virgin logo movie.
|
// In addition, some of the later re-releases of the game don't have the "eye" Virgin logo movie.
|
||||||
if (!vm->_logic->readVar(DEMO) && strcmp(name, "eye") != 0) {
|
if (!vm->_logic->readVar(DEMO) && strcmp(name, "eye") != 0) {
|
||||||
Common::String buf = Common::String::format(_("Cutscene '%s' not found"), name);
|
Common::U32String buf = Common::String::format(_("Cutscene '%s' not found").encode().c_str(), name);
|
||||||
GUI::MessageDialog dialog(buf, _("OK"));
|
GUI::MessageDialog dialog(buf, _("OK"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -94,7 +94,7 @@ bool Resources::loadArchives(const ADGameDescription *gd) {
|
||||||
Common::String filename = "teenagent.dat";
|
Common::String filename = "teenagent.dat";
|
||||||
if (!dat_file->open(filename.c_str())) {
|
if (!dat_file->open(filename.c_str())) {
|
||||||
delete dat_file;
|
delete dat_file;
|
||||||
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
|
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
warning("%s", errorMessage.c_str());
|
warning("%s", errorMessage.c_str());
|
||||||
GUIErrorMessage(errorMessage);
|
GUIErrorMessage(errorMessage);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -34,8 +34,8 @@ TestbedOptionsDialog::TestbedOptionsDialog(Common::Array<Testsuite *> &tsList, T
|
||||||
GUI::Dialog("TestbedOptions"),
|
GUI::Dialog("TestbedOptions"),
|
||||||
_testbedConfMan(tsConfMan) {
|
_testbedConfMan(tsConfMan) {
|
||||||
|
|
||||||
new GUI::StaticTextWidget(this, "TestbedOptions.Headline", "Select Testsuites to Execute");
|
new GUI::StaticTextWidget(this, "TestbedOptions.Headline", Common::convertToU32String("Select Testsuites to Execute"));
|
||||||
new GUI::StaticTextWidget(this, "TestbedOptions.Info", "Use Doubleclick to select/deselect");
|
new GUI::StaticTextWidget(this, "TestbedOptions.Info", Common::convertToU32String("Use Doubleclick to select/deselect"));
|
||||||
|
|
||||||
// Construct a String Array
|
// Construct a String Array
|
||||||
Common::Array<Testsuite *>::const_iterator iter;
|
Common::Array<Testsuite *>::const_iterator iter;
|
||||||
|
@ -63,12 +63,12 @@ TestbedOptionsDialog::TestbedOptionsDialog(Common::Array<Testsuite *> &tsList, T
|
||||||
_testListDisplay->setEditable(false);
|
_testListDisplay->setEditable(false);
|
||||||
|
|
||||||
if (selected > (tsList.size() - selected)) {
|
if (selected > (tsList.size() - selected)) {
|
||||||
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", "Deselect All", 0, kTestbedDeselectAll, 0);
|
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", Common::convertToU32String("Deselect All"), Common::U32String(""), kTestbedDeselectAll, 0);
|
||||||
} else {
|
} else {
|
||||||
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", "Select All", 0, kTestbedSelectAll, 0);
|
_selectButton = new GUI::ButtonWidget(this, "TestbedOptions.SelectAll", Common::convertToU32String("Select All"), Common::U32String(""), kTestbedSelectAll, 0);
|
||||||
}
|
}
|
||||||
new GUI::ButtonWidget(this, "TestbedOptions.RunTests", "Run tests", 0, GUI::kCloseCmd);
|
new GUI::ButtonWidget(this, "TestbedOptions.RunTests", Common::convertToU32String("Run tests"), Common::U32String(""), GUI::kCloseCmd);
|
||||||
new GUI::ButtonWidget(this, "TestbedOptions.Quit", "Exit Testbed", 0, kTestbedQuitCmd);
|
new GUI::ButtonWidget(this, "TestbedOptions.Quit", Common::convertToU32String("Exit Testbed"), Common::U32String(""), kTestbedQuitCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
TestbedOptionsDialog::~TestbedOptionsDialog() {}
|
TestbedOptionsDialog::~TestbedOptionsDialog() {}
|
||||||
|
@ -102,7 +102,7 @@ void TestbedOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kTestbedDeselectAll:
|
case kTestbedDeselectAll:
|
||||||
_selectButton->setLabel("Select All");
|
_selectButton->setLabel(Common::convertToU32String("Select All"));
|
||||||
_selectButton->setCmd(kTestbedSelectAll);
|
_selectButton->setCmd(kTestbedSelectAll);
|
||||||
for (uint i = 0; i < _testSuiteArray.size(); i++) {
|
for (uint i = 0; i < _testSuiteArray.size(); i++) {
|
||||||
_testListDisplay->markAsDeselected(i);
|
_testListDisplay->markAsDeselected(i);
|
||||||
|
@ -114,7 +114,7 @@ void TestbedOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kTestbedSelectAll:
|
case kTestbedSelectAll:
|
||||||
_selectButton->setLabel("Deselect All");
|
_selectButton->setLabel(Common::convertToU32String("Deselect All"));
|
||||||
_selectButton->setCmd(kTestbedDeselectAll);
|
_selectButton->setCmd(kTestbedDeselectAll);
|
||||||
for (uint i = 0; i < _testSuiteArray.size(); i++) {
|
for (uint i = 0; i < _testSuiteArray.size(); i++) {
|
||||||
_testListDisplay->markAsSelected(i);
|
_testListDisplay->markAsSelected(i);
|
||||||
|
@ -152,11 +152,11 @@ void TestbedInteractionDialog::addButton(uint w, uint h, const Common::String na
|
||||||
xOffset = _xOffset;
|
xOffset = _xOffset;
|
||||||
}
|
}
|
||||||
_yOffset += yPadding;
|
_yOffset += yPadding;
|
||||||
_buttonArray.push_back(new GUI::ButtonWidget(this, xOffset, _yOffset, w, h, name, 0, cmd));
|
_buttonArray.push_back(new GUI::ButtonWidget(this, xOffset, _yOffset, w, h, name, Common::U32String(""), cmd));
|
||||||
_yOffset += h;
|
_yOffset += h;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, const Common::Array<Common::String> &strArray, GUI::ListWidget::ColorList *colors, uint yPadding) {
|
void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, const Common::Array<Common::U32String> &strArray, GUI::ListWidget::ColorList *colors, uint yPadding) {
|
||||||
_yOffset += yPadding;
|
_yOffset += yPadding;
|
||||||
GUI::ListWidget *list = new GUI::ListWidget(this, x, y, w, h);
|
GUI::ListWidget *list = new GUI::ListWidget(this, x, y, w, h);
|
||||||
list->setEditable(false);
|
list->setEditable(false);
|
||||||
|
@ -166,7 +166,7 @@ void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, const Com
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestbedInteractionDialog::addButtonXY(uint x, uint /* y */, uint w, uint h, const Common::String name, uint32 cmd) {
|
void TestbedInteractionDialog::addButtonXY(uint x, uint /* y */, uint w, uint h, const Common::String name, uint32 cmd) {
|
||||||
_buttonArray.push_back(new GUI::ButtonWidget(this, x, _yOffset, w, h, name, 0, cmd));
|
_buttonArray.push_back(new GUI::ButtonWidget(this, x, _yOffset, w, h, name, Common::U32String(""), cmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestbedInteractionDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
|
void TestbedInteractionDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
|
||||||
|
|
|
@ -72,15 +72,15 @@ public:
|
||||||
TestbedListWidget(GUI::Dialog *boss, const Common::String &name, Common::Array<Testsuite *> tsArray) : GUI::ListWidget(boss, name), _testSuiteArray(tsArray) {}
|
TestbedListWidget(GUI::Dialog *boss, const Common::String &name, Common::Array<Testsuite *> tsArray) : GUI::ListWidget(boss, name), _testSuiteArray(tsArray) {}
|
||||||
|
|
||||||
void markAsSelected(int i) {
|
void markAsSelected(int i) {
|
||||||
if (!_list[i].contains("selected")) {
|
if (!_list[i].encode().contains("selected")) {
|
||||||
_list[i] += " (selected)";
|
_list[i] += Common::convertToU32String(" (selected)");
|
||||||
}
|
}
|
||||||
_listColors[i] = GUI::ThemeEngine::kFontColorNormal;
|
_listColors[i] = GUI::ThemeEngine::kFontColorNormal;
|
||||||
draw();
|
draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void markAsDeselected(int i) {
|
void markAsDeselected(int i) {
|
||||||
if (_list[i].contains("selected")) {
|
if (_list[i].encode().contains("selected")) {
|
||||||
_list[i] = _testSuiteArray[i]->getDescription();
|
_list[i] = _testSuiteArray[i]->getDescription();
|
||||||
}
|
}
|
||||||
_listColors[i] = GUI::ThemeEngine::kFontColorAlternate;
|
_listColors[i] = GUI::ThemeEngine::kFontColorAlternate;
|
||||||
|
@ -107,7 +107,7 @@ private:
|
||||||
GUI::ListWidget::ColorList _colors;
|
GUI::ListWidget::ColorList _colors;
|
||||||
GUI::ButtonWidget *_selectButton;
|
GUI::ButtonWidget *_selectButton;
|
||||||
Common::Array<Testsuite *> _testSuiteArray;
|
Common::Array<Testsuite *> _testSuiteArray;
|
||||||
Common::StringArray _testSuiteDescArray;
|
Common::U32StringArray _testSuiteDescArray;
|
||||||
TestbedListWidget *_testListDisplay;
|
TestbedListWidget *_testListDisplay;
|
||||||
TestbedConfigManager *_testbedConfMan;
|
TestbedConfigManager *_testbedConfMan;
|
||||||
};
|
};
|
||||||
|
@ -120,7 +120,7 @@ public:
|
||||||
void addButton(uint w, uint h, const Common::String name, uint32 cmd, uint xOffset = 0, uint yPadding = 8);
|
void addButton(uint w, uint h, const Common::String name, uint32 cmd, uint xOffset = 0, uint yPadding = 8);
|
||||||
void addButtonXY(uint x, uint y, uint w, uint h, const Common::String name, uint32 cmd);
|
void addButtonXY(uint x, uint y, uint w, uint h, const Common::String name, uint32 cmd);
|
||||||
void addText(uint w, uint h, const Common::String text, Graphics::TextAlign textAlign, uint xOffset, uint yPadding = 8);
|
void addText(uint w, uint h, const Common::String text, Graphics::TextAlign textAlign, uint xOffset, uint yPadding = 8);
|
||||||
void addList(uint x, uint y, uint w, uint h, const Common::Array<Common::String> &strArray, GUI::ListWidget::ColorList *colors = 0, uint yPadding = 8);
|
void addList(uint x, uint y, uint w, uint h, const Common::Array<Common::U32String> &strArray, GUI::ListWidget::ColorList *colors = 0, uint yPadding = 8);
|
||||||
protected:
|
protected:
|
||||||
Common::Array<GUI::ButtonWidget *> _buttonArray;
|
Common::Array<GUI::ButtonWidget *> _buttonArray;
|
||||||
uint _xOffset;
|
uint _xOffset;
|
||||||
|
|
|
@ -76,32 +76,32 @@ void SoundSubsystemDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd,
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case kPlayChannel1:
|
case kPlayChannel1:
|
||||||
_buttonArray[0]->setLabel("Pause Channel #1");
|
_buttonArray[0]->setLabel(Common::convertToU32String("Pause Channel #1"));
|
||||||
_buttonArray[0]->setCmd(kPauseChannel1);
|
_buttonArray[0]->setCmd(kPauseChannel1);
|
||||||
_mixer->pauseHandle(_h1, false);
|
_mixer->pauseHandle(_h1, false);
|
||||||
break;
|
break;
|
||||||
case kPlayChannel2:
|
case kPlayChannel2:
|
||||||
_buttonArray[1]->setLabel("Pause Channel #2");
|
_buttonArray[1]->setLabel(Common::convertToU32String("Pause Channel #2"));
|
||||||
_buttonArray[1]->setCmd(kPauseChannel2);
|
_buttonArray[1]->setCmd(kPauseChannel2);
|
||||||
_mixer->pauseHandle(_h2, false);
|
_mixer->pauseHandle(_h2, false);
|
||||||
break;
|
break;
|
||||||
case kPlayChannel3:
|
case kPlayChannel3:
|
||||||
_buttonArray[2]->setLabel("Pause Channel #3");
|
_buttonArray[2]->setLabel(Common::convertToU32String("Pause Channel #3"));
|
||||||
_buttonArray[2]->setCmd(kPauseChannel3);
|
_buttonArray[2]->setCmd(kPauseChannel3);
|
||||||
_mixer->pauseHandle(_h3, false);
|
_mixer->pauseHandle(_h3, false);
|
||||||
break;
|
break;
|
||||||
case kPauseChannel1:
|
case kPauseChannel1:
|
||||||
_buttonArray[0]->setLabel("Play Channel #1");
|
_buttonArray[0]->setLabel(Common::convertToU32String("Play Channel #1"));
|
||||||
_buttonArray[0]->setCmd(kPlayChannel1);
|
_buttonArray[0]->setCmd(kPlayChannel1);
|
||||||
_mixer->pauseHandle(_h1, true);
|
_mixer->pauseHandle(_h1, true);
|
||||||
break;
|
break;
|
||||||
case kPauseChannel2:
|
case kPauseChannel2:
|
||||||
_buttonArray[1]->setLabel("Play Channel #2");
|
_buttonArray[1]->setLabel(Common::convertToU32String("Play Channel #2"));
|
||||||
_buttonArray[1]->setCmd(kPlayChannel2);
|
_buttonArray[1]->setCmd(kPlayChannel2);
|
||||||
_mixer->pauseHandle(_h2, true);
|
_mixer->pauseHandle(_h2, true);
|
||||||
break;
|
break;
|
||||||
case kPauseChannel3:
|
case kPauseChannel3:
|
||||||
_buttonArray[2]->setLabel("Play Channel #3");
|
_buttonArray[2]->setLabel(Common::convertToU32String("Play Channel #3"));
|
||||||
_buttonArray[2]->setCmd(kPlayChannel3);
|
_buttonArray[2]->setCmd(kPlayChannel3);
|
||||||
_mixer->pauseHandle(_h3, true);
|
_mixer->pauseHandle(_h3, true);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -58,7 +58,7 @@ void TestbedExitDialog::init() {
|
||||||
_yOffset = 0;
|
_yOffset = 0;
|
||||||
Common::String text = "Thank you for using ScummVM testbed! Here are yor summarized results:";
|
Common::String text = "Thank you for using ScummVM testbed! Here are yor summarized results:";
|
||||||
addText(450, 20, text, Graphics::kTextAlignCenter, _xOffset, 15);
|
addText(450, 20, text, Graphics::kTextAlignCenter, _xOffset, 15);
|
||||||
Common::Array<Common::String> strArray;
|
Common::Array<Common::U32String> strArray;
|
||||||
GUI::ListWidget::ColorList colors;
|
GUI::ListWidget::ColorList colors;
|
||||||
|
|
||||||
for (Common::Array<Testsuite *>::const_iterator i = _testsuiteList.begin(); i != _testsuiteList.end(); ++i) {
|
for (Common::Array<Testsuite *>::const_iterator i = _testsuiteList.begin(); i != _testsuiteList.end(); ++i) {
|
||||||
|
@ -67,7 +67,7 @@ void TestbedExitDialog::init() {
|
||||||
if ((*i)->isEnabled()) {
|
if ((*i)->isEnabled()) {
|
||||||
strArray.push_back(Common::String::format("Passed: %d Failed: %d Skipped: %d", (*i)->getNumTestsPassed(), (*i)->getNumTestsFailed(), (*i)->getNumTestsSkipped()));
|
strArray.push_back(Common::String::format("Passed: %d Failed: %d Skipped: %d", (*i)->getNumTestsPassed(), (*i)->getNumTestsFailed(), (*i)->getNumTestsSkipped()));
|
||||||
} else {
|
} else {
|
||||||
strArray.push_back("Skipped");
|
strArray.push_back(Common::convertToU32String("Skipped"));
|
||||||
}
|
}
|
||||||
colors.push_back(GUI::ThemeEngine::kFontColorAlternate);
|
colors.push_back(GUI::ThemeEngine::kFontColorAlternate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,12 +111,12 @@ void Testsuite::genReport() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Testsuite::handleInteractiveInput(const Common::String &textToDisplay, const char *opt1, const char *opt2, OptionSelected result) {
|
bool Testsuite::handleInteractiveInput(const Common::String &textToDisplay, const char *opt1, const char *opt2, OptionSelected result) {
|
||||||
GUI::MessageDialog prompt(textToDisplay, opt1, opt2);
|
GUI::MessageDialog prompt(textToDisplay.c_str(), opt1, opt2);
|
||||||
return prompt.runModal() == result ? true : false;
|
return prompt.runModal() == result ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Testsuite::displayMessage(const Common::String &textToDisplay, const char *defaultButton) {
|
void Testsuite::displayMessage(const Common::String &textToDisplay, const char *defaultButton) {
|
||||||
GUI::MessageDialog prompt(textToDisplay, defaultButton);
|
GUI::MessageDialog prompt(textToDisplay.c_str(), defaultButton);
|
||||||
prompt.runModal();
|
prompt.runModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -483,12 +483,12 @@ void SoundManager::setSFXVolumes(uint8 volume) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundManager::showSoundError(const char *errorMsg, const char *soundFile) {
|
void SoundManager::showSoundError(const char *errorMsg, const char *soundFile) {
|
||||||
Common::String msg;
|
Common::U32String msg;
|
||||||
msg = Common::String::format(errorMsg, soundFile);
|
msg = Common::String::format(errorMsg, soundFile);
|
||||||
GUI::MessageDialog dialog(msg, "OK");
|
GUI::MessageDialog dialog(msg);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
|
|
||||||
error("%s", msg.c_str());
|
error("%s", msg.encode().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -193,7 +193,7 @@ bool TonyEngine::loadTonyDat() {
|
||||||
in.open(filename.c_str());
|
in.open(filename.c_str());
|
||||||
|
|
||||||
if (!in.isOpen()) {
|
if (!in.isOpen()) {
|
||||||
msg = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
|
msg = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
@ -205,7 +205,7 @@ bool TonyEngine::loadTonyDat() {
|
||||||
buf[4] = '\0';
|
buf[4] = '\0';
|
||||||
|
|
||||||
if (strcmp(buf, "TONY")) {
|
if (strcmp(buf, "TONY")) {
|
||||||
msg = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
|
msg = Common::String::format(_("The '%s' engine data file is corrupt.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
@ -216,7 +216,7 @@ bool TonyEngine::loadTonyDat() {
|
||||||
|
|
||||||
if ((majVer != TONY_DAT_VER_MAJ) || (minVer != TONY_DAT_VER_MIN)) {
|
if ((majVer != TONY_DAT_VER_MAJ) || (minVer != TONY_DAT_VER_MIN)) {
|
||||||
msg = Common::String::format(
|
msg = Common::String::format(
|
||||||
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
|
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.").encode().c_str(),
|
||||||
filename.c_str(), TONY_DAT_VER_MAJ, TONY_DAT_VER_MIN, majVer, minVer);
|
filename.c_str(), TONY_DAT_VER_MAJ, TONY_DAT_VER_MIN, majVer, minVer);
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
|
@ -253,7 +253,7 @@ bool TonyEngine::loadTonyDat() {
|
||||||
|
|
||||||
int numVariant = in.readUint16BE();
|
int numVariant = in.readUint16BE();
|
||||||
if (expectedLangVariant > numVariant - 1) {
|
if (expectedLangVariant > numVariant - 1) {
|
||||||
msg = Common::String::format(_("Font variant not present in '%s' engine data file."), filename.c_str());
|
msg = Common::String::format(_("Font variant not present in '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
|
|
||||||
|
|
|
@ -222,12 +222,12 @@ void ToonEngine::parseInput() {
|
||||||
if (slotNum >= 0 && slotNum <= 9 && canSaveGameStateCurrently()) {
|
if (slotNum >= 0 && slotNum <= 9 && canSaveGameStateCurrently()) {
|
||||||
if (saveGame(slotNum, "")) {
|
if (saveGame(slotNum, "")) {
|
||||||
// ok
|
// ok
|
||||||
Common::String buf = Common::String::format(_("Saved game in slot #%d "), slotNum);
|
Common::U32String buf = Common::String::format(_("Saved game in slot #%d ").encode().c_str(), slotNum);
|
||||||
GUI::TimedMessageDialog dialog(buf, 1000);
|
GUI::TimedMessageDialog dialog(buf, 1000);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
} else {
|
} else {
|
||||||
Common::String buf = Common::String::format(_("Could not quick save into slot #%d"), slotNum);
|
Common::U32String buf = Common::String::format(_("Could not quick save into slot #%d").encode().c_str(), slotNum);
|
||||||
GUI::MessageDialog dialog(buf, "OK", 0);
|
GUI::MessageDialog dialog(buf);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -239,12 +239,12 @@ void ToonEngine::parseInput() {
|
||||||
if (slotNum >= 0 && slotNum <= 9 && canLoadGameStateCurrently()) {
|
if (slotNum >= 0 && slotNum <= 9 && canLoadGameStateCurrently()) {
|
||||||
if (loadGame(slotNum)) {
|
if (loadGame(slotNum)) {
|
||||||
// ok
|
// ok
|
||||||
Common::String buf = Common::String::format(_("Saved game #%d quick loaded"), slotNum);
|
Common::U32String buf = Common::String::format(_("Saved game #%d quick loaded").encode().c_str(), slotNum);
|
||||||
GUI::TimedMessageDialog dialog(buf, 1000);
|
GUI::TimedMessageDialog dialog(buf, 1000);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
} else {
|
} else {
|
||||||
Common::String buf = Common::String::format(_("Could not quick load the saved game #%d"), slotNum);
|
Common::U32String buf = Common::String::format(_("Could not quick load the saved game #%d").encode().c_str(), slotNum);
|
||||||
GUI::MessageDialog dialog(buf, "OK", 0);
|
GUI::MessageDialog dialog(buf);
|
||||||
warning("%s", buf.c_str());
|
warning("%s", buf.c_str());
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
|
@ -1524,7 +1524,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) {
|
||||||
|
|
||||||
// load package
|
// load package
|
||||||
if (!resources()->openPackage(createRoomFilename(locationName + ".PAK"))) {
|
if (!resources()->openPackage(createRoomFilename(locationName + ".PAK"))) {
|
||||||
Common::String msg = Common::String::format(_("Unable to locate the '%s' data file."), createRoomFilename(locationName + ".PAK").c_str());
|
Common::String msg = Common::String::format(_("Unable to locate the '%s' data file.").encode().c_str(), createRoomFilename(locationName + ".PAK").c_str());
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
_shouldQuit = true;
|
_shouldQuit = true;
|
||||||
|
@ -4949,7 +4949,7 @@ bool ToonEngine::loadToonDat() {
|
||||||
in.open(filename.c_str());
|
in.open(filename.c_str());
|
||||||
|
|
||||||
if (!in.isOpen()) {
|
if (!in.isOpen()) {
|
||||||
msg = Common::String::format(_("Unable to locate the '%s' engine data file."), filename.c_str());
|
msg = Common::String::format(_("Unable to locate the '%s' engine data file.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
@ -4961,7 +4961,7 @@ bool ToonEngine::loadToonDat() {
|
||||||
buf[4] = '\0';
|
buf[4] = '\0';
|
||||||
|
|
||||||
if (strcmp(buf, "TOON")) {
|
if (strcmp(buf, "TOON")) {
|
||||||
msg = Common::String::format(_("The '%s' engine data file is corrupt."), filename.c_str());
|
msg = Common::String::format(_("The '%s' engine data file is corrupt.").encode().c_str(), filename.c_str());
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
@ -4972,7 +4972,7 @@ bool ToonEngine::loadToonDat() {
|
||||||
|
|
||||||
if ((majVer != TOON_DAT_VER_MAJ) || (minVer != TOON_DAT_VER_MIN)) {
|
if ((majVer != TOON_DAT_VER_MAJ) || (minVer != TOON_DAT_VER_MIN)) {
|
||||||
msg = Common::String::format(
|
msg = Common::String::format(
|
||||||
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d."),
|
_("Incorrect version of the '%s' engine data file found. Expected %d.%d but got %d.%d.").encode().c_str(),
|
||||||
filename.c_str(), TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer);
|
filename.c_str(), TOON_DAT_VER_MAJ, TOON_DAT_VER_MIN, majVer, minVer);
|
||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
warning("%s", msg.c_str());
|
warning("%s", msg.c_str());
|
||||||
|
|
|
@ -321,7 +321,7 @@ Common::Error NuvieEngine::saveGameState(int slot, const Common::String &desc, b
|
||||||
|
|
||||||
// Display that the game was saved
|
// Display that the game was saved
|
||||||
MsgScroll *scroll = Game::get_game()->get_scroll();
|
MsgScroll *scroll = Game::get_game()->get_scroll();
|
||||||
scroll->display_string(_("\nGame Saved\n\n"));
|
scroll->display_string(_("\nGame Saved\n\n").encode().c_str());
|
||||||
scroll->display_prompt();
|
scroll->display_prompt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,12 +370,12 @@ bool NuvieEngine::quickSave(int saveSlot, bool isLoad) {
|
||||||
if (!canLoadGameStateCurrently(false))
|
if (!canLoadGameStateCurrently(false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
text = _("loading quick save %d");
|
text = Common::convertFromU32String(_("loading quick save %d"));
|
||||||
} else {
|
} else {
|
||||||
if (!canSaveGameStateCurrently(false))
|
if (!canSaveGameStateCurrently(false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
text = _("saving quick save %d");
|
text = Common::convertFromU32String(_("saving quick save %d"));
|
||||||
}
|
}
|
||||||
|
|
||||||
text = Std::string::format(text.c_str(), saveSlot);
|
text = Std::string::format(text.c_str(), saveSlot);
|
||||||
|
@ -389,7 +389,7 @@ bool NuvieEngine::quickSave(int saveSlot, bool isLoad) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Common::String saveDesc = Common::String::format(_("Quicksave %03d"), saveSlot);
|
Common::String saveDesc = Common::String::format(_("Quicksave %03d").encode().c_str(), saveSlot);
|
||||||
return saveGameState(saveSlot, saveDesc, false).getCode() == Common::kNoError;
|
return saveGameState(saveSlot, saveDesc, false).getCode() == Common::kNoError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ bool UltimaDataArchive::load(const Common::String &subfolder,
|
||||||
(dataArchive = Common::makeZipArchive(DATA_FILENAME)) == 0 ||
|
(dataArchive = Common::makeZipArchive(DATA_FILENAME)) == 0 ||
|
||||||
!f.open(Common::String::format("%s/version.txt", subfolder.c_str()), *dataArchive)) {
|
!f.open(Common::String::format("%s/version.txt", subfolder.c_str()), *dataArchive)) {
|
||||||
delete dataArchive;
|
delete dataArchive;
|
||||||
errorMsg = Common::String::format(_("Could not locate engine data %s"), DATA_FILENAME);
|
errorMsg = Common::String::format(_("Could not locate engine data %s").encode().c_str(), DATA_FILENAME);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ bool UltimaDataArchive::load(const Common::String &subfolder,
|
||||||
|
|
||||||
if (major != reqMajorVersion || minor != reqMinorVersion) {
|
if (major != reqMajorVersion || minor != reqMinorVersion) {
|
||||||
delete dataArchive;
|
delete dataArchive;
|
||||||
errorMsg = Common::String::format(_("Out of date engine data. Expected %d.%d, but got version %d.%d"),
|
errorMsg = Common::String::format(_("Out of date engine data. Expected %d.%d, but got version %d.%d").encode().c_str(),
|
||||||
reqMajorVersion, reqMinorVersion, major, minor);
|
reqMajorVersion, reqMinorVersion, major, minor);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,7 +201,7 @@ Common::KeymapArray MetaEngine::initKeymaps(KeybindingMode mode) {
|
||||||
for (int kCtr = 0; recPtr->_id; ++recPtr, ++kCtr) {
|
for (int kCtr = 0; recPtr->_id; ++recPtr, ++kCtr) {
|
||||||
// Core keymaps
|
// Core keymaps
|
||||||
keyMap = new Common::Keymap(Common::Keymap::kKeymapTypeGame,
|
keyMap = new Common::Keymap(Common::Keymap::kKeymapTypeGame,
|
||||||
recPtr->_id, recPtr->_desc);
|
recPtr->_id, Common::convertToU32String(recPtr->_desc));
|
||||||
keymapArray.push_back(keyMap);
|
keymapArray.push_back(keyMap);
|
||||||
|
|
||||||
if (kCtr == 0) {
|
if (kCtr == 0) {
|
||||||
|
|
|
@ -296,13 +296,13 @@ void U8SaveGump::loadDescriptions() {
|
||||||
// FIXME: move version checks elsewhere!!
|
// FIXME: move version checks elsewhere!!
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case SavegameReader::SAVE_CORRUPT:
|
case SavegameReader::SAVE_CORRUPT:
|
||||||
_descriptions[i] = _("[corrupt]");
|
_descriptions[i] = Common::convertFromU32String(_("[corrupt]"));
|
||||||
break;
|
break;
|
||||||
case SavegameReader::SAVE_OUT_OF_DATE:
|
case SavegameReader::SAVE_OUT_OF_DATE:
|
||||||
_descriptions[i] = _("[outdated]");
|
_descriptions[i] = Common::convertFromU32String(_("[outdated]"));
|
||||||
break;
|
break;
|
||||||
case SavegameReader::SAVE_TOO_RECENT:
|
case SavegameReader::SAVE_TOO_RECENT:
|
||||||
_descriptions[i] = _("[too modern]");
|
_descriptions[i] = Common::convertFromU32String(_("[too modern]"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -153,7 +153,7 @@ void BasePersistenceManager::getSaveStateDesc(int slot, SaveStateDescriptor &des
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
desc.setSaveSlot(slot);
|
desc.setSaveSlot(slot);
|
||||||
desc.setDescription(_savedDescription);
|
desc.setDescription(Common::convertToU32String(_savedDescription));
|
||||||
desc.setDeletableFlag(true);
|
desc.setDeletableFlag(true);
|
||||||
desc.setWriteProtectedFlag(false);
|
desc.setWriteProtectedFlag(false);
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ public:
|
||||||
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override {
|
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override {
|
||||||
Wintermute::BasePersistenceManager pm(target, true);
|
Wintermute::BasePersistenceManager pm(target, true);
|
||||||
SaveStateDescriptor retVal;
|
SaveStateDescriptor retVal;
|
||||||
retVal.setDescription("Invalid savegame");
|
retVal.setDescription(Common::convertToU32String("Invalid savegame"));
|
||||||
pm.getSaveStateDesc(slot, retVal);
|
pm.getSaveStateDesc(slot, retVal);
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ inline Common::KeymapArray getWintermuteKeymaps(const char *target, const Common
|
||||||
|
|
||||||
using namespace Common;
|
using namespace Common;
|
||||||
|
|
||||||
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "wintermute", "Wintermute engine");
|
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "wintermute", Common::convertToU32String("Wintermute engine"));
|
||||||
Keymap *gameKeyMap = new Keymap(Keymap::kKeymapTypeGame, gameId, gameDescr);
|
Keymap *gameKeyMap = new Keymap(Keymap::kKeymapTypeGame, gameId, Common::convertToU32String(gameDescr));
|
||||||
Keymap *extraKeyMap = new Keymap(Keymap::kKeymapTypeGame, "extras", "ScummVM extra actions");
|
Keymap *extraKeyMap = new Keymap(Keymap::kKeymapTypeGame, "extras", Common::convertToU32String("ScummVM extra actions"));
|
||||||
|
|
||||||
Action *act;
|
Action *act;
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ Common::KeymapArray ZVisionMetaEngine::initKeymaps(const char *target) const {
|
||||||
using namespace Common;
|
using namespace Common;
|
||||||
using namespace ZVision;
|
using namespace ZVision;
|
||||||
|
|
||||||
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, mainKeymapId, "Z-Vision");
|
Keymap *mainKeymap = new Keymap(Keymap::kKeymapTypeGame, mainKeymapId, Common::convertToU32String("Z-Vision"));
|
||||||
|
|
||||||
Action *act;
|
Action *act;
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ Common::KeymapArray ZVisionMetaEngine::initKeymaps(const char *target) const {
|
||||||
act->addDefaultInputMapping("JOY_B");
|
act->addDefaultInputMapping("JOY_B");
|
||||||
mainKeymap->addAction(act);
|
mainKeymap->addAction(act);
|
||||||
|
|
||||||
Keymap *gameKeymap = new Keymap(Keymap::kKeymapTypeGame, gameKeymapId, "Z-Vision - Game");
|
Keymap *gameKeymap = new Keymap(Keymap::kKeymapTypeGame, gameKeymapId, Common::convertToU32String("Z-Vision - Game"));
|
||||||
|
|
||||||
act = new Action(kStandardActionMoveUp, _("Look Up"));
|
act = new Action(kStandardActionMoveUp, _("Look Up"));
|
||||||
act->setCustomEngineActionEvent(kZVisionActionUp);
|
act->setCustomEngineActionEvent(kZVisionActionUp);
|
||||||
|
@ -232,7 +232,7 @@ Common::KeymapArray ZVisionMetaEngine::initKeymaps(const char *target) const {
|
||||||
act->addDefaultInputMapping("C+p");
|
act->addDefaultInputMapping("C+p");
|
||||||
gameKeymap->addAction(act);
|
gameKeymap->addAction(act);
|
||||||
|
|
||||||
Keymap *cutscenesKeymap = new Keymap(Keymap::kKeymapTypeGame, cutscenesKeymapId, "Z-Vision - Cutscenes");
|
Keymap *cutscenesKeymap = new Keymap(Keymap::kKeymapTypeGame, cutscenesKeymapId, Common::convertToU32String("Z-Vision - Cutscenes"));
|
||||||
|
|
||||||
act = new Action(kStandardActionSkip, _("Skip cutscene"));
|
act = new Action(kStandardActionSkip, _("Skip cutscene"));
|
||||||
act->setCustomEngineActionEvent(kZVisionActionSkipCutscene);
|
act->setCustomEngineActionEvent(kZVisionActionSkipCutscene);
|
||||||
|
|
|
@ -221,7 +221,7 @@ bool SaveManager::readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &hea
|
||||||
Common::String::format(
|
Common::String::format(
|
||||||
_("This saved game uses version %u, but this engine only "
|
_("This saved game uses version %u, but this engine only "
|
||||||
"supports up to version %d. You will need an updated version "
|
"supports up to version %d. You will need an updated version "
|
||||||
"of the engine to use this saved game."), tempVersion, SAVE_VERSION
|
"of the engine to use this saved game.").encode().c_str(), tempVersion, SAVE_VERSION
|
||||||
),
|
),
|
||||||
_("OK"));
|
_("OK"));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
|
|
|
@ -99,7 +99,7 @@ AboutDialog::AboutDialog()
|
||||||
version += gScummVMVersion;
|
version += gScummVMVersion;
|
||||||
_lines.push_back(version);
|
_lines.push_back(version);
|
||||||
|
|
||||||
Common::String date = Common::String::format(_("(built on %s)").encode().c_str(), gScummVMBuildDate);
|
Common::U32String date = Common::String::format(_("(built on %s)").encode().c_str(), gScummVMBuildDate);
|
||||||
_lines.push_back(U32String("C2") + date);
|
_lines.push_back(U32String("C2") + date);
|
||||||
|
|
||||||
for (i = 0; i < ARRAYSIZE(copyright_text); i++)
|
for (i = 0; i < ARRAYSIZE(copyright_text); i++)
|
||||||
|
|
|
@ -224,8 +224,8 @@ Common::U32String DownloadDialog::getSpeedLabelText() {
|
||||||
|
|
||||||
void DownloadDialog::refreshWidgets() {
|
void DownloadDialog::refreshWidgets() {
|
||||||
_localDirectory = CloudMan.getDownloadLocalDirectory();
|
_localDirectory = CloudMan.getDownloadLocalDirectory();
|
||||||
_remoteDirectoryLabel->setLabel(_("From: ") + CloudMan.getDownloadRemoteDirectory());
|
_remoteDirectoryLabel->setLabel(_("From: ").encode() + CloudMan.getDownloadRemoteDirectory());
|
||||||
_localDirectoryLabel->setLabel(_("To: ") + _localDirectory);
|
_localDirectoryLabel->setLabel(_("To: ").encode() + _localDirectory);
|
||||||
uint32 progress = (uint32)(100 * CloudMan.getDownloadingProgress());
|
uint32 progress = (uint32)(100 * CloudMan.getDownloadingProgress());
|
||||||
_percentLabel->setLabel(Common::String::format("%u %%", progress));
|
_percentLabel->setLabel(Common::String::format("%u %%", progress));
|
||||||
_downloadSizeLabel->setLabel(getSizeLabelText());
|
_downloadSizeLabel->setLabel(getSizeLabelText());
|
||||||
|
|
|
@ -75,28 +75,28 @@ FluidSynthSettingsDialog::FluidSynthSettingsDialog()
|
||||||
// 0.00 - 1.20, Default: 0.20
|
// 0.00 - 1.20, Default: 0.20
|
||||||
_reverbRoomSizeSlider->setMinValue(0);
|
_reverbRoomSizeSlider->setMinValue(0);
|
||||||
_reverbRoomSizeSlider->setMaxValue(120);
|
_reverbRoomSizeSlider->setMaxValue(120);
|
||||||
_reverbRoomSizeLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.RoomSizeLabel", "20");
|
_reverbRoomSizeLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.RoomSizeLabel", Common::U32String("20"));
|
||||||
|
|
||||||
_reverbDampingDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingText", _("Damp:"));
|
_reverbDampingDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingText", _("Damp:"));
|
||||||
_reverbDampingSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingSlider", Common::U32String(""), kReverbDampingChangedCmd);
|
_reverbDampingSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingSlider", Common::U32String(""), kReverbDampingChangedCmd);
|
||||||
// 0.00 - 1.00, Default: 0.00
|
// 0.00 - 1.00, Default: 0.00
|
||||||
_reverbDampingSlider->setMinValue(0);
|
_reverbDampingSlider->setMinValue(0);
|
||||||
_reverbDampingSlider->setMaxValue(100);
|
_reverbDampingSlider->setMaxValue(100);
|
||||||
_reverbDampingLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingLabel", "0");
|
_reverbDampingLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingLabel", Common::U32String("0"));
|
||||||
|
|
||||||
_reverbWidthDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthText", _("Width:"));
|
_reverbWidthDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthText", _("Width:"));
|
||||||
_reverbWidthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthSlider", Common::U32String(""), kReverbWidthChangedCmd);
|
_reverbWidthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthSlider", Common::U32String(""), kReverbWidthChangedCmd);
|
||||||
// 0 - 100, Default: 1
|
// 0 - 100, Default: 1
|
||||||
_reverbWidthSlider->setMinValue(0);
|
_reverbWidthSlider->setMinValue(0);
|
||||||
_reverbWidthSlider->setMaxValue(100);
|
_reverbWidthSlider->setMaxValue(100);
|
||||||
_reverbWidthLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthLabel", "1");
|
_reverbWidthLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthLabel", Common::U32String("1"));
|
||||||
|
|
||||||
_reverbLevelDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelText", _("Level:"));
|
_reverbLevelDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelText", _("Level:"));
|
||||||
_reverbLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelSlider", Common::U32String(""), kReverbLevelChangedCmd);
|
_reverbLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelSlider", Common::U32String(""), kReverbLevelChangedCmd);
|
||||||
// 0.00 - 1.00, Default: 0.90
|
// 0.00 - 1.00, Default: 0.90
|
||||||
_reverbLevelSlider->setMinValue(0);
|
_reverbLevelSlider->setMinValue(0);
|
||||||
_reverbLevelSlider->setMaxValue(100);
|
_reverbLevelSlider->setMaxValue(100);
|
||||||
_reverbLevelLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelLabel", "90");
|
_reverbLevelLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelLabel", Common::U32String("90"));
|
||||||
|
|
||||||
_tabWidget->addTab(_("Chorus"), "FluidSynthSettings_Chorus");
|
_tabWidget->addTab(_("Chorus"), "FluidSynthSettings_Chorus");
|
||||||
|
|
||||||
|
@ -107,28 +107,28 @@ FluidSynthSettingsDialog::FluidSynthSettingsDialog()
|
||||||
// 0-99, Default: 3
|
// 0-99, Default: 3
|
||||||
_chorusVoiceCountSlider->setMinValue(0);
|
_chorusVoiceCountSlider->setMinValue(0);
|
||||||
_chorusVoiceCountSlider->setMaxValue(99);
|
_chorusVoiceCountSlider->setMaxValue(99);
|
||||||
_chorusVoiceCountLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.VoiceCountLabel", "3");
|
_chorusVoiceCountLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.VoiceCountLabel", Common::U32String("3"));
|
||||||
|
|
||||||
_chorusLevelDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelText", _("Level:"));
|
_chorusLevelDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelText", _("Level:"));
|
||||||
_chorusLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelSlider", Common::U32String(""), kChorusLevelChangedCmd);
|
_chorusLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelSlider", Common::U32String(""), kChorusLevelChangedCmd);
|
||||||
// 0.00 - 1.00, Default: 1.00
|
// 0.00 - 1.00, Default: 1.00
|
||||||
_chorusLevelSlider->setMinValue(0);
|
_chorusLevelSlider->setMinValue(0);
|
||||||
_chorusLevelSlider->setMaxValue(100);
|
_chorusLevelSlider->setMaxValue(100);
|
||||||
_chorusLevelLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelLabel", "100");
|
_chorusLevelLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelLabel", Common::U32String("100"));
|
||||||
|
|
||||||
_chorusSpeedDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedText", _("Speed:"));
|
_chorusSpeedDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedText", _("Speed:"));
|
||||||
_chorusSpeedSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedSlider", Common::U32String(""), kChorusSpeedChangedCmd);
|
_chorusSpeedSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedSlider", Common::U32String(""), kChorusSpeedChangedCmd);
|
||||||
// 0.30 - 5.00, Default: 0.30
|
// 0.30 - 5.00, Default: 0.30
|
||||||
_chorusSpeedSlider->setMinValue(30);
|
_chorusSpeedSlider->setMinValue(30);
|
||||||
_chorusSpeedSlider->setMaxValue(500);
|
_chorusSpeedSlider->setMaxValue(500);
|
||||||
_chorusSpeedLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedLabel", "30");
|
_chorusSpeedLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedLabel", Common::U32String("30"));
|
||||||
|
|
||||||
_chorusDepthDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthText", _("Depth:"));
|
_chorusDepthDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthText", _("Depth:"));
|
||||||
_chorusDepthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthSlider", Common::U32String(""), kChorusDepthChangedCmd);
|
_chorusDepthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthSlider", Common::U32String(""), kChorusDepthChangedCmd);
|
||||||
// 0.00 - 21.00, Default: 8.00
|
// 0.00 - 21.00, Default: 8.00
|
||||||
_chorusDepthSlider->setMinValue(0);
|
_chorusDepthSlider->setMinValue(0);
|
||||||
_chorusDepthSlider->setMaxValue(210);
|
_chorusDepthSlider->setMaxValue(210);
|
||||||
_chorusDepthLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthLabel", "80");
|
_chorusDepthLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthLabel", Common::U32String("80"));
|
||||||
|
|
||||||
_chorusWaveFormTypePopUpDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.WaveFormTypeText", _("Type:"));
|
_chorusWaveFormTypePopUpDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.WaveFormTypeText", _("Type:"));
|
||||||
_chorusWaveFormTypePopUp = new PopUpWidget(_tabWidget, "FluidSynthSettings_Chorus.WaveFormType");
|
_chorusWaveFormTypePopUp = new PopUpWidget(_tabWidget, "FluidSynthSettings_Chorus.WaveFormType");
|
||||||
|
|
|
@ -100,6 +100,12 @@ MessageDialog::MessageDialog(const Common::U32String &message, Common::U32String
|
||||||
new ButtonWidget(this, cancelButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, altButton, Common::U32String(""), kCancelCmd, Common::ASCII_ESCAPE); // Cancel dialog
|
new ButtonWidget(this, cancelButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, altButton, Common::U32String(""), kCancelCmd, Common::ASCII_ESCAPE); // Cancel dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MessageDialog::MessageDialog(const char *message, const char *defaultButton, const char *altButton, Graphics::TextAlign alignment)
|
||||||
|
: Dialog(30, 20, 260, 124) {
|
||||||
|
|
||||||
|
MessageDialog::MessageDialog(Common::U32String(message), Common::U32String(defaultButton), Common::U32String(altButton), alignment);
|
||||||
|
}
|
||||||
|
|
||||||
void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
||||||
// FIXME: It's a really bad thing that we use two arbitrary constants
|
// FIXME: It's a really bad thing that we use two arbitrary constants
|
||||||
if (cmd == kOkCmd) {
|
if (cmd == kOkCmd) {
|
||||||
|
|
|
@ -42,6 +42,7 @@ enum {
|
||||||
class MessageDialog : public Dialog {
|
class MessageDialog : public Dialog {
|
||||||
public:
|
public:
|
||||||
MessageDialog(const Common::U32String &message, Common::U32String defaultButton = Common::U32String("OK"), Common::U32String altButton = Common::U32String(""), Graphics::TextAlign alignment = Graphics::kTextAlignCenter, const char *url = nullptr);
|
MessageDialog(const Common::U32String &message, Common::U32String defaultButton = Common::U32String("OK"), Common::U32String altButton = Common::U32String(""), Graphics::TextAlign alignment = Graphics::kTextAlignCenter, const char *url = nullptr);
|
||||||
|
MessageDialog(const char *message, const char *defaultButton = "OK", const char *altButton = "", Graphics::TextAlign alignment = Graphics::kTextAlignCenter, const char *url = nullptr);
|
||||||
|
|
||||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||||
|
|
||||||
|
|
|
@ -591,11 +591,11 @@ void SaveLoadChooserSimple::updateSelection(bool redraw) {
|
||||||
if (_saveDateSupport) {
|
if (_saveDateSupport) {
|
||||||
const Common::String &saveDate = desc.getSaveDate();
|
const Common::String &saveDate = desc.getSaveDate();
|
||||||
if (!saveDate.empty())
|
if (!saveDate.empty())
|
||||||
_date->setLabel(_("Date: ") + saveDate);
|
_date->setLabel(_("Date: ").encode() + saveDate);
|
||||||
|
|
||||||
const Common::String &saveTime = desc.getSaveTime();
|
const Common::String &saveTime = desc.getSaveTime();
|
||||||
if (!saveTime.empty())
|
if (!saveTime.empty())
|
||||||
_time->setLabel(_("Time: ") + saveTime);
|
_time->setLabel(_("Time: ").encode() + saveTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_playTimeSupport) {
|
if (_playTimeSupport) {
|
||||||
|
@ -1108,13 +1108,13 @@ void SaveLoadChooserGrid::updateSaves() {
|
||||||
tooltip += desc.getDescription();
|
tooltip += desc.getDescription();
|
||||||
|
|
||||||
if (_saveDateSupport) {
|
if (_saveDateSupport) {
|
||||||
const Common::String &saveDate = desc.getSaveDate();
|
const Common::U32String &saveDate = desc.getSaveDate();
|
||||||
if (!saveDate.empty()) {
|
if (!saveDate.empty()) {
|
||||||
tooltip += Common::U32String("\n");
|
tooltip += Common::U32String("\n");
|
||||||
tooltip += _("Date: ") + saveDate;
|
tooltip += _("Date: ") + saveDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Common::String &saveTime = desc.getSaveTime();
|
const Common::U32String &saveTime = desc.getSaveTime();
|
||||||
if (!saveTime.empty()) {
|
if (!saveTime.empty()) {
|
||||||
tooltip += Common::U32String("\n");
|
tooltip += Common::U32String("\n");
|
||||||
tooltip += _("Time: ") + saveTime;
|
tooltip += _("Time: ") + saveTime;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue