aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorVicent Marti2008-08-07 23:23:21 +0000
committerVicent Marti2008-08-07 23:23:21 +0000
commit39c28e434beb94addd9788e7ab7c4dd9d66ca12e (patch)
treed5ba85aa17ef903578a1088af64ee3b5ace3a289 /gui
parent8d98d5fa13929453a0d30a7dd5ca92203cdc0af2 (diff)
downloadscummvm-rg350-39c28e434beb94addd9788e7ab7c4dd9d66ca12e.tar.gz
scummvm-rg350-39c28e434beb94addd9788e7ab7c4dd9d66ca12e.tar.bz2
scummvm-rg350-39c28e434beb94addd9788e7ab7c4dd9d66ca12e.zip
SCUMM general and options dialog.
Misc fixes. svn-id: r33692
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEval.cpp21
-rw-r--r--gui/ThemeEval.h4
-rw-r--r--gui/ThemeParser.cpp8
-rw-r--r--gui/ThemeRenderer.cpp6
-rw-r--r--gui/newgui.cpp11
-rw-r--r--gui/object.h3
-rw-r--r--gui/themes/default.inc127
-rw-r--r--gui/themes/modern.stx130
8 files changed, 260 insertions, 50 deletions
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