aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/EditTextWidget.cpp2
-rw-r--r--gui/GuiManager.cpp3
-rw-r--r--gui/KeysDialog.h3
-rw-r--r--gui/ListWidget.cpp12
-rw-r--r--gui/ThemeEngine.cpp100
-rw-r--r--gui/ThemeEngine.h12
-rw-r--r--gui/ThemeEval.h4
-rw-r--r--gui/ThemeParser.cpp2
-rw-r--r--gui/Tooltip.cpp18
-rw-r--r--gui/Tooltip.h9
-rw-r--r--gui/browser.cpp5
-rw-r--r--gui/credits.h6
-rw-r--r--gui/editable.cpp5
-rw-r--r--gui/editable.h2
-rw-r--r--gui/launcher.cpp98
-rw-r--r--gui/message.cpp6
-rw-r--r--gui/options.cpp152
-rw-r--r--gui/saveload.cpp2
-rw-r--r--gui/themes/scummmodern.zipbin181317 -> 181827 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx6
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx2
-rwxr-xr-xgui/themes/scummtheme.py36
-rw-r--r--gui/themes/translations.datbin0 -> 80935 bytes
23 files changed, 279 insertions, 206 deletions
diff --git a/gui/EditTextWidget.cpp b/gui/EditTextWidget.cpp
index 7079453173..e5de1c6e7f 100644
--- a/gui/EditTextWidget.cpp
+++ b/gui/EditTextWidget.cpp
@@ -88,7 +88,7 @@ void EditTextWidget::drawWidget() {
}
Common::Rect EditTextWidget::getEditRect() const {
- Common::Rect r(2 + _leftPadding, 1, _w - 2 - _leftPadding - _rightPadding, _h-1);
+ Common::Rect r(2 + _leftPadding, 2, _w - 2 - _leftPadding - _rightPadding, _h-1);
return r;
}
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index bbd7718d71..a2a8654bf6 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -63,6 +63,9 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _tooltipCheck(false),
// Clear the cursor
memset(_cursor, 0xFF, sizeof(_cursor));
+ // Enable translation
+ TransMan.setLanguage(ConfMan.get("gui_language").c_str());
+
ConfMan.registerDefault("gui_theme", "scummmodern");
Common::String themefile(ConfMan.get("gui_theme"));
diff --git a/gui/KeysDialog.h b/gui/KeysDialog.h
index d18bcb3617..7a9936a085 100644
--- a/gui/KeysDialog.h
+++ b/gui/KeysDialog.h
@@ -30,12 +30,13 @@
#include "gui/dialog.h"
#include "gui/ListWidget.h"
#include "common/str.h"
+#include "common/translation.h"
namespace GUI {
class KeysDialog : public GUI::Dialog {
public:
- KeysDialog(const Common::String &title = "Choose an action to map");
+ KeysDialog(const Common::String &title = _("Choose an action to map"));
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleKeyUp(Common::KeyState state);
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 4447b62244..f5f41bba80 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -449,11 +449,15 @@ bool ListWidget::handleKeyUp(Common::KeyState state) {
}
void ListWidget::receivedFocusWidget() {
+ _inversion = ThemeEngine::kTextInversionFocus;
+
// Redraw the widget so the selection color will change
draw();
}
void ListWidget::lostFocusWidget() {
+ _inversion = ThemeEngine::kTextInversion;
+
// If we lose focus, we simply forget the user changes
_editMode = false;
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
@@ -491,12 +495,8 @@ void ListWidget::drawWidget() {
ThemeEngine::TextInversionState inverted = ThemeEngine::kTextInversionNone;
// Draw the selected item inverted, on a highlighted background.
- if (_selectedItem == pos) {
- if (_hasFocus)
- inverted = ThemeEngine::kTextInversionFocus;
- else
- inverted = ThemeEngine::kTextInversion;
- }
+ if (_selectedItem == pos)
+ inverted = _inversion;
Common::Rect r(getEditRect());
int pad = _leftPadding;
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 3a50b2c69c..d9a1e05855 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -44,8 +44,6 @@
#include "gui/ThemeEval.h"
#include "gui/ThemeParser.h"
-#define GUI_ENABLE_BUILTIN_THEME
-
namespace GUI {
const char * const ThemeEngine::kImageLogo = "logo.bmp";
@@ -331,10 +329,10 @@ ThemeEngine::~ThemeEngine() {
* Rendering mode management
*********************************************************/
const ThemeEngine::Renderer ThemeEngine::_rendererModes[] = {
- { _s("Disabled GFX"), "none", kGfxDisabled },
- { _s("Standard Renderer (16bpp)"), "normal_16bpp", kGfxStandard16bit },
+ { _s("Disabled GFX"), _sc("Disabled GFX", "lowres"), "none", kGfxDisabled },
+ { _s("Standard Renderer (16bpp)"), _s("Standard (16bpp)"), "normal_16bpp", kGfxStandard16bit },
#ifndef DISABLE_FANCY_THEMES
- { _s("Antialiased Renderer (16bpp)"), "aa_16bpp", kGfxAntialias16bit }
+ { _s("Antialiased Renderer (16bpp)"), _s("Antialiased (16bpp)"), "aa_16bpp", kGfxAntialias16bit }
#endif
};
@@ -576,14 +574,26 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file) {
// First try to load localized font
_texts[textId]->_fontPtr = loadFont(localized);
- // Fallback to non-localized font
- if (!_texts[textId]->_fontPtr)
- _texts[textId]->_fontPtr = loadFont(file);
+ if (_texts[textId]->_fontPtr)
+ FontMan.assignFontToName(file, _texts[textId]->_fontPtr);
+
+ // Fallback to non-localized font and default translation
+ else {
+ // Try built-in fonts
+ _texts[textId]->_fontPtr = FontMan.getFontByName(file);
- if (!_texts[textId]->_fontPtr)
- error("Couldn't load font '%s'", file.c_str());
+ // Try to load it
+ if (!_texts[textId]->_fontPtr) {
+ _texts[textId]->_fontPtr = loadFont(file);
- FontMan.assignFontToName(file, _texts[textId]->_fontPtr);
+ if (!_texts[textId]->_fontPtr)
+ error("Couldn't load font '%s'", file.c_str());
+
+ FontMan.assignFontToName(file, _texts[textId]->_fontPtr);
+ }
+ TransMan.setLanguage("C");
+ warning("Failed to load localized font '%s'. Using non-localized font and default GUI language instead", file.c_str());
+ }
}
}
@@ -702,7 +712,7 @@ bool ThemeEngine::loadDefaultXML() {
// file inside the themes directory.
// Use the Python script "makedeftheme.py" to convert a normal XML theme
// into the "default.inc" file, which is ready to be included in the code.
-#ifdef GUI_ENABLE_BUILTIN_THEME
+#ifndef DISABLE_GUI_BUILTIN_THEME
const char *defaultXML =
#include "themes/default.inc"
;
@@ -1178,70 +1188,6 @@ void ThemeEngine::debugWidgetPosition(const char *name, const Common::Rect &r) {
_screen.vLine(r.right, r.top, r.bottom, 0xFFFF);
}
-ThemeEngine::StoredState *ThemeEngine::storeState(const Common::Rect &r) {
- StoredState *state = new StoredState;
- byte *dst;
- byte *src;
-
- state->r.top = r.top;
- state->r.bottom = r.bottom;
- state->r.left = r.left;
- state->r.right = r.right;
-
- state->r.clip(_screen.w, _screen.h);
-
- state->screen.create(state->r.width(), state->r.height(), _screen.bytesPerPixel);
- state->backBuffer.create(state->r.width(), state->r.height(), _backBuffer.bytesPerPixel);
-
- src = (byte *)_screen.getBasePtr(state->r.left, state->r.top);
- dst = (byte *)state->screen.getBasePtr(0, 0);
-
- for (int i = state->r.height(); i > 0; i--) {
- memcpy(dst, src, state->r.width() * _screen.bytesPerPixel);
- src += _screen.pitch;
- dst += state->screen.pitch;
- }
-
- src = (byte *)_backBuffer.getBasePtr(state->r.left, state->r.top);
- dst = (byte *)state->backBuffer.getBasePtr(0, 0);
-
- for (int i = state->r.height(); i > 0; i--) {
- memcpy(dst, src, state->r.width() * _backBuffer.bytesPerPixel);
- src += _backBuffer.pitch;
- dst += state->backBuffer.pitch;
- }
-
- return state;
-}
-
-void ThemeEngine::restoreState(StoredState *state) {
- byte *dst;
- byte *src;
-
- if (!state)
- return;
-
- src = (byte *)state->screen.getBasePtr(0, 0);
- dst = (byte *)_screen.getBasePtr(state->r.left, state->r.top);
-
- for (int i = state->r.height(); i > 0; i--) {
- memcpy(dst, src, state->r.width() * _screen.bytesPerPixel);
- src += state->screen.pitch;
- dst += _screen.pitch;
- }
-
- src = (byte *)state->backBuffer.getBasePtr(0, 0);
- dst = (byte *)_backBuffer.getBasePtr(state->r.left, state->r.top);
-
- for (int i = state->r.height(); i > 0; i--) {
- memcpy(dst, src, state->r.width() * _backBuffer.bytesPerPixel);
- src += state->backBuffer.pitch;
- dst += _backBuffer.pitch;
- }
-
- addDirtyRect(state->r);
-}
-
/**********************************************************
* Screen/overlay management
*********************************************************/
@@ -1647,7 +1593,7 @@ struct TDComparator {
} // end of anonymous namespace
void ThemeEngine::listUsableThemes(Common::List<ThemeDescriptor> &list) {
-#ifdef GUI_ENABLE_BUILTIN_THEME
+#ifndef DISABLE_GUI_BUILTIN_THEME
ThemeDescriptor th;
th.name = "ScummVM Classic Theme (Builtin Version)";
th.id = "builtin";
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index e9ca1a919d..948ef21023 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -240,6 +240,7 @@ public:
struct Renderer {
const char *name;
+ const char *shortname;
const char *cfg;
GraphicsMode mode;
};
@@ -265,17 +266,6 @@ public:
void enable();
void disable();
- struct StoredState {
- Common::Rect r;
- Graphics::Surface screen;
- Graphics::Surface backBuffer;
-
- StoredState() {}
- };
-
- StoredState *storeState(const Common::Rect &r);
- void restoreState(StoredState *state);
-
/**
* Implementation of the GUI::Theme API. Called when a
* new dialog is opened. Note that the boolean parameter
diff --git a/gui/ThemeEval.h b/gui/ThemeEval.h
index c484a49564..ac867512da 100644
--- a/gui/ThemeEval.h
+++ b/gui/ThemeEval.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef GUI_THEME_EVAL
-#define GUI_THEME_EVAL
+#ifndef GUI_THEME_EVAL_H
+#define GUI_THEME_EVAL_H
#include "common/scummsys.h"
#include "common/hashmap.h"
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index c809447cbd..b9a0c583b0 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -144,7 +144,7 @@ Graphics::DrawStep *ThemeParser::defaultDrawStep() {
Graphics::DrawStep *ThemeParser::newDrawStep() {
assert(_defaultStepGlobal);
- Graphics::DrawStep *step = 0 ; //new DrawStep;
+ Graphics::DrawStep *step = 0; //new DrawStep;
if (_defaultStepLocal) {
step = new Graphics::DrawStep(*_defaultStepLocal);
diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
index 64c34688df..272fa66072 100644
--- a/gui/Tooltip.cpp
+++ b/gui/Tooltip.cpp
@@ -34,7 +34,7 @@
namespace GUI {
-Tooltip::Tooltip() :
+Tooltip::Tooltip() :
Dialog(-1, -1, -1, -1), _maxWidth(-1) {
_backgroundType = GUI::ThemeEngine::kDialogBackgroundTooltip;
@@ -69,7 +69,7 @@ bool Tooltip::tooltipModal(int x, int y) {
_h = (tooltipFont->getFontHeight() + 2) * _wrappedLines.size();
_x = MIN<int16>(g_gui.getTopDialog()->_x + x + _xdelta, g_gui.getWidth() - _w - 3);
- _y = MIN<int16>(g_gui.getTopDialog()->_y + y + _ydelta, g_gui.getHeight() - _h - 3);
+ _y = MIN<int16>(g_gui.getTopDialog()->_y + y + _ydelta, g_gui.getHeight() - _h - 3);
open();
g_gui.runLoop();
@@ -85,14 +85,14 @@ void Tooltip::drawDialog() {
for (Common::StringArray::const_iterator i = _wrappedLines.begin(); i != _wrappedLines.end(); ++i, ++num) {
g_gui.theme()->drawText(
- Common::Rect(_x + 1, _y + 1 + num * h, _x + 1 +_w, _y + 1+ (num + 1) * h), *i,
- ThemeEngine::kStateEnabled,
- Graphics::kTextAlignLeft,
- ThemeEngine::kTextInversionNone,
+ Common::Rect(_x + 1, _y + 1 + num * h, _x + 1 +_w, _y + 1+ (num + 1) * h), *i,
+ ThemeEngine::kStateEnabled,
+ Graphics::kTextAlignLeft,
+ ThemeEngine::kTextInversionNone,
0,
- false,
- ThemeEngine::kFontStyleTooltip,
- ThemeEngine::kFontColorNormal,
+ false,
+ ThemeEngine::kFontStyleTooltip,
+ ThemeEngine::kFontColorNormal,
false
);
}
diff --git a/gui/Tooltip.h b/gui/Tooltip.h
index 60f3cf3a19..02eb01d0d0 100644
--- a/gui/Tooltip.h
+++ b/gui/Tooltip.h
@@ -33,7 +33,7 @@ class Tooltip : public Dialog {
public:
Tooltip();
~Tooltip() {}
-
+
void drawDialog();
bool tooltipModal(int x, int y);
void mustClose();
@@ -44,7 +44,8 @@ protected:
int _xdelta, _ydelta;
Common::StringArray _wrappedLines;
-};
-}
+};
+
+} // End of namespace GUI
-#endif
+#endif // GUI_TOOLTIP_H
diff --git a/gui/browser.cpp b/gui/browser.cpp
index 0d95e5397b..6a9d3d05b5 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -66,7 +66,10 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
_backgroundType = GUI::ThemeEngine::kDialogBackgroundPlain;
// Buttons
- new ButtonWidget(this, "Browser.Up", _("Go up"), _("Go to previous directory level"), kGoUpCmd);
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(this, "Browser.Up", _("Go up"), _("Go to previous directory level"), kGoUpCmd);
+ else
+ new ButtonWidget(this, "Browser.Up", _c("Go up", "lowres"), _("Go to previous directory level"), kGoUpCmd);
new ButtonWidget(this, "Browser.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "Browser.Choose", _("Choose"), 0, kChooseCmd);
}
diff --git a/gui/credits.h b/gui/credits.h
index bd4ecffc9b..b469645217 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -544,6 +544,8 @@ static const char *credits[] = {
"C2""For the original Gobliiins ADL player",
"C0""Ivan Dubrov",
"C2""For contributing the initial version of the Gobliiins engine",
+"C0""Henrik Engqvist",
+"C2""For generously providing hosting for our buildbot, SVN repository, planet and doxygen sites as well as tons of HD space",
"C0""DOSBox Team",
"C2""For their awesome OPL2 and OPL3 emulator",
"C0""Till Kresslein",
@@ -574,5 +576,9 @@ static const char *credits[] = {
"C0""",
"C0""John Young, Colin Smythe and especially Terry Pratchett himself for sharing the source code of Discworld I & II with us.",
"C0""",
+"C0""Emilio de Paz Aragon from Alcachofa Soft for sharing the source code of Drascula: The Vampire Strikes Back with us and his generosity with freewaring the game.",
+"C0""",
+"C0""David P. Gray from Gray Design Associate for sharing the source code of the Hugo trilogy.",
+"C0""",
"",
};
diff --git a/gui/editable.cpp b/gui/editable.cpp
index 755e34e380..1ebe307bb0 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -48,6 +48,7 @@ void EditableWidget::init() {
_editScrollOffset = 0;
_font = ThemeEngine::kFontStyleBold;
+ _inversion = ThemeEngine::kTextInversionNone;
}
EditableWidget::~EditableWidget() {
@@ -237,7 +238,7 @@ void EditableWidget::drawCaret(bool erase) {
Common::Rect editRect = getEditRect();
int x = editRect.left;
- int y = editRect.top + 1;
+ int y = editRect.top;
x += getCaretOffset();
@@ -253,7 +254,7 @@ void EditableWidget::drawCaret(bool erase) {
if ((uint)_caretPos < _editString.size()) {
GUI::EditableWidget::String chr(_editString[_caretPos]);
int chrWidth = g_gui.getCharWidth(_editString[_caretPos], _font);
- g_gui.theme()->drawText(Common::Rect(x, y, x + chrWidth, y + editRect.height() - 2), chr, _state, Graphics::kTextAlignLeft, ThemeEngine::kTextInversionNone, 0, false, _font);
+ g_gui.theme()->drawText(Common::Rect(x, y, x + chrWidth, y + editRect.height() - 2), chr, _state, Graphics::kTextAlignLeft, _inversion, 0, false, _font);
}
}
diff --git a/gui/editable.h b/gui/editable.h
index 8ff5298511..4a2d98349e 100644
--- a/gui/editable.h
+++ b/gui/editable.h
@@ -54,6 +54,8 @@ protected:
ThemeEngine::FontStyle _font;
+ ThemeEngine::TextInversionState _inversion;
+
public:
EditableWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0);
EditableWidget(GuiObject *boss, const String &name, const char *tooltip = 0, uint32 cmd = 0);
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index d50e7ce578..63d3ba6954 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -172,11 +172,17 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
tab->addTab(_("Game"));
// GUI: Label & edit widget for the game ID
- new StaticTextWidget(tab, "GameOptions_Game.Id", _("ID:"), _("Short game identifier used for referring to savegames and running the game from the command line"));
+ if (g_system->getOverlayWidth() > 320)
+ new StaticTextWidget(tab, "GameOptions_Game.Id", _("ID:"), _("Short game identifier used for referring to savegames and running the game from the command line"));
+ else
+ new StaticTextWidget(tab, "GameOptions_Game.Id", _c("ID:", "lowres"), _("Short game identifier used for referring to savegames and running the game from the command line"));
_domainWidget = new DomainEditTextWidget(tab, "GameOptions_Game.Domain", _domain, _("Short game identifier used for referring to savegames and running the game from the command line"));
// GUI: Label & edit widget for the description
- new StaticTextWidget(tab, "GameOptions_Game.Name", _("Name:"), _("Full title of the game"));
+ if (g_system->getOverlayWidth() > 320)
+ new StaticTextWidget(tab, "GameOptions_Game.Name", _("Name:"), _("Full title of the game"));
+ else
+ new StaticTextWidget(tab, "GameOptions_Game.Name", _c("Name:", "lowres"), _("Full title of the game"));
_descriptionWidget = new EditTextWidget(tab, "GameOptions_Game.Desc", description, _("Full title of the game"));
// Language popup
@@ -191,7 +197,10 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
// Platform popup
- _platformPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.PlatformPopupDesc", _("Platform:"), _("Platform the game was originally designed for"));
+ if (g_system->getOverlayWidth() > 320)
+ _platformPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.PlatformPopupDesc", _("Platform:"), _("Platform the game was originally designed for"));
+ else
+ _platformPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.PlatformPopupDesc", _c("Platform:", "lowres"), _("Platform the game was originally designed for"));
_platformPopUp = new PopUpWidget(tab, "GameOptions_Game.PlatformPopup", _("Platform the game was originally designed for"));
_platformPopUp->appendEntry(_("<default>"));
_platformPopUp->appendEntry("");
@@ -205,7 +214,10 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
- _globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", _("Override global graphic settings"), 0, kCmdGlobalGraphicsOverride);
+ if (g_system->getOverlayWidth() > 320)
+ _globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", _("Override global graphic settings"), 0, kCmdGlobalGraphicsOverride);
+ else
+ _globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", _c("Override global graphic settings", "lowres"), 0, kCmdGlobalGraphicsOverride);
addGraphicControls(tab, "GameOptions_Graphics.");
@@ -214,7 +226,10 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
tab->addTab(_("Audio"));
- _globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _("Override global audio settings"), 0, kCmdGlobalAudioOverride);
+ if (g_system->getOverlayWidth() > 320)
+ _globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _("Override global audio settings"), 0, kCmdGlobalAudioOverride);
+ else
+ _globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _c("Override global audio settings", "lowres"), 0, kCmdGlobalAudioOverride);
addAudioControls(tab, "GameOptions_Audio.");
addSubtitleControls(tab, "GameOptions_Audio.");
@@ -222,9 +237,15 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
// 4) The volume tab
//
- tab->addTab(_("Volume"));
+ if (g_system->getOverlayWidth() > 320)
+ tab->addTab(_("Volume"));
+ else
+ tab->addTab(_c("Volume", "lowres"));
- _globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _("Override global volume settings"), 0, kCmdGlobalVolumeOverride);
+ if (g_system->getOverlayWidth() > 320)
+ _globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _("Override global volume settings"), 0, kCmdGlobalVolumeOverride);
+ else
+ _globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _c("Override global volume settings", "lowres"), 0, kCmdGlobalVolumeOverride);
addVolumeControls(tab, "GameOptions_Volume.");
@@ -233,7 +254,10 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
tab->addTab(_("MIDI"));
- _globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _("Override global MIDI settings"), 0, kCmdGlobalMIDIOverride);
+ if (g_system->getOverlayWidth() > 320)
+ _globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _("Override global MIDI settings"), 0, kCmdGlobalMIDIOverride);
+ else
+ _globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _c("Override global MIDI settings", "lowres"), 0, kCmdGlobalMIDIOverride);
if (_guioptions & Common::GUIO_NOMIDI)
_globalMIDIOverride->setEnabled(false);
@@ -245,7 +269,10 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
tab->addTab(_("MT-32"));
- _globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _("Override global MT-32 settings"), 0, kCmdGlobalMT32Override);
+ if (g_system->getOverlayWidth() > 320)
+ _globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _("Override global MT-32 settings"), 0, kCmdGlobalMT32Override);
+ else
+ _globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _c("Override global MT-32 settings", "lowres"), 0, kCmdGlobalMT32Override);
//if (_guioptions & Common::GUIO_NOMIDI)
// _globalMT32Override->setEnabled(false);
@@ -255,21 +282,33 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
// 7) The Paths tab
//
- tab->addTab(_("Paths"));
+ if (g_system->getOverlayWidth() > 320)
+ tab->addTab(_("Paths"));
+ else
+ tab->addTab(_c("Paths", "lowres"));
// These buttons have to be extra wide, or the text will be truncated
// in the small version of the GUI.
// GUI: Button + Label for the game path
- new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _("Game Path:"), 0, kCmdGameBrowser);
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _("Game Path:"), 0, kCmdGameBrowser);
+ else
+ new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _c("Game Path:", "lowres"), 0, kCmdGameBrowser);
_gamePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.GamepathText", gamePath);
// GUI: Button + Label for the additional path
- new ButtonWidget(tab, "GameOptions_Paths.Extrapath", _("Extra Path:"), _("Specifies path to additional data used the game"), kCmdExtraBrowser);
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(tab, "GameOptions_Paths.Extrapath", _("Extra Path:"), _("Specifies path to additional data used the game"), kCmdExtraBrowser);
+ else
+ new ButtonWidget(tab, "GameOptions_Paths.Extrapath", _c("Extra Path:", "lowres"), _("Specifies path to additional data used the game"), kCmdExtraBrowser);
_extraPathWidget = new StaticTextWidget(tab, "GameOptions_Paths.ExtrapathText", extraPath, _("Specifies path to additional data used the game"));
// GUI: Button + Label for the save path
- new ButtonWidget(tab, "GameOptions_Paths.Savepath", _("Save Path:"), _("Specifies where your savegames are put"), kCmdSaveBrowser);
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(tab, "GameOptions_Paths.Savepath", _("Save Path:"), _("Specifies where your savegames are put"), kCmdSaveBrowser);
+ else
+ new ButtonWidget(tab, "GameOptions_Paths.Savepath", _c("Save Path:", "lowres"), _("Specifies where your savegames are put"), kCmdSaveBrowser);
_savePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.SavepathText", savePath, _("Specifies where your savegames are put"));
// Activate the first tab
@@ -286,7 +325,7 @@ void EditGameDialog::open() {
String extraPath(ConfMan.get("extrapath", _domain));
if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
- _extraPathWidget->setLabel(_("None"));
+ _extraPathWidget->setLabel(_c("None", "path"));
}
String savePath(ConfMan.get("savepath", _domain));
@@ -366,7 +405,7 @@ void EditGameDialog::close() {
ConfMan.set("path", gamePath, _domain);
String extraPath(_extraPathWidget->getLabel());
- if (!extraPath.empty() && (extraPath != _("None")))
+ if (!extraPath.empty() && (extraPath != _c("None", "path")))
ConfMan.set("extrapath", extraPath, _domain);
String savePath(_savePathWidget->getLabel());
@@ -415,7 +454,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
Common::FSNode file(browser.getResult());
_soundFont->setLabel(file.getPath());
- if (!file.getPath().empty() && (file.getPath() != _("None")))
+ if (!file.getPath().empty() && (file.getPath() != _c("None", "path")))
_soundFontClearButton->setEnabled(true);
else
_soundFontClearButton->setEnabled(false);
@@ -527,12 +566,21 @@ LauncherDialog::LauncherDialog()
new ButtonWidget(this, "Launcher.LoadGameButton", _("~L~oad..."), _("Load savegame for selected game"), kLoadGameCmd);
// Above the lowest button rows: two more buttons (directly below the list box)
- _addButton =
- new ButtonWidget(this, "Launcher.AddGameButton", _("~A~dd Game..."), _("Hold Shift for Mass Add"), kAddGameCmd);
- _editButton =
- new ButtonWidget(this, "Launcher.EditGameButton", _("~E~dit Game..."), _("Change game options"), kEditGameCmd);
- _removeButton =
- new ButtonWidget(this, "Launcher.RemoveGameButton", _("~R~emove Game"), _("Remove game from the list. The game data files stay intact"), kRemoveGameCmd);
+ if (g_system->getOverlayWidth() > 320) {
+ _addButton =
+ new ButtonWidget(this, "Launcher.AddGameButton", _("~A~dd Game..."), _("Hold Shift for Mass Add"), kAddGameCmd);
+ _editButton =
+ new ButtonWidget(this, "Launcher.EditGameButton", _("~E~dit Game..."), _("Change game options"), kEditGameCmd);
+ _removeButton =
+ new ButtonWidget(this, "Launcher.RemoveGameButton", _("~R~emove Game"), _("Remove game from the list. The game data files stay intact"), kRemoveGameCmd);
+ } else {
+ _addButton =
+ new ButtonWidget(this, "Launcher.AddGameButton", _c("~A~dd Game...", "lowres"), _("Hold Shift for Mass Add"), kAddGameCmd);
+ _editButton =
+ new ButtonWidget(this, "Launcher.EditGameButton", _c("~E~dit Game...", "lowres"), _("Change game options"), kEditGameCmd);
+ _removeButton =
+ new ButtonWidget(this, "Launcher.RemoveGameButton", _c("~R~emove Game", "lowres"), _("Remove game from the list. The game data files stay intact"), kRemoveGameCmd);
+ }
// Search box
_searchDesc = 0;
@@ -1005,9 +1053,11 @@ void LauncherDialog::updateButtons() {
// Update the label of the "Add" button depending on whether shift is pressed or not
int modifiers = g_system->getEventManager()->getModifierState();
const bool massAdd = (modifiers & Common::KBD_SHIFT) != 0;
+ const bool lowRes = g_system->getOverlayWidth() <= 320;
+
const char *newAddButtonLabel = massAdd
- ? _("Mass Add...")
- : _("Add Game...");
+ ? (lowRes ? _c("Mass Add...", "lowres") : _("Mass Add..."))
+ : (lowRes ? _c("Add Game...", "lowres") : _("Add Game..."));
if (_addButton->getLabel() != newAddButtonLabel)
_addButton->setLabel(newAddButtonLabel);
diff --git a/gui/message.cpp b/gui/message.cpp
index 6406976569..06b4524eab 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -58,7 +58,11 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB
int maxlineWidth = g_gui.getFont().wordWrapText(message, screenW - 2 * 20, lines);
// Calculate the desired dialog size (maxing out at 300*180 for now)
- _w = maxlineWidth + 20;
+ if (altButton)
+ _w = MAX(maxlineWidth, (2 * buttonWidth) + 10) + 20;
+ else
+ _w = MAX(maxlineWidth, buttonWidth) + 20;
+
lineCount = lines.size();
_h = 16;
diff --git a/gui/options.cpp b/gui/options.cpp
index 4969f8ef3f..e7888cf095 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -227,7 +227,7 @@ void OptionsDialog::open() {
Common::String soundFont(ConfMan.get("soundfont", _domain));
if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) {
- _soundFont->setLabel(_("None"));
+ _soundFont->setLabel(_c("None", "soundfont"));
_soundFontClearButton->setEnabled(false);
} else {
_soundFont->setLabel(soundFont);
@@ -396,7 +396,7 @@ void OptionsDialog::close() {
ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain);
Common::String soundFont(_soundFont->getLabel());
- if (!soundFont.empty() && (soundFont != _("None")))
+ if (!soundFont.empty() && (soundFont != _c("None", "soundfont")))
ConfMan.set("soundfont", soundFont, _domain);
else
ConfMan.removeKey("soundfont", _domain);
@@ -494,7 +494,7 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
_subSpeedLabel->draw();
break;
case kClearSoundFontCmd:
- _soundFont->setLabel(_("None"));
+ _soundFont->setLabel(_c("None", "soundfont"));
_soundFontClearButton->setEnabled(false);
draw();
break;
@@ -552,7 +552,7 @@ void OptionsDialog::setMIDISettingsState(bool enabled) {
_soundFontButton->setEnabled(enabled);
_soundFont->setEnabled(enabled);
- if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _("None")))
+ if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _c("None", "soundfont")))
_soundFontClearButton->setEnabled(enabled);
else
_soundFontClearButton->setEnabled(false);
@@ -627,6 +627,9 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) {
void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &prefix) {
const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
+ Common::String context;
+ if (g_system->getOverlayWidth() <= 320)
+ context = "lowres";
// The GFX mode popup
_gfxPopUpDesc = new StaticTextWidget(boss, prefix + "grModePopupDesc", _("Graphics mode:"));
@@ -635,7 +638,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
_gfxPopUp->appendEntry(_("<default>"));
_gfxPopUp->appendEntry("");
while (gm->name) {
- _gfxPopUp->appendEntry(_(gm->description), gm->id);
+ _gfxPopUp->appendEntry(_c(gm->description, context), gm->id);
gm++;
}
@@ -646,7 +649,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
_renderModePopUp->appendEntry("");
const Common::RenderModeDescription *rm = Common::g_renderModes;
for (; rm->code; ++rm) {
- _renderModePopUp->appendEntry(_(rm->description), rm->id);
+ _renderModePopUp->appendEntry(_c(rm->description, context), rm->id);
}
// Fullscreen checkbox
@@ -660,7 +663,10 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &prefix) {
// The MIDI mode popup & a label
- _midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", _domain == Common::ConfigManager::kApplicationDomain ? _("Preferred Device:") : _("Music Device:"), _domain == Common::ConfigManager::kApplicationDomain ? _("Specifies preferred sound device or sound card emulator") : _("Specifies output sound device or sound card emulator"));
+ if (g_system->getOverlayWidth() > 320)
+ _midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", _domain == Common::ConfigManager::kApplicationDomain ? _("Preferred Device:") : _("Music Device:"), _domain == Common::ConfigManager::kApplicationDomain ? _("Specifies preferred sound device or sound card emulator") : _("Specifies output sound device or sound card emulator"));
+ else
+ _midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", _domain == Common::ConfigManager::kApplicationDomain ? _c("Preferred Dev.:", "lowres") : _c("Music Device:", "lowres"), _domain == Common::ConfigManager::kApplicationDomain ? _("Specifies preferred sound device or sound card emulator") : _("Specifies output sound device or sound card emulator"));
_midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", _("Specifies output sound device or sound card emulator"));
// Populate it
@@ -729,8 +735,11 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
}
// SoundFont
- _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd);
- _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"));
+ if (g_system->getOverlayWidth() > 320)
+ _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd);
+ else
+ _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _c("SoundFont:", "lowres"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd);
+ _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _c("None", "soundfont"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"));
_soundFontClearButton = new ButtonWidget(boss, prefix + "mcFontClearButton", "C", _("Clear value"), kClearSoundFontCmd);
// Multi midi setting
@@ -751,7 +760,10 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi
_mt32DevicePopUp = new PopUpWidget(boss, prefix + "auPrefMt32Popup");
// Native mt32 setting
- _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer"));
+ if (g_system->getOverlayWidth() > 320)
+ _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer"));
+ else
+ _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _c("True Roland MT-32 (no GM emulation)", "lowres"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer"));
// GS Extensions setting
_enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), _("Turns off General MIDI mapping for games with Roland MT-32 soundtrack"));
@@ -778,24 +790,29 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi
// make use of the widgets. The launcher range is 0-255. SCUMM's 0-9
void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal) {
- _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _("Text and Speech:"));
-
if (g_system->getOverlayWidth() > 320) {
+ _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _("Text and Speech:"));
+
_subToggleGroup = new RadiobuttonGroup(boss, kSubtitleToggle);
_subToggleSpeechOnly = new RadiobuttonWidget(boss, prefix + "subToggleSpeechOnly", _subToggleGroup, kSubtitlesSpeech, _("Speech"));
_subToggleSubOnly = new RadiobuttonWidget(boss, prefix + "subToggleSubOnly", _subToggleGroup, kSubtitlesSubs, _("Subtitles"));
_subToggleSubBoth = new RadiobuttonWidget(boss, prefix + "subToggleSubBoth", _subToggleGroup, kSubtitlesBoth, _("Both"));
+
+ _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _("Subtitle speed:"));
} else {
+ _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _c("Text and Speech:", "lowres"));
+
_subToggleGroup = new RadiobuttonGroup(boss, kSubtitleToggle);
_subToggleSpeechOnly = new RadiobuttonWidget(boss, prefix + "subToggleSpeechOnly", _subToggleGroup, kSubtitlesSpeech, _("Spch"), _("Speech"));
_subToggleSubOnly = new RadiobuttonWidget(boss, prefix + "subToggleSubOnly", _subToggleGroup, kSubtitlesSubs, _("Subs"), _("Subtitles"));
- _subToggleSubBoth = new RadiobuttonWidget(boss, prefix + "subToggleSubBoth", _subToggleGroup, kSubtitlesBoth, _("Both"), _("Show subtitles and play speech"));
+ _subToggleSubBoth = new RadiobuttonWidget(boss, prefix + "subToggleSubBoth", _subToggleGroup, kSubtitlesBoth, _c("Both", "lowres"), _("Show subtitles and play speech"));
+
+ _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _c("Subtitle speed:", "lowres"));
}
// Subtitle speed
- _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _("Subtitle speed:"));
_subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", 0, kSubtitleSpeedChanged);
_subSpeedLabel = new StaticTextWidget(boss, prefix + "subSubtitleSpeedLabel", "100%");
_subSpeedSlider->setMinValue(0); _subSpeedSlider->setMaxValue(maxSliderVal);
@@ -807,7 +824,10 @@ void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &p
void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &prefix) {
// Volume controllers
- _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:"));
+ if (g_system->getOverlayWidth() > 320)
+ _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:"));
+ else
+ _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _c("Music volume:", "lowres"));
_musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", 0, kMusicVolumeChanged);
_musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", "100%");
_musicVolumeSlider->setMinValue(0);
@@ -816,15 +836,20 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", _("Mute All"), 0, kMuteAllChanged);
-
- _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"), _("Special sound effects volume"));
+ if (g_system->getOverlayWidth() > 320)
+ _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"), _("Special sound effects volume"));
+ else
+ _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _c("SFX volume:", "lowres"), _("Special sound effects volume"));
_sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", _("Special sound effects volume"), kSfxVolumeChanged);
_sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%");
_sfxVolumeSlider->setMinValue(0);
_sfxVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
- _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:"));
+ if (g_system->getOverlayWidth() > 320)
+ _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:"));
+ else
+ _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _c("Speech volume:", "lowres"));
_speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", 0, kSpeechVolumeChanged);
_speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", "100%");
_speechVolumeSlider->setMinValue(0);
@@ -923,7 +948,10 @@ GlobalOptionsDialog::GlobalOptionsDialog()
addAudioControls(tab, "GlobalOptions_Audio.");
addSubtitleControls(tab, "GlobalOptions_Audio.");
- tab->addTab(_("Volume"));
+ if (g_system->getOverlayWidth() > 320)
+ tab->addTab(_("Volume"));
+ else
+ tab->addTab(_c("Volume", "lowres"));
addVolumeControls(tab, "GlobalOptions_Volume.");
// TODO: cd drive setting
@@ -943,32 +971,50 @@ GlobalOptionsDialog::GlobalOptionsDialog()
//
// 5) The Paths tab
//
- tab->addTab(_("Paths"));
+ if (g_system->getOverlayWidth() > 320)
+ tab->addTab(_("Paths"));
+ else
+ tab->addTab(_c("Paths", "lowres"));
#if !( defined(__DC__) || defined(__GP32__) )
// These two buttons have to be extra wide, or the text will be
// truncated in the small version of the GUI.
// Save game path
- new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _("Save Path: "), _("Specifies where your savegames are put"), kChooseSaveDirCmd);
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _("Save Path:"), _("Specifies where your savegames are put"), kChooseSaveDirCmd);
+ else
+ new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _c("Save Path:", "lowres"), _("Specifies where your savegames are put"), kChooseSaveDirCmd);
_savePath = new StaticTextWidget(tab, "GlobalOptions_Paths.SavePath", "/foo/bar", _("Specifies where your savegames are put"));
- new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), 0, kChooseThemeDirCmd);
- _themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _("None"));
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), 0, kChooseThemeDirCmd);
+ else
+ new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _c("Theme Path:", "lowres"), 0, kChooseThemeDirCmd);
+ _themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _c("None", "path"));
- new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
- _extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _("None"), _("Specifies path to additional data used by all games or ScummVM"));
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
+ else
+ new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _c("Extra Path:", "lowres"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd);
+ _extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _c("None", "path"), _("Specifies path to additional data used by all games or ScummVM"));
#ifdef DYNAMIC_MODULES
- new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), 0, kChoosePluginsDirCmd);
- _pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _("None"));
+ if (g_system->getOverlayWidth() > 320)
+ new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), 0, kChoosePluginsDirCmd);
+ else
+ new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _c("Plugins Path:", "lowres"), 0, kChoosePluginsDirCmd);
+ _pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _c("None", "path"));
#endif
#endif
//
// 6) The miscellaneous tab
//
- tab->addTab(_("Misc"));
+ if (g_system->getOverlayWidth() > 320)
+ tab->addTab(_("Misc"));
+ else
+ tab->addTab(_c("Misc", "lowres"));
new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), 0, kChooseThemeCmd);
_curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName());
@@ -977,10 +1023,18 @@ GlobalOptionsDialog::GlobalOptionsDialog()
_rendererPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.RendererPopupDesc", _("GUI Renderer:"));
_rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.RendererPopup");
- for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
- _rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].name), GUI::ThemeEngine::_rendererModes[i].mode);
+ if (g_system->getOverlayWidth() > 320) {
+ for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
+ _rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].name), GUI::ThemeEngine::_rendererModes[i].mode);
+ } else {
+ for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
+ _rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].shortname), GUI::ThemeEngine::_rendererModes[i].mode);
+ }
- _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _("Autosave:"));
+ if (g_system->getOverlayWidth() > 320)
+ _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _("Autosave:"));
+ else
+ _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _c("Autosave:", "lowres"));
_autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopup");
for (int i = 0; savePeriodLabels[i]; i++) {
@@ -1000,7 +1054,7 @@ GlobalOptionsDialog::GlobalOptionsDialog()
#ifdef USE_DETECTLANG
_guiLanguagePopUp->appendEntry(_("<default>"), Common::kTranslationAutodetectId);
#endif // USE_DETECTLANG
- _guiLanguagePopUp->appendEntry(_("English"), Common::kTranslationBuiltinId);
+ _guiLanguagePopUp->appendEntry("English", Common::kTranslationBuiltinId);
_guiLanguagePopUp->appendEntry("", 0);
Common::TLangArray languages = TransMan.getSupportedLanguageNames();
Common::TLangArray::iterator lang = languages.begin();
@@ -1051,19 +1105,19 @@ void GlobalOptionsDialog::open() {
Common::String extraPath(ConfMan.get("extrapath", _domain));
if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
- _savePath->setLabel(_("None"));
+ _savePath->setLabel(_c("None", "path"));
} else {
_savePath->setLabel(savePath);
}
if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) {
- _themePath->setLabel(_("None"));
+ _themePath->setLabel(_c("None", "path"));
} else {
_themePath->setLabel(themePath);
}
if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
- _extraPath->setLabel(_("None"));
+ _extraPath->setLabel(_c("None", "path"));
} else {
_extraPath->setLabel(extraPath);
}
@@ -1071,7 +1125,7 @@ void GlobalOptionsDialog::open() {
#ifdef DYNAMIC_MODULES
Common::String pluginsPath(ConfMan.get("pluginspath", _domain));
if (pluginsPath.empty() || !ConfMan.hasKey("pluginspath", _domain)) {
- _pluginsPath->setLabel(_("None"));
+ _pluginsPath->setLabel(_c("None", "path"));
} else {
_pluginsPath->setLabel(pluginsPath);
}
@@ -1095,24 +1149,24 @@ void GlobalOptionsDialog::open() {
void GlobalOptionsDialog::close() {
if (getResult()) {
Common::String savePath(_savePath->getLabel());
- if (!savePath.empty() && (savePath != _("None")))
+ if (!savePath.empty() && (savePath != _c("None", "path")))
ConfMan.set("savepath", savePath, _domain);
Common::String themePath(_themePath->getLabel());
- if (!themePath.empty() && (themePath != _("None")))
+ if (!themePath.empty() && (themePath != _c("None", "path")))
ConfMan.set("themepath", themePath, _domain);
else
ConfMan.removeKey("themepath", _domain);
Common::String extraPath(_extraPath->getLabel());
- if (!extraPath.empty() && (extraPath != _("None")))
+ if (!extraPath.empty() && (extraPath != _c("None", "path")))
ConfMan.set("extrapath", extraPath, _domain);
else
ConfMan.removeKey("extrapath", _domain);
#ifdef DYNAMIC_MODULES
Common::String pluginsPath(_pluginsPath->getLabel());
- if (!pluginsPath.empty() && (pluginsPath != _("None")))
+ if (!pluginsPath.empty() && (pluginsPath != _c("None", "path")))
ConfMan.set("pluginspath", pluginsPath, _domain);
else
ConfMan.removeKey("pluginspath", _domain);
@@ -1211,7 +1265,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
Common::FSNode file(browser.getResult());
_soundFont->setLabel(file.getPath());
- if (!file.getPath().empty() && (file.getPath() != _("None")))
+ if (!file.getPath().empty() && (file.getPath() != _c("None", "path")))
_soundFontClearButton->setEnabled(true);
else
_soundFontClearButton->setEnabled(false);
@@ -1227,9 +1281,21 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
Common::String theme = browser.getSelected();
// FIXME: Actually, any changes (including the theme change) should
// only become active *after* the options dialog has closed.
+ Common::String lang = TransMan.getCurrentLanguage();
+ Common::String oldTheme = g_gui.theme()->getThemeId();
if (g_gui.loadNewTheme(theme)) {
- _curTheme->setLabel(g_gui.theme()->getThemeName());
- ConfMan.set("gui_theme", theme);
+ // If the charset has changed, it means the font were not found for the
+ // new theme. Since for the moment we do not support change of translation
+ // language without restarting, we let the user know about this.
+ if (lang != TransMan.getCurrentLanguage()) {
+ TransMan.setLanguage(lang.c_str());
+ g_gui.loadNewTheme(oldTheme);
+ MessageDialog error(_("The theme you selected does not support your current language. If you want to use this theme you need to switch to another language first."));
+ error.runModal();
+ } else {
+ _curTheme->setLabel(g_gui.theme()->getThemeName());
+ ConfMan.set("gui_theme", theme);
+ }
}
draw();
}
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index 92cea00f30..3a86c5092e 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -179,7 +179,7 @@ void SaveLoadChooser::reflowLayout() {
uint16 w, h;
if (!g_gui.xmlEval()->getWidgetData("SaveLoadChooser.Thumbnail", x, y, w, h))
- error("Error when loading position data for Save/Load Thumbnails.");
+ error("Error when loading position data for Save/Load Thumbnails");
int thumbW = kThumbnailWidth;
int thumbH = kThumbnailHeight2;
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index ea7ecd733c..1023e82ff9 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 484dd15429..51f1ce6c6f 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -53,7 +53,7 @@
<def var = 'Tooltip.YDelta' value = '32'/>
<widget name = 'OptionsLabel'
- size = '110, Globals.Line.Height'
+ size = '115, Globals.Line.Height'
textalign = 'right'
/>
<widget name = 'SmallLabel'
@@ -344,7 +344,7 @@
<widget name = 'auPrefGmPopup'
type = 'PopUp'
/>
- </layout>
+ </layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'mcFontButton'
type = 'Button'
@@ -712,7 +712,7 @@
<layout type = 'vertical' padding = '24, 24, 24, 24' center = 'true'>
<widget name = 'vcMuteCheckbox'
type = 'Checkbox'
- width = '80' <!-- FIXME: Why this is needed? -->
+ width = '120' <!-- FIXME: Why this is needed? -->
/>
</layout>
</layout>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 5998c50b60..bd7b5fd8ea 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -483,7 +483,7 @@
</dialog>
<dialog name = 'GameOptions' overlays = 'screen' inset = '16' shading = 'dim'>
- <layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '16'>
+ <layout type = 'vertical' padding = '0, 0, 0, 0'>
<widget name = 'TabWidget'/>
<layout type = 'horizontal' padding = '8, 8, 8, 8'>
<space/>
diff --git a/gui/themes/scummtheme.py b/gui/themes/scummtheme.py
index 4a03c89799..e4e9549265 100755
--- a/gui/themes/scummtheme.py
+++ b/gui/themes/scummtheme.py
@@ -11,28 +11,28 @@ def buildTheme(themeName):
if not os.path.isdir(themeName) or not os.path.isfile(os.path.join(themeName, "THEMERC")):
print ("Invalid theme name: " + themeName)
return
-
+
zf = zipfile.ZipFile(themeName + ".zip", 'w')
-
+
print ("Building '" + themeName + "' theme:")
os.chdir(themeName)
-
+
zf.write('THEMERC', './THEMERC')
-
+
for filename in os.listdir('.'):
if os.path.isfile(filename) and not filename[0] == '.' and filename.endswith(THEME_FILE_EXTENSIONS):
zf.write(filename, './' + filename)
print (" Adding file: " + filename)
-
+
os.chdir('../')
-
+
zf.close()
def buildAllThemes():
for f in os.listdir('.'):
if os.path.isdir(os.path.join('.', f)) and not f[0] == '.':
buildTheme(f)
-
+
def parseSTX(theme_file, def_file):
comm = re.compile("<!--(.*?)-->", re.DOTALL)
head = re.compile("<\?(.*?)\?>")
@@ -40,33 +40,33 @@ def parseSTX(theme_file, def_file):
output = ""
for line in theme_file:
output += line.rstrip("\r\n\t ").lstrip() + " \n"
-
+
output = re.sub(comm, "", output)
output = re.sub(head, "", output)
output = output.replace("\t", " ").replace(" ", " ").replace("\"", "'")
output = output.replace(" = ", "=").replace(", ", ",")
-
+
for line in output.splitlines():
if line and not line.isspace():
def_file.write("\"" + line + "\"\n")
def buildDefTheme(themeName):
def_file = open("default.inc", "w")
-
+
if not os.path.isdir(themeName):
print ("Cannot open default theme dir.")
-
+
def_file.write(""" "<?xml version = '1.0'?>"\n""")
-
+
for filename in os.listdir(themeName):
filename = os.path.join(themeName, filename)
if os.path.isfile(filename) and filename.endswith(".stx"):
theme_file = open(filename, "r")
parseSTX(theme_file, def_file)
theme_file.close()
-
+
def_file.close()
-
+
def printUsage():
print ("===============================")
print ("ScummVM Theme Generation Script")
@@ -80,16 +80,16 @@ def printUsage():
print (" Creates a 'default.inc' file to embed the given theme in the source code.\n")
def main():
-
+
if len(sys.argv) == 2 and sys.argv[1] == "makeall":
buildAllThemes()
-
+
elif len(sys.argv) == 3 and sys.argv[1] == "make":
buildTheme(sys.argv[2])
-
+
elif len(sys.argv) == 3 and sys.argv[1] == "default":
buildDefTheme(sys.argv[2])
-
+
else:
printUsage()
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
new file mode 100644
index 0000000000..b057f2ba44
--- /dev/null
+++ b/gui/themes/translations.dat
Binary files differ