From 2b33642d5482fbd7109082df08f4c6d67ff8c188 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 14 Nov 2010 21:10:56 +0000 Subject: [PATCH] GUI: Fix GMM labels translation for SCUMM engine In the SCUMM engine (and maybe other engines), the GMM Dialog is created in the engine constructor and before the window resolution is updated (so it is still using the resolution from the Launcher). Therefore if the global scaler is x2 but a SCUMM game overwrite it to use x1, it was not using the correct labels when they had a different translation for the lowres context. svn-id: r54237 --- engines/dialogs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index a8f9327152b..9104eaff3aa 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -176,6 +176,15 @@ void MainMenuDialog::reflowLayout() { _loadButton->setEnabled(_engine->canLoadGameStateCurrently()); if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime)) _saveButton->setEnabled(_engine->canSaveGameStateCurrently()); + + // Overlay size might have changed since the construction of the dialog. + // Update labels when it might be needed + // FIXME: it might be better to declare GUI::StaticTextWidget::setLabel() virtual + // and to reimplement it in GUI::ButtonWidget to handle the hotkey. + if (g_system->getOverlayWidth() > 320) + _rtlButton->setLabel(_rtlButton->cleanupHotkey(_("~R~eturn to Launcher"))); + else + _rtlButton->setLabel(_rtlButton->cleanupHotkey(_c("~R~eturn to Launcher", "lowres"))); #ifndef DISABLE_FANCY_THEMES if (g_gui.xmlEval()->getVar("Globals.ShowGlobalMenuLogo", 0) == 1 && g_gui.theme()->supportsImages()) {