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
This commit is contained in:
Thierry Crozat 2010-11-14 21:10:56 +00:00
parent db24b2a014
commit 2b33642d54

View File

@ -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()) {