[Scummvm-cvs-logs] SF.net SVN: scummvm:[33692] scummvm/branches/gsoc2008-gui

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Fri Aug 8 01:23:22 CEST 2008


Revision: 33692
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33692&view=rev
Author:   Tanoku
Date:     2008-08-07 23:23:21 +0000 (Thu, 07 Aug 2008)

Log Message:
-----------
SCUMM general and options dialog.
Misc fixes.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/engines/scumm/dialogs.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeEval.h
    scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
    scummvm/branches/gsoc2008-gui/gui/newgui.cpp
    scummvm/branches/gsoc2008-gui/gui/object.h
    scummvm/branches/gsoc2008-gui/gui/themes/default.inc
    scummvm/branches/gsoc2008-gui/gui/themes/modern.stx

Modified: scummvm/branches/gsoc2008-gui/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/scumm/dialogs.cpp	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/engines/scumm/dialogs.cpp	2008-08-07 23:23:21 UTC (rev 33692)
@@ -443,20 +443,20 @@
 }
 
 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 @@
 //  "" 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

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeEval.cpp	2008-08-07 23:23:21 UTC (rev 33692)
@@ -64,8 +64,17 @@
 		_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::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());
 	}
 	

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeEval.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeEval.h	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeEval.h	2008-08-07 23:23:21 UTC (rev 33692)
@@ -365,8 +365,8 @@
 	}
 
 	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:

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp	2008-08-07 23:23:21 UTC (rev 33692)
@@ -565,9 +565,13 @@
 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;

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-08-07 23:23:21 UTC (rev 33692)
@@ -718,9 +718,9 @@
 		
 	renderDirtyScreen();
 
-// 	_vectorRenderer->fillSurface();
-// 	themeEval()->debugDraw(_screen, _font);
-// 	_vectorRenderer->copyWholeFrame(_system);
+//	_vectorRenderer->fillSurface();
+//	themeEval()->debugDraw(_screen, _font);
+//	_vectorRenderer->copyWholeFrame(_system);
 }
 
 void ThemeRenderer::renderDirtyScreen() {

Modified: scummvm/branches/gsoc2008-gui/gui/newgui.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/newgui.cpp	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/newgui.cpp	2008-08-07 23:23:21 UTC (rev 33692)
@@ -60,18 +60,7 @@
 	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);

Modified: scummvm/branches/gsoc2008-gui/gui/object.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/object.h	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/object.h	2008-08-07 23:23:21 UTC (rev 33692)
@@ -78,11 +78,8 @@
 	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;
 
 	virtual void	reflowLayout();

Modified: scummvm/branches/gsoc2008-gui/gui/themes/default.inc
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/themes/default.inc	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/themes/default.inc	2008-08-07 23:23:21 UTC (rev 33692)
@@ -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> "

Modified: scummvm/branches/gsoc2008-gui/gui/themes/modern.stx
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/themes/modern.stx	2008-08-07 21:50:12 UTC (rev 33691)
+++ scummvm/branches/gsoc2008-gui/gui/themes/modern.stx	2008-08-07 23:23:21 UTC (rev 33692)
@@ -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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list