diff options
-rw-r--r-- | engines/scumm/dialogs.cpp | 28 | ||||
-rw-r--r-- | gui/ThemeEval.cpp | 21 | ||||
-rw-r--r-- | gui/ThemeEval.h | 4 | ||||
-rw-r--r-- | gui/ThemeParser.cpp | 8 | ||||
-rw-r--r-- | gui/ThemeRenderer.cpp | 6 | ||||
-rw-r--r-- | gui/newgui.cpp | 11 | ||||
-rw-r--r-- | gui/object.h | 3 | ||||
-rw-r--r-- | gui/themes/default.inc | 127 | ||||
-rw-r--r-- | gui/themes/modern.stx | 130 |
9 files changed, 274 insertions, 64 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index e4e2b2b620..51c012d46d 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -443,20 +443,20 @@ Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) { } MainMenuDialog::MainMenuDialog(ScummEngine *scumm) - : ScummDialog("scummmain"), _vm(scumm) { + : ScummDialog("ScummMain"), _vm(scumm) { - new GUI::ButtonWidget(this, "scummmain_resume", "Resume", kPlayCmd, 'P'); + new GUI::ButtonWidget(this, "ScummMain.Resume", "Resume", kPlayCmd, 'P'); - new GUI::ButtonWidget(this, "scummmain_load", "Load", kLoadCmd, 'L'); - new GUI::ButtonWidget(this, "scummmain_save", "Save", kSaveCmd, 'S'); + new GUI::ButtonWidget(this, "ScummMain.Load", "Load", kLoadCmd, 'L'); + new GUI::ButtonWidget(this, "ScummMain.Save", "Save", kSaveCmd, 'S'); - new GUI::ButtonWidget(this, "scummmain_options", "Options", kOptionsCmd, 'O'); + new GUI::ButtonWidget(this, "ScummMain.Options", "Options", kOptionsCmd, 'O'); #ifndef DISABLE_HELP - new GUI::ButtonWidget(this, "scummmain_help", "Help", kHelpCmd, 'H'); + new GUI::ButtonWidget(this, "ScummMain.Help", "Help", kHelpCmd, 'H'); #endif - new GUI::ButtonWidget(this, "scummmain_about", "About", kAboutCmd, 'A'); + new GUI::ButtonWidget(this, "ScummMain.About", "About", kAboutCmd, 'A'); - new GUI::ButtonWidget(this, "scummmain_quit", "Quit", kQuitCmd, 'Q'); + new GUI::ButtonWidget(this, "ScummMain.Quit", "Quit", kQuitCmd, 'Q'); // // Create the sub dialog(s) @@ -576,29 +576,29 @@ enum { // "" as value for the domain, and in fact provide a somewhat better user // experience at the same time. ConfigDialog::ConfigDialog() - : GUI::OptionsDialog("", "scummconfig") { + : GUI::OptionsDialog("", "ScummConfig") { // // Sound controllers // - addVolumeControls(this, "scummconfig_"); + addVolumeControls(this, "ScummConfig."); // // Some misc options // // SCUMM has a talkspeed range of 0-9 - addSubtitleControls(this, "scummconfig_", 9); + addSubtitleControls(this, "ScummConfig.", 9); // // Add the buttons // - new GUI::ButtonWidget(this, "scummconfig_ok", "OK", GUI::OptionsDialog::kOKCmd, 'O'); - new GUI::ButtonWidget(this, "scummconfig_cancel", "Cancel", kCloseCmd, 'C'); + new GUI::ButtonWidget(this, "ScummConfig.Ok", "OK", GUI::OptionsDialog::kOKCmd, 'O'); + new GUI::ButtonWidget(this, "ScummConfig.Cancel", "Cancel", kCloseCmd, 'C'); #ifdef SMALL_SCREEN_DEVICE - new GUI::ButtonWidget(this, "scummconfig_keys", "Keys", kKeysCmd, 'K'); + new GUI::ButtonWidget(this, "ScummConfig.Keys", "Keys", kKeysCmd, 'K'); #endif #ifdef SMALL_SCREEN_DEVICE diff --git a/gui/ThemeEval.cpp b/gui/ThemeEval.cpp index cadaf0ba6a..426ca4fc40 100644 --- a/gui/ThemeEval.cpp +++ b/gui/ThemeEval.cpp @@ -64,8 +64,17 @@ void ThemeLayoutMain::reflowLayout() { _children[0]->setHeight(_h); _children[0]->reflowLayout(); -// _children[0]->setX(_x); -// _children[0]->setY(_y); + if (_w == -1) + _w = _children[0]->getWidth(); + + if (_h == -1) + _h = _children[0]->getHeight(); + + if (_y == -1) + _y = (g_system->getOverlayHeight() >> 1) - (_h >> 1); + + if (_x == -1) + _x = (g_system->getOverlayWidth() >> 1) - (_w >> 1); } } @@ -171,13 +180,15 @@ void ThemeEval::addWidget(const Common::String &name, int w, int h, const Common void ThemeEval::addDialog(const Common::String &name, const Common::String &overlays, bool enabled) { int16 x, y; - uint16 w, h; + int16 w, h; - if (overlays == "screen" || overlays.empty()) { + if (overlays == "screen") { x = y = 0; w = g_system->getOverlayWidth(); h = g_system->getOverlayHeight(); - } else if (!getWidgetData(overlays, x, y, w, h)) { + } else if (overlays == "screen_center") { + x = y = w = h = -1; + } else if (!getWidgetData(overlays, x, y, (uint16&)w, (uint16&)h)) { error("Error when loading dialog position for '%s'", overlays.c_str()); } diff --git a/gui/ThemeEval.h b/gui/ThemeEval.h index c507e8a3df..ba6e3381ac 100644 --- a/gui/ThemeEval.h +++ b/gui/ThemeEval.h @@ -365,8 +365,8 @@ public: } void debugDraw(Graphics::Surface *screen, const Graphics::Font *font) { - _layouts["Dialog.GameOptions"]->debugDraw(screen, font); - _layouts["Dialog.GameOptions_Graphics"]->debugDraw(screen, font); + _layouts["Dialog.ScummConfig"]->debugDraw(screen, font); +// _layouts["Dialog.GameOptions_Graphics"]->debugDraw(screen, font); } private: diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 4d74750b39..010fcaeaf3 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -565,9 +565,13 @@ bool ThemeParser::parserCallback_layout(ParserNode *node) { bool ThemeParser::parserCallback_space(ParserNode *node) { int size = -1; - if (node->values.contains("size")) - if (!parseIntegerKey(node->values["size"].c_str(), 1, &size)) + if (node->values.contains("size")) { + if (_theme->themeEval()->hasVar(node->values["size"])) + size = _theme->themeEval()->getVar(node->values["size"]); + + else if (!parseIntegerKey(node->values["size"].c_str(), 1, &size)) return parserError("Invalid value for Spacing size."); + } _theme->themeEval()->addSpace(size); return true; diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp index 454015d338..49e0d3bb35 100644 --- a/gui/ThemeRenderer.cpp +++ b/gui/ThemeRenderer.cpp @@ -718,9 +718,9 @@ void ThemeRenderer::updateScreen() { renderDirtyScreen(); -// _vectorRenderer->fillSurface(); -// themeEval()->debugDraw(_screen, _font); -// _vectorRenderer->copyWholeFrame(_system); +// _vectorRenderer->fillSurface(); +// themeEval()->debugDraw(_screen, _font); +// _vectorRenderer->copyWholeFrame(_system); } void ThemeRenderer::renderDirtyScreen() { diff --git a/gui/newgui.cpp b/gui/newgui.cpp index e45c081e9b..9a0d8cef88 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -60,18 +60,7 @@ void GuiObject::reflowLayout() { if (!_name.empty()) { if (!g_gui.xmlEval()->getWidgetData(_name, _x, _y, _w, _h)) { warning("Could not load widget position for '%s'", _name.c_str()); - -// if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR) -// error("Undefined variable %s.x", _name.c_str()); -// if ((_y = g_gui.evaluator()->getVar(_name + ".y")) == EVAL_UNDEF_VAR) -// error("Undefined variable %s.y", _name.c_str()); -// _w = g_gui.evaluator()->getVar(_name + ".w"); -// _h = g_gui.evaluator()->getVar(_name + ".h"); - _w = _x = _y = _h = 32; - _debugVisible = false; } - - _debugVisible = true; if (_x < 0) error("Widget <%s> has x < 0: %d", _name.c_str(), _x); diff --git a/gui/object.h b/gui/object.h index 9e5ea5fa60..01046bd668 100644 --- a/gui/object.h +++ b/gui/object.h @@ -78,10 +78,7 @@ public: virtual uint16 getWidth() const { return _w; } virtual uint16 getHeight() const { return _h; } -// Tanoku-TODO: fix this back virtual bool isVisible() const = 0; - bool _debugVisible; - virtual void draw() = 0; diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 9295e31a7d..1206ffc914 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -72,6 +72,16 @@ "gradient_end = '232, 192, 16' " "/> " "</drawdata> " +"<drawdata id = 'special_bg' cache = false> " +"<drawstep func = 'roundedsq' " +"radius = '4' " +"fill = 'gradient' " +"stroke = '0' " +"gradient_start = '208, 112, 8' " +"gradient_end = '232, 192, 16' " +"shadow = '3' " +"/> " +"</drawdata> " "<drawdata id = 'separator' cache = false> " "<drawstep func = 'square' " "fill = 'foreground' " @@ -397,11 +407,14 @@ "<widget name = 'OptionsLabel' " "size = '110, Globals.Line.Height' " "/> " +"<widget name = 'SmallLabel' " +"size = '24, Globals.Line.Height' " +"/> " "<widget name = 'Button' " -"size = '120, 25' " +"size = '108, 24' " "/> " "<widget name = 'Slider' " -"size = '256, 32' " +"size = '128, 18' " "/> " "<widget name = 'PopUp' " "size = '-1, 19' " @@ -529,8 +542,7 @@ "type = 'Slider' " "/> " "<widget name = 'subSubtitleSpeedLabel' " -"width = '32' " -"height = 'Globals.Line.Height' " +"type = 'SmallLabel' " "/> " "</layout> " "</layout> " @@ -545,8 +557,7 @@ "type = 'Slider' " "/> " "<widget name = 'vcMusicLabel' " -"width = '32' " -"height = 'Globals.Line.Height' " +"type = 'SmallLabel' " "/> " "</layout> " "<layout type = 'horizontal' padding = '0, 0, 0, 0'> " @@ -557,8 +568,7 @@ "type = 'Slider' " "/> " "<widget name = 'vcSfxLabel' " -"width = '32' " -"height = 'Globals.Line.Height' " +"type = 'SmallLabel' " "/> " "</layout> " "<layout type = 'horizontal' padding = '0, 0, 0, 0'> " @@ -569,8 +579,7 @@ "type = 'Slider' " "/> " "<widget name = 'vcSpeechLabel' " -"width = '32' " -"height = 'Globals.Line.Height' " +"type = 'SmallLabel' " "/> " "</layout> " "</layout> " @@ -606,8 +615,7 @@ "type = 'Slider' " "/> " "<widget name = 'mcMidiGainLabel' " -"width = '32' " -"height = 'Globals.Line.Height' " +"type = 'SmallLabel' " "/> " "</layout> " "</layout> " @@ -755,4 +763,99 @@ "</layout> " "</layout> " "</dialog> " +"<dialog name = 'ScummMain' overlays = 'screen_center'> " +"<layout type = 'vertical' padding = '8, 8, 8, 8'> " +"<widget name = 'Resume' " +"type = 'Button' " +"/> " +"<space size = '15'/> " +"<widget name = 'Load' " +"type = 'Button' " +"/> " +"<widget name = 'Save' " +"type = 'Button' " +"/> " +"<space size = '15'/> " +"<widget name = 'Options' " +"type = 'Button' " +"/> " +"<widget name = 'Help' " +"type = 'Button' " +"/> " +"<widget name = 'About' " +"type = 'Button' " +"/> " +"<space size = '15'/> " +"<widget name = 'Quit' " +"type = 'Button' " +"/> " +"</layout> " +"</dialog> " +"<dialog name = 'ScummConfig' overlays = 'screen_center'> " +"<layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true' direction = 'bottom2top'> " +"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> " +"<space size = 'Globals.Button.Width' /> " +"<widget name = 'Cancel' " +"type = 'Button' " +"/> " +"<widget name = 'Ok' " +"type = 'Button' " +"/> " +"</layout> " +"<space size = '100'/> " +"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> " +"<widget name = 'subSubtitleSpeedDesc' " +"type = 'OptionsLabel' " +"/> " +"<widget name = 'subSubtitleSpeedSlider' " +"type = 'Slider' " +"/> " +"<widget name = 'subSubtitleSpeedLabel' " +"type = 'SmallLabel' " +"/> " +"</layout> " +"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> " +"<widget name = 'subToggleDesc' " +"type = 'OptionsLabel' " +"/> " +"<widget name = 'subToggleButton' " +"width = '158' " +"height = 'Globals.Slider.Height' " +"/> " +"</layout> " +"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> " +"<widget name = 'vcSpeechText' " +"type = 'OptionsLabel' " +"/> " +"<widget name = 'vcSpeechSlider' " +"type = 'Slider' " +"/> " +"<widget name = 'vcSpeechLabel' " +"type = 'SmallLabel' " +"/> " +"</layout> " +"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> " +"<widget name = 'vcSfxText' " +"type = 'OptionsLabel' " +"/> " +"<widget name = 'vcSfxSlider' " +"type = 'Slider' " +"/> " +"<widget name = 'vcSfxLabel' " +"type = 'SmallLabel' " +"/> " +"</layout> " +"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> " +"<widget name = 'vcMusicText' " +"type = 'OptionsLabel' " +"/> " +"<widget name = 'vcMusicSlider' " +"type = 'Slider' " +"/> " +"<widget name = 'vcMusicLabel' " +"type = 'SmallLabel' " +"/> " +"</layout> " +"</layout> " +"</dialog> " "</layout_info> " diff --git a/gui/themes/modern.stx b/gui/themes/modern.stx index be55749806..26c0fcdfff 100644 --- a/gui/themes/modern.stx +++ b/gui/themes/modern.stx @@ -104,6 +104,17 @@ gradient_end = '232, 192, 16' /> </drawdata> + + <drawdata id = 'special_bg' cache = false> + <drawstep func = 'roundedsq' + radius = '4' + fill = 'gradient' + stroke = '0' + gradient_start = '208, 112, 8' + gradient_end = '232, 192, 16' + shadow = '3' + /> + </drawdata> <drawdata id = 'separator' cache = false> <drawstep func = 'square' @@ -458,11 +469,14 @@ <widget name = 'OptionsLabel' size = '110, Globals.Line.Height' /> + <widget name = 'SmallLabel' + size = '24, Globals.Line.Height' + /> <widget name = 'Button' - size = '120, 25' + size = '108, 24' /> <widget name = 'Slider' - size = '256, 32' + size = '128, 18' /> <widget name = 'PopUp' size = '-1, 19' @@ -595,8 +609,7 @@ type = 'Slider' /> <widget name = 'subSubtitleSpeedLabel' - width = '32' - height = 'Globals.Line.Height' + type = 'SmallLabel' /> </layout> </layout> @@ -612,8 +625,7 @@ type = 'Slider' /> <widget name = 'vcMusicLabel' - width = '32' - height = 'Globals.Line.Height' + type = 'SmallLabel' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> @@ -624,8 +636,7 @@ type = 'Slider' /> <widget name = 'vcSfxLabel' - width = '32' - height = 'Globals.Line.Height' + type = 'SmallLabel' /> </layout> <layout type = 'horizontal' padding = '0, 0, 0, 0'> @@ -636,8 +647,7 @@ type = 'Slider' /> <widget name = 'vcSpeechLabel' - width = '32' - height = 'Globals.Line.Height' + type = 'SmallLabel' /> </layout> </layout> @@ -674,8 +684,7 @@ type = 'Slider' /> <widget name = 'mcMidiGainLabel' - width = '32' - height = 'Globals.Line.Height' + type = 'SmallLabel' /> </layout> </layout> @@ -832,4 +841,101 @@ </layout> </layout> </dialog> + + <dialog name = 'ScummMain' overlays = 'screen_center'> + <layout type = 'vertical' padding = '8, 8, 8, 8'> + <widget name = 'Resume' + type = 'Button' + /> + <space size = '15'/> + <widget name = 'Load' + type = 'Button' + /> + <widget name = 'Save' + type = 'Button' + /> + <space size = '15'/> + <widget name = 'Options' + type = 'Button' + /> + <widget name = 'Help' + type = 'Button' + /> + <widget name = 'About' + type = 'Button' + /> + <space size = '15'/> + <widget name = 'Quit' + type = 'Button' + /> + </layout> + </dialog> + + <dialog name = 'ScummConfig' overlays = 'screen_center'> + <layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true' direction = 'bottom2top'> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> + <space size = 'Globals.Button.Width' /> + <widget name = 'Cancel' + type = 'Button' + /> + <widget name = 'Ok' + type = 'Button' + /> + </layout> + <space size = '100'/> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> + <widget name = 'subSubtitleSpeedDesc' + type = 'OptionsLabel' + /> + <widget name = 'subSubtitleSpeedSlider' + type = 'Slider' + /> + <widget name = 'subSubtitleSpeedLabel' + type = 'SmallLabel' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> + <widget name = 'subToggleDesc' + type = 'OptionsLabel' + /> + <widget name = 'subToggleButton' + width = '158' + height = 'Globals.Slider.Height' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> + <widget name = 'vcSpeechText' + type = 'OptionsLabel' + /> + <widget name = 'vcSpeechSlider' + type = 'Slider' + /> + <widget name = 'vcSpeechLabel' + type = 'SmallLabel' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> + <widget name = 'vcSfxText' + type = 'OptionsLabel' + /> + <widget name = 'vcSfxSlider' + type = 'Slider' + /> + <widget name = 'vcSfxLabel' + type = 'SmallLabel' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'> + <widget name = 'vcMusicText' + type = 'OptionsLabel' + /> + <widget name = 'vcMusicSlider' + type = 'Slider' + /> + <widget name = 'vcMusicLabel' + type = 'SmallLabel' + /> + </layout> + </layout> + </dialog> </layout_info>
\ No newline at end of file |