From 840f08d5375088a3c29ed47a23db824b76c2f79c Mon Sep 17 00:00:00 2001 From: aryanrawlani28 Date: Thu, 20 Aug 2020 11:45:58 +0530 Subject: [PATCH] GUI: U32: Code cleanup & misc fixes - Fix a translation for scumm subtitle settings dialogs. --- engines/bbvs/dialogs.cpp | 10 +++++----- engines/cryomni3d/versailles/logic.cpp | 3 +-- engines/engine.cpp | 3 +-- engines/hugo/dialogs.cpp | 18 +++++++++--------- engines/scumm/dialogs.cpp | 2 +- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/engines/bbvs/dialogs.cpp b/engines/bbvs/dialogs.cpp index c7afb748c26..4cd421143b7 100644 --- a/engines/bbvs/dialogs.cpp +++ b/engines/bbvs/dialogs.cpp @@ -86,11 +86,11 @@ MainMenu::~MainMenu() { } void MainMenu::init() { - _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, Common::U32String(""), Common::U32String(""), 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, Common::U32String(""), Common::U32String(""), 0); - _buttons[4] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String(""), Common::U32String(""), 0); + _buttons[0] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String("")); + _buttons[1] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String("")); + _buttons[2] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String("")); + _buttons[3] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String("")); + _buttons[4] = new GUI::ButtonWidget(this, 0, 0, 1, 1, Common::U32String("")); gotoMenuScreen(kMainMenuScr); } diff --git a/engines/cryomni3d/versailles/logic.cpp b/engines/cryomni3d/versailles/logic.cpp index 0d4ca9cf3d8..3e583ea11ff 100644 --- a/engines/cryomni3d/versailles/logic.cpp +++ b/engines/cryomni3d/versailles/logic.cpp @@ -2417,10 +2417,9 @@ bool CryOmni3DEngine_Versailles::handleEpigraph(ZonFixedImage *fimg) { if (password.size() >= kEpigraphMaxLetters) { continue; } - char keyCodeCheck = keyCode - Common::KEYCODE_a + 'A'; if (keyCode >= Common::KEYCODE_a && keyCode <= Common::KEYCODE_z && - _epigraphContent.contains(keyCodeCheck)) { + _epigraphContent.contains((char)(keyCode - Common::KEYCODE_a + 'A'))) { password += keyCode - Common::KEYCODE_a + 'A'; } else { continue; diff --git a/engines/engine.cpp b/engines/engine.cpp index 4fb538f6f27..dccf320497e 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -316,8 +316,7 @@ void initGraphics(int width, int height, const Graphics::PixelFormat *format) { // Error out on size switch failure if (gfxError & OSystem::kTransactionSizeChangeFailed) { Common::U32String message; - message = Common::U32String::format( - _("Could not switch to resolution '%dx%d'."), width, height); + message = Common::U32String::format(_("Could not switch to resolution '%dx%d'."), width, height); GUIErrorMessage(message); error("Could not switch to resolution '%dx%d'.", width, height); diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp index 62a508953ae..ed50add5a9e 100644 --- a/engines/hugo/dialogs.cpp +++ b/engines/hugo/dialogs.cpp @@ -56,15 +56,15 @@ void TopMenu::init() { int x = kMenuX; int y = kMenuY; - _whatButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("What is it?"), kCmdWhat); - _musicButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Music"), kCmdMusic); - _soundFXButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Sound FX"), kCmdSoundFX); - _saveButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Save game"), kCmdSave); - _loadButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Load game"), kCmdLoad); - _recallButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Recall last command"), kCmdRecall); - _turboButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Turbo"), kCmdTurbo); - _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, Common::U32String("Inventory"), kCmdInvent); + _whatButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("What is it?"), kCmdWhat); + _musicButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Music"), kCmdMusic); + _soundFXButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Sound FX"), kCmdSoundFX); + _saveButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Save game"), kCmdSave); + _loadButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Load game"), kCmdLoad); + _recallButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Recall last command"), kCmdRecall); + _turboButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, Common::U32String("Turbo"), kCmdTurbo); + _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, Common::U32String("Inventory"), kCmdInvent); } void TopMenu::reflowLayout() { diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index aee429d796d..d4edc323fc5 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -609,7 +609,7 @@ void SubtitleSettingsDialog::cycleValue() { _value = 0; if (_value == 1 && g_system->getOverlayWidth() <= 320) - setInfoText(Common::U32String(_sc("Speech & Subs", "lowres"))); + setInfoText(_c("Speech & Subs", "lowres")); else setInfoText(_(subtitleDesc[_value]));