diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/TabWidget.cpp | 32 | ||||
-rw-r--r-- | gui/ThemeEval.cpp | 52 | ||||
-rw-r--r-- | gui/ThemeEval.h | 104 | ||||
-rw-r--r-- | gui/ThemeParser.cpp | 30 | ||||
-rw-r--r-- | gui/ThemeParser.h | 8 | ||||
-rw-r--r-- | gui/ThemeRenderer.cpp | 4 | ||||
-rw-r--r-- | gui/dialog.cpp | 3 | ||||
-rw-r--r-- | gui/launcher.cpp | 52 | ||||
-rw-r--r-- | gui/themes/default.inc | 2 | ||||
-rw-r--r-- | gui/themes/modern.stx | 107 | ||||
-rw-r--r-- | gui/widget.cpp | 6 |
11 files changed, 311 insertions, 89 deletions
diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp index 7ad4edbd88..3933823943 100644 --- a/gui/TabWidget.cpp +++ b/gui/TabWidget.cpp @@ -28,6 +28,8 @@ #include "gui/newgui.h" #include "gui/eval.h" +#include "gui/ThemeEval.h" + namespace GUI { enum { @@ -55,14 +57,14 @@ void TabWidget::init() { _activeTab = -1; _firstVisibleTab = 0; - _tabWidth = g_gui.evaluator()->getVar("TabWidget.tabWidth"); - _tabHeight = g_gui.evaluator()->getVar("TabWidget.tabHeight"); - _titleVPad = g_gui.evaluator()->getVar("TabWidget.titleVPad"); + _tabWidth = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Width"); + _tabHeight = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Height"); + _titleVPad = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Padding.Top"); - _butRP = g_gui.evaluator()->getVar("TabWidget.navButtonRightPad", 0); - _butTP = g_gui.evaluator()->getVar("TabWidget.navButtonTopPad", 0); - _butW = g_gui.evaluator()->getVar("TabWidget.navButtonW", 10); - _butH = g_gui.evaluator()->getVar("TabWidget.navButtonH", 10); + _butRP = g_gui.xmlEval()->getVar("Globals.TabWidget.navButtonPadding.Right", 0); + _butTP = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Padding.Top", 0); + _butW = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Width", 10); + _butH = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Height", 10); int x = _w - _butRP - _butW * 2 - 2; int y = _butTP - _tabHeight; @@ -96,7 +98,7 @@ int TabWidget::addTab(const String &title) { int numTabs = _tabs.size(); - if (g_gui.evaluator()->getVar("TabWidget.tabWidth") == 0) { + if (g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Width") == 0) { if (_tabWidth == 0) _tabWidth = 40; // Determine the new tab width @@ -216,9 +218,9 @@ void TabWidget::reflowLayout() { } } - _tabHeight = g_gui.evaluator()->getVar("TabWidget.tabHeight"); - _tabWidth = g_gui.evaluator()->getVar("TabWidget.tabWidth"); - _titleVPad = g_gui.evaluator()->getVar("TabWidget.titleVPad"); + _tabHeight = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Height"); + _tabWidth = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Width"); + _titleVPad = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Padding.Top"); if (_tabWidth == 0) { _tabWidth = 40; @@ -234,10 +236,10 @@ void TabWidget::reflowLayout() { } } - _butRP = g_gui.evaluator()->getVar("TabWidget.navButtonRightPad", 0); - _butTP = g_gui.evaluator()->getVar("TabWidget.navButtonTopPad", 0); - _butW = g_gui.evaluator()->getVar("TabWidget.navButtonW", 10); - _butH = g_gui.evaluator()->getVar("TabWidget.navButtonH", 10); + _butRP = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.PaddingRight", 0); + _butTP = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Padding.Top", 0); + _butW = g_gui.xmlEval()->getVar("GlobalsTabWidget.NavButton.Width", 10); + _butH = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Height", 10); int x = _w - _butRP - _butW * 2 - 2; int y = _butTP - _tabHeight; diff --git a/gui/ThemeEval.cpp b/gui/ThemeEval.cpp index 332dcfd841..cadaf0ba6a 100644 --- a/gui/ThemeEval.cpp +++ b/gui/ThemeEval.cpp @@ -59,9 +59,13 @@ void ThemeLayoutMain::reflowLayout() { assert(_children.size() <= 1); if (_children.size()) { + _children[0]->resetLayout(); _children[0]->setWidth(_w); _children[0]->setHeight(_h); _children[0]->reflowLayout(); + +// _children[0]->setX(_x); +// _children[0]->setY(_y); } } @@ -75,6 +79,7 @@ void ThemeLayoutVertical::reflowLayout() { for (uint i = 0; i < _children.size(); ++i) { assert(_children[i]->getLayoutType() != kLayoutVertical); + _children[i]->resetLayout(); _children[i]->reflowLayout(); if (i != _children.size() - 1) @@ -88,7 +93,7 @@ void ThemeLayoutVertical::reflowLayout() { _children[i]->setY(curY); - if (_centered) + if (_centered && _children[i]->getWidth() < _w) _children[i]->setX((_w >> 1) - (_children[i]->getWidth() >> 1)); else _children[i]->setX(curX); @@ -115,22 +120,24 @@ void ThemeLayoutHorizontal::reflowLayout() { for (uint i = 0; i < _children.size(); ++i) { assert(_children[i]->getLayoutType() != kLayoutHorizontal); + _children[i]->resetLayout(); _children[i]->reflowLayout(); if (i != _children.size() - 1) assert(_children[i]->getWidth() != -1); - - if (i == 0) - assert(_children[i]->getHeight() != -1); if (_children[i]->getHeight() == -1) - _children[i]->setHeight(_h - _paddingTop - _paddingBottom); + _children[i]->setHeight((_h == -1 ? getParentH() : _h) - _paddingTop - _paddingBottom); if (_children[i]->getWidth() == -1) _children[i]->setWidth(getParentW() - _w - _spacing); _children[i]->setX(curX); - _children[i]->setY(curY); + + if (_centered && _children[i]->getHeight() < _h) + _children[i]->setY((_h >> 1) - (_children[i]->getHeight() >> 1)); + else + _children[i]->setY(curY); if (_reverse) { for (int j = i - 1; j >= 0; --j) @@ -145,27 +152,24 @@ void ThemeLayoutHorizontal::reflowLayout() { } -void ThemeEval::addWidget(const Common::String &name, int w, int h, const Common::String &type) { - ThemeLayoutWidget *widget = new ThemeLayoutWidget(_curLayout.top(), name); - +void ThemeEval::addWidget(const Common::String &name, int w, int h, const Common::String &type, bool enabled) { int typeW = -1; int typeH = -1; if (!type.empty()) { typeW = getVar("Globals." + type + ".Width", -1); typeH = getVar("Globals." + type + ".Height", -1); - } + } - widget->setWidth(typeW == -1 ? w : typeW); - widget->setHeight(typeH == -1 ? h : typeH); + ThemeLayoutWidget *widget = new ThemeLayoutWidget(_curLayout.top(), name, + typeW == -1 ? w : typeW, + typeH == -1 ? h : typeH); _curLayout.top()->addChild(widget); + setVar(_curDialog + "." + name + ".Enabled", enabled ? 1 : 0); } -void ThemeEval::addDialog(const Common::String &name, const Common::String &overlays) { - ThemeLayout *layout = new ThemeLayoutMain(); - _layouts[name] = layout; - +void ThemeEval::addDialog(const Common::String &name, const Common::String &overlays, bool enabled) { int16 x, y; uint16 w, h; @@ -177,10 +181,8 @@ void ThemeEval::addDialog(const Common::String &name, const Common::String &over error("Error when loading dialog position for '%s'", overlays.c_str()); } - layout->setX(x); - layout->setY(y); - layout->setWidth(w); - layout->setHeight(h); + ThemeLayout *layout = new ThemeLayoutMain(x, y, w, h); + _layouts[name] = layout; layout->setPadding( getVar("Globals.Padding.Left", 0), @@ -190,6 +192,8 @@ void ThemeEval::addDialog(const Common::String &name, const Common::String &over ); _curLayout.push(layout); + _curDialog = name; + setVar(name + ".Enabled", enabled ? 1 : 0); } void ThemeEval::addLayout(ThemeLayout::LayoutType type, int spacing, bool reverse, bool center) { @@ -219,4 +223,12 @@ void ThemeEval::addSpace(int size) { _curLayout.top()->addChild(space); } +bool ThemeEval::addImportedLayout(const Common::String &name) { + if (!_layouts.contains(name)) + return false; + + _curLayout.top()->importLayout(_layouts[name]); + return true; +} + } diff --git a/gui/ThemeEval.h b/gui/ThemeEval.h index 4813892c5e..c507e8a3df 100644 --- a/gui/ThemeEval.h +++ b/gui/ThemeEval.h @@ -60,6 +60,13 @@ public: virtual void reflowLayout() = 0; + virtual void resetLayout() { + _x = 0; + _y = 0; + _w = _defaultW; + _h = _defaultH; + } + void addChild(ThemeLayout *child) { _children.push_back(child); } void setPadding(int8 left, int8 right, int8 top, int8 bottom) { @@ -154,8 +161,27 @@ public: return true; } + virtual ThemeLayout *buildCopy() = 0; + + void importLayout(ThemeLayout *layout) { + assert(layout->getLayoutType() == kLayoutMain); + + if (layout->_children.size() == 0) + return; + + layout = layout->_children[0]; + + if (getLayoutType() == layout->getLayoutType()) { + for (uint i = 0; i < layout->_children.size(); ++i) + _children.push_back(layout->_children[i]->buildCopy()); + } else { + _children.push_back(layout->buildCopy()); + } + } + protected: int16 _x, _y, _w, _h; + int16 _defaultW, _defaultH; int8 _paddingTop, _paddingBottom, _paddingLeft, _paddingRight; int8 _spacing; Common::Array<ThemeLayout*> _children; @@ -167,10 +193,28 @@ protected: class ThemeLayoutMain : public ThemeLayout { public: - ThemeLayoutMain() : ThemeLayout(0, "") {} + ThemeLayoutMain(int16 x, int16 y, int16 w, int16 h) : ThemeLayout(0, "") { + _w = _defaultW = w; + _h = _defaultH = h; + _x = _defaultX = x; + _y = _defaultY = y; + } void reflowLayout(); + + void resetLayout() { + ThemeLayout::resetLayout(); + _x = _defaultX; + _y = _defaultY; + } + const char *getName() { return "Global Layout"; } LayoutType getLayoutType() { return kLayoutMain; } + + ThemeLayout *buildCopy() { assert(!"Do not copy Main Layouts!"); return 0; } + +protected: + int16 _defaultX; + int16 _defaultY; }; class ThemeLayoutVertical : public ThemeLayout { @@ -185,6 +229,16 @@ public: void reflowLayout(); const char *getName() { return "Vertical Layout"; } LayoutType getLayoutType() { return kLayoutVertical; } + + + ThemeLayout *buildCopy() { + ThemeLayoutVertical *n = new ThemeLayoutVertical(*this); + + for (uint i = 0; i < n->_children.size(); ++ i) + n->_children[i] = n->_children[i]->buildCopy(); + + return n; + } }; class ThemeLayoutHorizontal : public ThemeLayout { @@ -199,25 +253,40 @@ public: void reflowLayout(); const char *getName() { return "Horizontal Layout"; } LayoutType getLayoutType() { return kLayoutHorizontal; } + + ThemeLayout *buildCopy() { + ThemeLayoutHorizontal *n = new ThemeLayoutHorizontal(*this); + + for (uint i = 0; i < n->_children.size(); ++ i) + n->_children[i] = n->_children[i]->buildCopy(); + + return n; + } }; class ThemeLayoutWidget : public ThemeLayout { public: - ThemeLayoutWidget(ThemeLayout *p, const Common::String &name) : ThemeLayout(p, name) {} + ThemeLayoutWidget(ThemeLayout *p, const Common::String &name, int16 w, int16 h) : ThemeLayout(p, name) { + _w = _defaultW = w; + _h = _defaultH = h; + } + bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h); void reflowLayout() {} LayoutType getLayoutType() { return kLayoutWidget; } + + ThemeLayout *buildCopy() { return new ThemeLayoutWidget(*this); } }; class ThemeLayoutSpacing : public ThemeLayout { public: ThemeLayoutSpacing(ThemeLayout *p, int size) : ThemeLayout(p, "") { if (p->getLayoutType() == kLayoutHorizontal) { - _w = size; - _h = 1; + _w = _defaultW = size; + _h = _defaultH = 1; } else if (p->getLayoutType() == kLayoutVertical) { - _w = 1; - _h = size; + _w = _defaultW = 1; + _h = _defaultH = size; } } @@ -225,6 +294,8 @@ public: void reflowLayout() {} LayoutType getLayoutType() { return kLayoutWidget; } const char *getName() { return "SPACE"; } + + ThemeLayout *buildCopy() { return new ThemeLayoutSpacing(*this); } }; class ThemeEval { @@ -238,7 +309,7 @@ public: int getVar(const Common::String &s) { if (!_vars.contains(s)) { - warning("Missing variable: '%s'", s.c_str()); + error("CRITICAL: Missing variable: '%s'", s.c_str()); return -13375; //EVAL_UNDEF_VAR } @@ -246,21 +317,17 @@ public: } int getVar(const Common::String &s, int def) { - if (_vars.contains(s)) - return _vars[s]; - - warning("Returning default value %d for '%s'", def, s.c_str()); - return def; -// return (_vars.contains(s)) ? _vars[s] : def; + return (_vars.contains(s)) ? _vars[s] : def; } void setVar(const String &name, int val) { _vars[name] = val; } bool hasVar(const Common::String &name) { return _vars.contains(name); } - void addDialog(const Common::String &name, const Common::String &overlays); + void addDialog(const Common::String &name, const Common::String &overlays, bool enabled = true); void addLayout(ThemeLayout::LayoutType type, int spacing, bool reverse, bool center = false); - void addWidget(const Common::String &name, int w, int h, const Common::String &type); + void addWidget(const Common::String &name, int w, int h, const Common::String &type, bool enabled = true); + bool addImportedLayout(const Common::String &name); void addSpace(int size); void addPadding(int16 l, int16 r, int16 t, int16 b) { @@ -268,7 +335,7 @@ public: } void closeLayout() { _curLayout.pop(); } - void closeDialog() { _curLayout.pop()->reflowLayout(); } + void closeDialog() { _curLayout.pop()->reflowLayout(); _curDialog.clear(); } bool getWidgetData(const Common::String &widget, int16 &x, int16 &y, uint16 &w, uint16 &h) { Common::StringTokenizer tokenizer(widget, "."); @@ -298,14 +365,15 @@ public: } void debugDraw(Graphics::Surface *screen, const Graphics::Font *font) { - _layouts["Dialog.GlobalOptions"]->debugDraw(screen, font); - _layouts["Dialog.GlobalOptions_Graphics"]->debugDraw(screen, font); + _layouts["Dialog.GameOptions"]->debugDraw(screen, font); + _layouts["Dialog.GameOptions_Graphics"]->debugDraw(screen, font); } private: VariablesMap _vars; LayoutsMap _layouts; Common::Stack<ThemeLayout*> _curLayout; + Common::String _curDialog; }; diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 868b6fa9e7..eec0826a8f 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -458,6 +458,14 @@ bool ThemeParser::parserCallback_widget(ParserNode *node) { var = node->values["name"]; int width = -1; int height = -1; + bool enabled = true; + + if (node->values.contains("enabled")) { + if (node->values["enabled"] == "false") + enabled = false; + else if (node->values["enabled"] != "true") + return parserError("Invalid value for Widget enabling (expecting true/false)"); + } if (node->values.contains("width")) { if (_theme->themeEval()->hasVar(node->values["width"]) == true) @@ -475,7 +483,7 @@ bool ThemeParser::parserCallback_widget(ParserNode *node) { return parserError("Corrupted height value in key for %s", var.c_str()); } - _theme->themeEval()->addWidget(var, width, height, node->values["type"]); + _theme->themeEval()->addWidget(var, width, height, node->values["type"], enabled); } return true; @@ -492,7 +500,16 @@ bool ThemeParser::parserCallback_child(ParserNode *node) { bool ThemeParser::parserCallback_dialog(ParserNode *node) { Common::String var = "Dialog." + node->values["name"]; - _theme->themeEval()->addDialog(var, node->values["overlays"]); + bool enabled = true; + + if (node->values.contains("enabled")) { + if (node->values["enabled"] == "false") + enabled = false; + else if (node->values["enabled"] != "true") + return parserError("Invalid value for Dialog enabling (expecting true/false)"); + } + + _theme->themeEval()->addDialog(var, node->values["overlays"], enabled); if (node->values.contains("shading")) { int shading = 0; @@ -508,6 +525,13 @@ bool ThemeParser::parserCallback_dialog(ParserNode *node) { return true; } +bool ThemeParser::parserCallback_import(ParserNode *node) { + + if (!_theme->themeEval()->addImportedLayout(node->values["layout"])) + return parserError("Error when importing external layout"); + return true; +} + bool ThemeParser::parserCallback_layout(ParserNode *node) { int spacing = -1; @@ -535,8 +559,6 @@ bool ThemeParser::parserCallback_layout(ParserNode *node) { _theme->themeEval()->addPadding(paddingL, paddingR, paddingT, paddingB); } - - return true; } diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h index 256d1d3770..999828e5db 100644 --- a/gui/ThemeParser.h +++ b/gui/ThemeParser.h @@ -437,17 +437,24 @@ protected: XML_PROP(name, true) XML_PROP(overlays, true) XML_PROP(shading, false) + XML_PROP(enabled, false) XML_KEY(layout) XML_PROP(type, true) XML_PROP(center, false) XML_PROP(direction, false) XML_PROP(padding, false) XML_PROP(spacing, false) + + XML_KEY(import) + XML_PROP(layout, true) + KEY_END() + XML_KEY(widget) XML_PROP(name, true) XML_PROP(width, false) XML_PROP(height, false) XML_PROP(type, false) + XML_PROP(enabled, false) KEY_END() XML_KEY(space) @@ -481,6 +488,7 @@ protected: bool parserCallback_child(ParserNode *node); bool parserCallback_layout(ParserNode *node); bool parserCallback_space(ParserNode *node); + bool parserCallback_import(ParserNode *node); bool closedKeyCallback(ParserNode *node); diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp index 1272845702..084e1496ec 100644 --- a/gui/ThemeRenderer.cpp +++ b/gui/ThemeRenderer.cpp @@ -691,8 +691,8 @@ void ThemeRenderer::updateScreen() { renderDirtyScreen(); // _vectorRenderer->fillSurface(); - // themeEval()->debugDraw(_screen, _font); - // _vectorRenderer->copyWholeFrame(_system); +// themeEval()->debugDraw(_screen, _font); +// _vectorRenderer->copyWholeFrame(_system); } void ThemeRenderer::renderDirtyScreen() { diff --git a/gui/dialog.cpp b/gui/dialog.cpp index ac9d0dbb4d..1e58c654eb 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -150,7 +150,8 @@ void Dialog::drawDialog() { // Draw all children Widget *w = _firstWidget; while (w) { - if (w->_debugVisible) w->draw(); + //if (w->_debugVisible) + w->draw(); w = w->_next; } } diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 451c089d3a..27d74a905a 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -143,7 +143,7 @@ protected: }; EditGameDialog::EditGameDialog(const String &domain, const String &desc) - : OptionsDialog(domain, "gameoptions") { + : OptionsDialog(domain, "GameOptions") { int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW"); @@ -159,7 +159,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) } // GUI: Add tab widget - TabWidget *tab = new TabWidget(this, "gameoptions_tabwidget"); + TabWidget *tab = new TabWidget(this, "GameOptions.TabWidget"); tab->setHints(THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND); // @@ -168,15 +168,15 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) tab->addTab("Game"); // GUI: Label & edit widget for the game ID - new StaticTextWidget(tab, "gameoptions_id", "ID:"); - _domainWidget = new DomainEditTextWidget(tab, "gameoptions_domain", _domain); + new StaticTextWidget(tab, "GameOptions_Game.Id", "ID:"); + _domainWidget = new DomainEditTextWidget(tab, "GameOptions_Game.Domain", _domain); // GUI: Label & edit widget for the description - new StaticTextWidget(tab, "gameoptions_name", "Name:"); - _descriptionWidget = new EditTextWidget(tab, "gameoptions_desc", description); + new StaticTextWidget(tab, "GameOptions_Game.Name", "Name:"); + _descriptionWidget = new EditTextWidget(tab, "GameOptions_Game.Desc", description); // Language popup - _langPopUp = new PopUpWidget(tab, "gameoptions_lang", "Language:", labelWidth); + _langPopUp = new PopUpWidget(tab, "GameOptions_Game.Lang", "Language:", labelWidth); _langPopUp->appendEntry("<default>"); _langPopUp->appendEntry(""); const Common::LanguageDescription *l = Common::g_languages; @@ -185,7 +185,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) } // Platform popup - _platformPopUp = new PopUpWidget(tab, "gameoptions_platform", "Platform:", labelWidth); + _platformPopUp = new PopUpWidget(tab, "GameOptions_Game.Platform", "Platform:", labelWidth); _platformPopUp->appendEntry("<default>"); _platformPopUp->appendEntry(""); const Common::PlatformDescription *p = Common::g_platforms; @@ -198,37 +198,37 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) // tab->addTab("Graphics"); - _globalGraphicsOverride = new CheckboxWidget(tab, "gameoptions_graphicsCheckbox", "Override global graphic settings", kCmdGlobalGraphicsOverride, 0); + _globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", "Override global graphic settings", kCmdGlobalGraphicsOverride, 0); - addGraphicControls(tab, "gameoptions_"); + addGraphicControls(tab, "GameOptions_Graphics."); // // 4) The audio tab // tab->addTab("Audio"); - _globalAudioOverride = new CheckboxWidget(tab, "gameoptions_audioCheckbox", "Override global audio settings", kCmdGlobalAudioOverride, 0); + _globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", "Override global audio settings", kCmdGlobalAudioOverride, 0); - addAudioControls(tab, "gameoptions_"); - addSubtitleControls(tab, "gameoptions_"); + addAudioControls(tab, "GameOptions_Audio."); + addSubtitleControls(tab, "GameOptions_Audio."); // // 5) The volume tab // tab->addTab("Volume"); - _globalVolumeOverride = new CheckboxWidget(tab, "gameoptions_volumeCheckbox", "Override global volume settings", kCmdGlobalVolumeOverride, 0); + _globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", "Override global volume settings", kCmdGlobalVolumeOverride, 0); - addVolumeControls(tab, "gameoptions_"); + addVolumeControls(tab, "GameOptions_Volume."); // // 6) The MIDI tab // tab->addTab("MIDI"); - _globalMIDIOverride = new CheckboxWidget(tab, "gameoptions_midiCheckbox", "Override global MIDI settings", kCmdGlobalMIDIOverride, 0); + _globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", "Override global MIDI settings", kCmdGlobalMIDIOverride, 0); - addMIDIControls(tab, "gameoptions_"); + addMIDIControls(tab, "GameOptions_MIDI."); // // 2) The 'Path' tab @@ -239,29 +239,29 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) // in the small version of the GUI. // GUI: Button + Label for the game path - new ButtonWidget(tab, "gameoptions_gamepath", "Game Path:", kCmdGameBrowser, 0); - _gamePathWidget = new StaticTextWidget(tab, "gameoptions_gamepathText", gamePath); + new ButtonWidget(tab, "GameOptions_Paths.Gamepath", "Game Path:", kCmdGameBrowser, 0); + _gamePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.GamepathText", gamePath); // GUI: Button + Label for the additional path - new ButtonWidget(tab, "gameoptions_extrapath", "Extra Path:", kCmdExtraBrowser, 0); - _extraPathWidget = new StaticTextWidget(tab, "gameoptions_extrapathText", extraPath); + new ButtonWidget(tab, "GameOptions_Paths.Extrapath", "Extra Path:", kCmdExtraBrowser, 0); + _extraPathWidget = new StaticTextWidget(tab, "GameOptions_Paths.ExtrapathText", extraPath); if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { _extraPathWidget->setLabel("None"); } // GUI: Button + Label for the save path - new ButtonWidget(tab, "gameoptions_savepath", "Save Path:", kCmdSaveBrowser, 0); - _savePathWidget = new StaticTextWidget(tab, "gameoptions_savepathText", savePath); + new ButtonWidget(tab, "GameOptions_Paths.Savepath", "Save Path:", kCmdSaveBrowser, 0); + _savePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.SavepathText", savePath); if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) { _savePathWidget->setLabel("Default"); } - + // Activate the first tab tab->setActiveTab(0); // Add OK & Cancel buttons - new ButtonWidget(this, "gameoptions_cancel", "Cancel", kCloseCmd, 0); - new ButtonWidget(this, "gameoptions_ok", "OK", kOKCmd, 0); + new ButtonWidget(this, "GameOptions.Cancel", "Cancel", kCloseCmd, 0); + new ButtonWidget(this, "GameOptions.Ok", "OK", kOKCmd, 0); } void EditGameDialog::reflowLayout() { diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 499ca752e7..eb6747923b 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -1 +1 @@ -" <render_info> <palette> <color name = 'darkred' rgb = '168, 42, 12' /> <color name = 'brightred' rgb = '200, 124, 104' /> <color name = 'xtrabrightred' rgb = '251, 241, 206' /> <color name = 'blandyellow' rgb = '247, 228, 166' /> <color name = 'bgreen' rgb = '96, 160, 8' /> <color name = 'blue' rgb = '0, 255, 255' /> <color name = 'black' rgb = '0, 0, 0' /> <color name = 'white' rgb = '255, 255, 255' /> <color name = 'shadowcolor' rgb = '63, 60, 17' /> </palette> <fonts> <font id = 'text_default' type = 'default' color = 'black' /> <font id = 'text_hover' type = 'default' color = 'bgreen' /> <font id = 'text_disabled' type = 'default' color = '128, 128, 128' /> <font id = 'text_inverted' type = 'default' color = '0, 0, 0' /> <font id = 'text_button' type = 'default' color = 'white' /> <font id = 'text_button_hover' type = 'default' color = 'blandyellow' /> </fonts> <defaults fill = 'gradient' fg_color = 'white' bevel_color = '237, 169, 72'/> <drawdata id = 'text_selection' cache = false> <drawstep func = 'square' fill = 'foreground' fg_color = 'bgreen' /> </drawdata> <drawdata id = 'mainmenu_bg' cache = false> <drawstep func = 'fill' fill = 'gradient' gradient_start = '208, 112, 8' gradient_end = '232, 192, 16' /> </drawdata> <drawdata id = 'separator' cache = false> <drawstep func = 'square' fill = 'foreground' height = '1' ypos = 'center' fg_color = 'black' /> </drawdata> <drawdata id = 'scrollbar_base' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'background' fg_color = '176, 164, 160' bg_color = '240, 228, 160' /> </drawdata> <drawdata id = 'scrollbar_handle_hover' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'gradient' fg_color = 'blandyellow' gradient_start = 'xtrabrightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'scrollbar_handle_idle' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'gradient' fg_color = 'blandyellow' gradient_start = 'brightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'scrollbar_button_idle' cache = false> <drawstep func = 'roundedsq' radius = '4' fill = 'none' fg_color = '176, 164, 160' stroke = 1 /> <drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' /> </drawdata> <drawdata id = 'scrollbar_button_hover' cache = false> <drawstep func = 'roundedsq' radius = '4' fill = 'background' fg_color = '120, 120, 120' bg_color = '206, 121, 99' stroke = 1 /> <drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' /> </drawdata> <drawdata id = 'tab_active' cache = false> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'tab' radius = '4' stroke = '0' fill = 'gradient' gradient_end = 'xtrabrightred' gradient_start = 'blandyellow' shadow = 3 /> </drawdata> <drawdata id = 'tab_inactive' cache = false> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'tab' radius = '4' stroke = '0' fill = 'foreground' fg_color = '240, 205, 118' shadow = 3 /> </drawdata> <drawdata id = 'tab_background' cache = false> <drawstep func = 'tab' radius = '8' stroke = '0' fill = 'foreground' fg_color = '232, 180, 81' shadow = 3 /> </drawdata> <drawdata id = 'widget_slider' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'foreground' fg_color = 'blandyellow' bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'slider_full' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 4 fill = 'gradient' fg_color = '123, 112, 56' gradient_start = 'brightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'slider_hover' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 4 fill = 'gradient' fg_color = '123, 112, 56' gradient_start = 'xtrabrightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'popup_idle' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'foreground' fg_color = '250, 237, 190' shadow = 2 /> <drawstep func = 'triangle' fg_color = '63, 60, 52' fill = 'foreground' width = 'height' height = 'auto' xpos = 'right' ypos = 'center' orientation = 'bottom' /> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'right' /> </drawdata> <drawdata id = 'popup_hover' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'gradient' gradient_start = 'blandyellow' gradient_end = '250, 237, 190' shadow = 0 /> <drawstep func = 'triangle' fg_color = '63, 60, 52' fill = 'foreground' width = 'height' height = 'auto' xpos = 'right' ypos = 'center' orientation = 'bottom' /> <text font = 'text_hover' vertical_align = 'center' horizontal_align = 'right' /> </drawdata> <drawdata id = 'default_bg' cache = false> <drawstep func = 'roundedsq' radius = 12 stroke = 0 fg_color = 'xtrabrightred' fill = 'foreground' shadow = 3 /> </drawdata> <drawdata id = 'button_idle' cache = false> <text font = 'text_button' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '6' stroke = 1 fill = 'gradient' shadow = 0 fg_color = 'shadowcolor' gradient_start = 'brightred' gradient_end = 'darkred' bevel = 1 /> </drawdata> <drawdata id = 'button_hover' cache = false> <text font = 'text_button_hover' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '6' gradient_factor = 1 stroke = 1 fill = 'gradient' shadow = 0 fg_color = 'shadowcolor' gradient_start = 'xtrabrightred' gradient_end = 'darkred' bevel_color = 'xtrabrightred' bevel = 1 /> </drawdata> <drawdata id = 'button_disabled' cache = false> <text font = 'text_disabled' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '8' stroke = 0 fill = 'foreground' fg_color = '200, 200, 200' shadow = 3 /> </drawdata> <drawdata id = 'checkbox_disabled' cache = false> <text font = 'text_disabled' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'roundedsq' fill = 'none' radius = 4 fg_color = 'black' shadow = 0 bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'checkbox_selected' cache = false> <text font = 'text_default' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'roundedsq' fill = 'gradient' radius = 4 fg_color = 'white' gradient_start = 'brightred' gradient_end = 'darkred' shadow = 0 bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'checkbox_default' cache = false> <text font = 'text_default' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'roundedsq' fill = 'foreground' radius = 4 fg_color = 'blandyellow' shadow = 0 bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'widget_default' cache = false> <drawstep func = 'roundedsq' gradient_factor = 6 radius = '8' fill = 'gradient' gradient_start = '240, 224, 136' gradient_end = 'xtrabrightred' shadow = 3 /> </drawdata> </render_info> <layout_info> <globals> <def var = 'Widget.Size' value = '32' /> <def var = 'Line.Height' value = '16' /> <def var = 'Font.Height' value = '16' /> <def var = 'Padding.Bottom' value = '16' /> <def var = 'Padding.Left' value = '16' /> <def var = 'Padding.Right' value = '16' /> <def var = 'Padding.Top' value = '16' /> <def var = 'ListWidget.hlLeftPadding' value = '8'/> <def var = 'ListWidget.hlRightPadding' value = '16'/> <widget name = 'OptionsLabel' size = '110, Globals.Line.Height' /> <widget name = 'Button' size = '120, 25' /> <widget name = 'Slider' size = '256, 32' /> <widget name = 'PopUp' size = '-1, 19' /> <widget name = 'Checkbox' size = '-1, Globals.Line.Height' /> <widget name = 'ListWidget' padding = '7, 5, 3, 3' /> <widget name = 'PopUpWidget' padding = '7, 5, 0, 0' /> <widget name = 'EditTextWidget' padding = '7, 5, 0, 0' /> <widget name = 'Console' padding = '7, 5, 5, 5' /> <widget name = 'TabWidget'> <child name = 'Tab' size = '75, 27' padding = '0, 0, 8, 0' /> <child name = 'NavButton' size = '15, 18' padding = '0, 3, 4, 0' /> </widget> </globals> <dialog name = 'Launcher' overlays = 'screen'> <layout type = 'vertical' center = 'true' padding = '23, 23, 8, 23'> <widget name = 'Version' width = '247' height = 'Globals.Line.Height' /> <widget name = 'Logo' width = '283' height = '80' /> <layout type = 'horizontal' direction = 'right2left' padding = '0, 0, 0, 0'> <layout type = 'vertical' padding = '16, 0, 0, 0'> <widget name = 'StartButton' type = 'Button' /> <space size = '16' /> <widget name = 'AddGameButton' type = 'Button' /> <widget name = 'EditGameButton' type = 'Button' /> <widget name = 'RemoveGameButton' type = 'Button' /> <space size = '16' /> <widget name = 'OptionsButton' type = 'Button' /> <widget name = 'AboutButton' type = 'Button' /> <space size = '16' /> <widget name = 'QuitButton' type = 'Button' /> <space/> </layout> <widget name = 'GameList'/> </layout> </layout> </dialog> <dialog name = 'GlobalOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'> <layout type = 'vertical' padding = '0, 0, 0, 0' direction = 'bottom2top'> <layout type = 'horizontal' direction = 'right2left' padding = '16, 16, 16, 16'> <widget name = 'Ok' type = 'Button' /> <widget name = 'Cancel' type = 'Button' /> <space/> </layout> <widget name = 'TabWidget'/> </layout> </dialog> <dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'grModePopup' type = 'PopUp' /> <widget name = 'grRenderPopup' type = 'PopUp' /> <widget name = 'grAspectCheckbox' type = 'Checkbox' /> <widget name = 'grFullscreenCheckbox' type = 'Checkbox' /> </layout> </dialog> <dialog name = 'GlobalOptions_Audio' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'auMidiPopup' type = 'PopUp' /> <widget name = 'auSampleRatePopup' type = 'PopUp' /> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'subToggleDesc' type = 'OptionsLabel' /> <widget name = 'subToggleButton' width = '150' height = 'Globals.Slider.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'subSubtitleSpeedDesc' type = 'OptionsLabel' /> <widget name = 'subSubtitleSpeedSlider' type = 'Slider' /> <widget name = 'subSubtitleSpeedLabel' width = '32' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'vcMusicText' type = 'OptionsLabel' /> <widget name = 'vcMusicSlider' type = 'Slider' /> <widget name = 'vcMusicLabel' width = '32' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'vcSfxText' type = 'OptionsLabel' /> <widget name = 'vcSfxSlider' type = 'Slider' /> <widget name = 'vcSfxLabel' width = '32' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'vcSpeechText' type = 'OptionsLabel' /> <widget name = 'vcSpeechSlider' type = 'Slider' /> <widget name = 'vcSpeechLabel' width = '32' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'mcFontButton' type = 'Button' /> <widget name = 'mcFontClearButton' height = 'Globals.Line.Height' width = 'Globals.Line.Height' /> <widget name = 'mcFontPath' height = 'Globals.Line.Height' /> </layout> <widget name = 'mcMixedCheckbox' type = 'Checkbox' /> <widget name = 'mcMt32Checkbox' type = 'Checkbox' /> <widget name = 'mcGSCheckbox' type = 'Checkbox' /> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'mcMidiGainText' type = 'OptionsLabel' /> <widget name = 'mcMidiGainSlider' type = 'Slider' /> <widget name = 'mcMidiGainLabel' width = '32' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_Paths' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'SaveButton' type = 'Button' /> <widget name = 'SavePath' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'ThemeButton' type = 'Button' /> <widget name = 'ThemePath' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'ExtraButton' type = 'Button' /> <widget name = 'ExtraPath' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'ThemeButton' type = 'Button' /> <widget name = 'CurTheme' height = 'Globals.Line.Height' /> </layout> <widget name = 'AutosavePeriod' type = 'PopUp' /> </layout> </dialog> </layout_info> " +" <render_info> <palette> <color name = 'darkred' rgb = '168, 42, 12' /> <color name = 'brightred' rgb = '200, 124, 104' /> <color name = 'xtrabrightred' rgb = '251, 241, 206' /> <color name = 'blandyellow' rgb = '247, 228, 166' /> <color name = 'bgreen' rgb = '96, 160, 8' /> <color name = 'blue' rgb = '0, 255, 255' /> <color name = 'black' rgb = '0, 0, 0' /> <color name = 'white' rgb = '255, 255, 255' /> <color name = 'shadowcolor' rgb = '63, 60, 17' /> </palette> <fonts> <font id = 'text_default' type = 'default' color = 'black' /> <font id = 'text_hover' type = 'default' color = 'bgreen' /> <font id = 'text_disabled' type = 'default' color = '128, 128, 128' /> <font id = 'text_inverted' type = 'default' color = '0, 0, 0' /> <font id = 'text_button' type = 'default' color = 'white' /> <font id = 'text_button_hover' type = 'default' color = 'blandyellow' /> </fonts> <defaults fill = 'gradient' fg_color = 'white' bevel_color = '237, 169, 72'/> <drawdata id = 'text_selection' cache = false> <drawstep func = 'square' fill = 'foreground' fg_color = 'bgreen' /> </drawdata> <drawdata id = 'mainmenu_bg' cache = false> <drawstep func = 'fill' fill = 'gradient' gradient_start = '208, 112, 8' gradient_end = '232, 192, 16' /> </drawdata> <drawdata id = 'separator' cache = false> <drawstep func = 'square' fill = 'foreground' height = '1' ypos = 'center' fg_color = 'black' /> </drawdata> <drawdata id = 'scrollbar_base' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'background' fg_color = '176, 164, 160' bg_color = '240, 228, 160' /> </drawdata> <drawdata id = 'scrollbar_handle_hover' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'gradient' fg_color = 'blandyellow' gradient_start = 'xtrabrightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'scrollbar_handle_idle' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'gradient' fg_color = 'blandyellow' gradient_start = 'brightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'scrollbar_button_idle' cache = false> <drawstep func = 'roundedsq' radius = '4' fill = 'none' fg_color = '176, 164, 160' stroke = 1 /> <drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' /> </drawdata> <drawdata id = 'scrollbar_button_hover' cache = false> <drawstep func = 'roundedsq' radius = '4' fill = 'background' fg_color = '120, 120, 120' bg_color = '206, 121, 99' stroke = 1 /> <drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' /> </drawdata> <drawdata id = 'tab_active' cache = false> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'tab' radius = '4' stroke = '0' fill = 'gradient' gradient_end = 'xtrabrightred' gradient_start = 'blandyellow' shadow = 3 /> </drawdata> <drawdata id = 'tab_inactive' cache = false> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'tab' radius = '4' stroke = '0' fill = 'foreground' fg_color = '240, 205, 118' shadow = 3 /> </drawdata> <drawdata id = 'tab_background' cache = false> <drawstep func = 'tab' radius = '8' stroke = '0' fill = 'foreground' fg_color = '232, 180, 81' shadow = 3 /> </drawdata> <drawdata id = 'widget_slider' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'foreground' fg_color = 'blandyellow' bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'slider_full' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 4 fill = 'gradient' fg_color = '123, 112, 56' gradient_start = 'brightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'slider_hover' cache = false> <drawstep func = 'roundedsq' stroke = 1 radius = 4 fill = 'gradient' fg_color = '123, 112, 56' gradient_start = 'xtrabrightred' gradient_end = 'darkred' /> </drawdata> <drawdata id = 'popup_idle' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'foreground' fg_color = '250, 237, 190' shadow = 2 /> <drawstep func = 'triangle' fg_color = '63, 60, 52' fill = 'foreground' width = 'height' height = 'auto' xpos = 'right' ypos = 'center' orientation = 'bottom' /> <text font = 'text_default' vertical_align = 'center' horizontal_align = 'right' /> </drawdata> <drawdata id = 'popup_hover' cache = false> <drawstep func = 'roundedsq' stroke = 0 radius = 4 fill = 'gradient' gradient_start = 'blandyellow' gradient_end = '250, 237, 190' shadow = 0 /> <drawstep func = 'triangle' fg_color = '63, 60, 52' fill = 'foreground' width = 'height' height = 'auto' xpos = 'right' ypos = 'center' orientation = 'bottom' /> <text font = 'text_hover' vertical_align = 'center' horizontal_align = 'right' /> </drawdata> <drawdata id = 'default_bg' cache = false> <drawstep func = 'roundedsq' radius = 12 stroke = 0 fg_color = 'xtrabrightred' fill = 'foreground' shadow = 3 /> </drawdata> <drawdata id = 'button_idle' cache = false> <text font = 'text_button' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '6' stroke = 1 fill = 'gradient' shadow = 0 fg_color = 'shadowcolor' gradient_start = 'brightred' gradient_end = 'darkred' bevel = 1 /> </drawdata> <drawdata id = 'button_hover' cache = false> <text font = 'text_button_hover' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '6' gradient_factor = 1 stroke = 1 fill = 'gradient' shadow = 0 fg_color = 'shadowcolor' gradient_start = 'xtrabrightred' gradient_end = 'darkred' bevel_color = 'xtrabrightred' bevel = 1 /> </drawdata> <drawdata id = 'button_disabled' cache = false> <text font = 'text_disabled' vertical_align = 'center' horizontal_align = 'center' /> <drawstep func = 'roundedsq' radius = '8' stroke = 0 fill = 'foreground' fg_color = '200, 200, 200' shadow = 3 /> </drawdata> <drawdata id = 'checkbox_disabled' cache = false> <text font = 'text_disabled' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'roundedsq' fill = 'none' radius = 4 fg_color = 'black' shadow = 0 bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'checkbox_selected' cache = false> <text font = 'text_default' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'roundedsq' fill = 'gradient' radius = 4 fg_color = 'white' gradient_start = 'brightred' gradient_end = 'darkred' shadow = 0 bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'checkbox_default' cache = false> <text font = 'text_default' vertical_align = 'top' horizontal_align = 'left' /> <drawstep func = 'roundedsq' fill = 'foreground' radius = 4 fg_color = 'blandyellow' shadow = 0 bevel = 1 bevel_color = 'shadowcolor' /> </drawdata> <drawdata id = 'widget_default' cache = false> <drawstep func = 'roundedsq' gradient_factor = 6 radius = '8' fill = 'gradient' gradient_start = '240, 224, 136' gradient_end = 'xtrabrightred' shadow = 3 /> </drawdata> </render_info> <layout_info> <globals> <def var = 'Widget.Size' value = '32' /> <def var = 'Line.Height' value = '16' /> <def var = 'Font.Height' value = '16' /> <def var = 'Padding.Bottom' value = '16' /> <def var = 'Padding.Left' value = '16' /> <def var = 'Padding.Right' value = '16' /> <def var = 'Padding.Top' value = '16' /> <def var = 'ListWidget.hlLeftPadding' value = '8'/> <def var = 'ListWidget.hlRightPadding' value = '16'/> <widget name = 'OptionsLabel' size = '110, Globals.Line.Height' /> <widget name = 'Button' size = '120, 25' /> <widget name = 'Slider' size = '256, 32' /> <widget name = 'PopUp' size = '-1, 19' /> <widget name = 'Checkbox' size = '-1, Globals.Line.Height' /> <widget name = 'ListWidget' padding = '7, 5, 3, 3' /> <widget name = 'PopUpWidget' padding = '7, 5, 0, 0' /> <widget name = 'EditTextWidget' padding = '7, 5, 0, 0' /> <widget name = 'Console' padding = '7, 5, 5, 5' /> <widget name = 'TabWidget'> <child name = 'Tab' size = '75, 27' padding = '0, 0, 8, 0' /> <child name = 'NavButton' size = '15, 18' padding = '0, 3, 4, 0' /> </widget> </globals> <dialog name = 'Launcher' overlays = 'screen'> <layout type = 'vertical' center = 'true' padding = '23, 23, 8, 23'> <widget name = 'Version' width = '247' height = 'Globals.Line.Height' /> <widget name = 'Logo' width = '283' height = '80' /> <layout type = 'horizontal' direction = 'right2left' padding = '0, 0, 0, 0'> <layout type = 'vertical' padding = '16, 0, 0, 0'> <widget name = 'StartButton' type = 'Button' /> <space size = '16' /> <widget name = 'AddGameButton' type = 'Button' /> <widget name = 'EditGameButton' type = 'Button' /> <widget name = 'RemoveGameButton' type = 'Button' /> <space size = '16' /> <widget name = 'OptionsButton' type = 'Button' /> <widget name = 'AboutButton' type = 'Button' /> <space size = '16' /> <widget name = 'QuitButton' type = 'Button' /> <space/> </layout> <widget name = 'GameList'/> </layout> </layout> </dialog> <dialog name = 'GlobalOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'> <layout type = 'vertical' padding = '0, 0, 0, 0' direction = 'bottom2top'> <layout type = 'horizontal' direction = 'right2left' padding = '16, 16, 16, 16'> <widget name = 'Ok' type = 'Button' /> <widget name = 'Cancel' type = 'Button' /> <space/> </layout> <widget name = 'TabWidget'/> </layout> </dialog> <dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'grModePopup' type = 'PopUp' /> <widget name = 'grRenderPopup' type = 'PopUp' /> <widget name = 'grAspectCheckbox' type = 'Checkbox' /> <widget name = 'grFullscreenCheckbox' type = 'Checkbox' /> </layout> </dialog> <dialog name = 'GlobalOptions_Audio' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'auMidiPopup' type = 'PopUp' /> <widget name = 'auSampleRatePopup' type = 'PopUp' /> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'subToggleDesc' type = 'OptionsLabel' /> <widget name = 'subToggleButton' width = '150' height = 'Globals.Slider.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'subSubtitleSpeedDesc' type = 'OptionsLabel' /> <widget name = 'subSubtitleSpeedSlider' type = 'Slider' /> <widget name = 'subSubtitleSpeedLabel' width = '32' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'vcMusicText' type = 'OptionsLabel' /> <widget name = 'vcMusicSlider' type = 'Slider' /> <widget name = 'vcMusicLabel' width = '32' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'vcSfxText' type = 'OptionsLabel' /> <widget name = 'vcSfxSlider' type = 'Slider' /> <widget name = 'vcSfxLabel' width = '32' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'vcSpeechText' type = 'OptionsLabel' /> <widget name = 'vcSpeechSlider' type = 'Slider' /> <widget name = 'vcSpeechLabel' width = '32' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'mcFontButton' type = 'Button' /> <widget name = 'mcFontClearButton' height = 'Globals.Line.Height' width = 'Globals.Line.Height' /> <widget name = 'mcFontPath' height = 'Globals.Line.Height' /> </layout> <widget name = 'mcMixedCheckbox' type = 'Checkbox' /> <widget name = 'mcMt32Checkbox' type = 'Checkbox' /> <widget name = 'mcGSCheckbox' type = 'Checkbox' /> <layout type = 'horizontal' padding = '0, 0, 0, 0'> <widget name = 'mcMidiGainText' type = 'OptionsLabel' /> <widget name = 'mcMidiGainSlider' type = 'Slider' /> <widget name = 'mcMidiGainLabel' width = '32' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_Paths' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'SaveButton' type = 'Button' /> <widget name = 'SavePath' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'ThemeButton' type = 'Button' /> <widget name = 'ThemePath' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'ExtraButton' type = 'Button' /> <widget name = 'ExtraPath' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> <dialog name = 'GlobalOptions_Misc' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'ThemeButton' type = 'Button' /> <widget name = 'CurTheme' height = 'Globals.Line.Height' /> </layout> <widget name = 'AutosavePeriod' type = 'PopUp' /> </layout> </dialog> <dialog name = 'GameOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'> <layout type = 'vertical' padding = '0, 0, 0, 0' direction = 'bottom2top' spacing = '16'> <layout type = 'horizontal' direction = 'right2left' padding = '16, 16, 16, 16'> <widget name = 'Ok' type = 'Button' /> <widget name = 'Cancel' type = 'Button' /> <space/> </layout> <widget name = 'TabWidget'/> </layout> </dialog> <dialog name = 'GameOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'EnableTabCheckbox' type = 'Checkbox' /> <import layout = 'Dialog.GlobalOptions_Graphics' /> </layout> </dialog> <dialog name = 'GameOptions_Audio' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'EnableTabCheckbox' type = 'Checkbox' /> <import layout = 'Dialog.GlobalOptions_Audio' /> </layout> </dialog> <dialog name = 'GameOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'EnableTabCheckbox' type = 'Checkbox' /> <import layout = 'Dialog.GlobalOptions_MIDI' /> </layout> </dialog> <dialog name = 'GameOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'EnableTabCheckbox' type = 'Checkbox' /> <import layout = 'Dialog.GlobalOptions_Volume' /> </layout> </dialog> <dialog name = 'GameOptions_Game' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'> <layout type = 'vertical' padding = '16, 16, 16, 16'> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'Id' type = 'OptionsLabel' /> <widget name = 'Domain' type = 'PopUp' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> <widget name = 'Name' type = 'OptionsLabel' /> <widget name = 'Desc' type = 'PopUp' /> </layout> <widget name = 'Lang' type = 'PopUp' /> <widget name = 'Platform' type = 'PopUp' /> </layout> </dialog> <dialog name = 'GameOptions_Paths' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'> <layout type = 'vertical' padding = '16, 16, 16, 16'> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'> <widget name = 'Savepath' type = 'Button' /> <widget name = 'SavepathText' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'> <widget name = 'Extrapath' type = 'Button' /> <widget name = 'ExtrapathText' height = 'Globals.Line.Height' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'> <widget name = 'Gamepath' type = 'Button' /> <widget name = 'GamepathText' height = 'Globals.Line.Height' /> </layout> </layout> </dialog> </layout_info> " diff --git a/gui/themes/modern.stx b/gui/themes/modern.stx index e1639cd6a6..f182f6a2d5 100644 --- a/gui/themes/modern.stx +++ b/gui/themes/modern.stx @@ -706,4 +706,111 @@ /> </layout> </dialog> + + <dialog name = 'GameOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'> + <layout type = 'vertical' padding = '0, 0, 0, 0' direction = 'bottom2top' spacing = '16'> + <layout type = 'horizontal' direction = 'right2left' padding = '16, 16, 16, 16'> + <widget name = 'Ok' + type = 'Button' + /> + <widget name = 'Cancel' + type = 'Button' + /> + <space/> + </layout> + <widget name = 'TabWidget'/> + </layout> + </dialog> + + <dialog name = 'GameOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'EnableTabCheckbox' + type = 'Checkbox' + /> + <import layout = 'Dialog.GlobalOptions_Graphics' /> + </layout> + </dialog> + + <dialog name = 'GameOptions_Audio' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'EnableTabCheckbox' + type = 'Checkbox' + /> + <import layout = 'Dialog.GlobalOptions_Audio' /> + </layout> + </dialog> + + <dialog name = 'GameOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'EnableTabCheckbox' + type = 'Checkbox' + /> + <import layout = 'Dialog.GlobalOptions_MIDI' /> + </layout> + </dialog> + + <dialog name = 'GameOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'EnableTabCheckbox' + type = 'Checkbox' + /> + <import layout = 'Dialog.GlobalOptions_Volume' /> + </layout> + </dialog> + + <dialog name = 'GameOptions_Game' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'> + <layout type = 'vertical' padding = '16, 16, 16, 16'> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> + <widget name = 'Id' + type = 'OptionsLabel' + /> + <widget name = 'Domain' + type = 'PopUp' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'> + <widget name = 'Name' + type = 'OptionsLabel' + /> + <widget name = 'Desc' + type = 'PopUp' + /> + </layout> + <widget name = 'Lang' + type = 'PopUp' + /> + <widget name = 'Platform' + type = 'PopUp' + /> + </layout> + </dialog> + + <dialog name = 'GameOptions_Paths' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'> + <layout type = 'vertical' padding = '16, 16, 16, 16'> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'> + <widget name = 'Savepath' + type = 'Button' + /> + <widget name = 'SavepathText' + height = 'Globals.Line.Height' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'> + <widget name = 'Extrapath' + type = 'Button' + /> + <widget name = 'ExtrapathText' + height = 'Globals.Line.Height' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'> + <widget name = 'Gamepath' + type = 'Button' + /> + <widget name = 'GamepathText' + height = 'Globals.Line.Height' + /> + </layout> + </layout> + </dialog> </layout_info>
\ No newline at end of file diff --git a/gui/widget.cpp b/gui/widget.cpp index e9afc30301..1b3fc8c055 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -29,6 +29,8 @@ #include "gui/eval.h" #include "gui/newgui.h" +#include "gui/ThemeEval.h" + namespace GUI { Widget::Widget(GuiObject *boss, int x, int y, int w, int h) @@ -153,14 +155,14 @@ Widget *Widget::findWidgetInChain(Widget *w, const char *name) { } bool Widget::isEnabled() const { - if (g_gui.evaluator()->getVar(_name + ".enabled") == 0) { + if (g_gui.xmlEval()->getVar("Dialog." + _name + ".Enabled", 1) == 0) { return false; } return ((_flags & WIDGET_ENABLED) != 0); } bool Widget::isVisible() const { - if (g_gui.evaluator()->getVar(_name + ".visible") == 0) + if (g_gui.xmlEval()->getVar("Dialog." + _name + ".Visible", 1) == 0) return false; return !(_flags & WIDGET_INVISIBLE); |