[Scummvm-cvs-logs] CVS: scummvm/gui launcher.cpp,1.88.2.3,1.88.2.4

James Brown ender at users.sourceforge.net
Sat Jul 10 21:38:02 CEST 2004


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31669/gui

Modified Files:
      Tag: branch-0-6-0
	launcher.cpp 
Log Message:
Bump version, backport launcher 'Path' changes. Add Sword1 support, and better error messages referring to the forthcoming new manual. Still needs work, Sword1 CD changing isn't working as expected.CVS: ----------------------------------------------------------------------


Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.88.2.3
retrieving revision 1.88.2.4
diff -u -d -r1.88.2.3 -r1.88.2.4
--- launcher.cpp	2 May 2004 16:36:03 -0000	1.88.2.3
+++ launcher.cpp	11 Jul 2004 04:36:56 -0000	1.88.2.4
@@ -61,7 +61,11 @@
 	
 	kCmdGlobalGraphicsOverride = 'OGFX',
 	kCmdGlobalAudioOverride = 'OSFX',
-	kCmdGlobalVolumeOverride = 'OVOL'
+	kCmdGlobalVolumeOverride = 'OVOL',
+
+	kCmdExtraBrowser = 'PEXT',
+	kCmdGameBrowser = 'PGME',
+	kCmdSaveBrowser = 'PSAV'
 };
 
 /*
@@ -94,6 +98,10 @@
 	EditTextWidget *_descriptionWidget;
 	EditTextWidget *_domainWidget;
 
+	StaticTextWidget *_gamePathWidget;
+	StaticTextWidget *_extraPathWidget;
+	StaticTextWidget *_savePathWidget;
+
 	PopUpWidget *_langPopUp;
 	PopUpWidget *_platformPopUp;
 
@@ -111,8 +119,10 @@
 	const int vBorder = 5;	// Tab border
 	int yoffset;
 
-	// GAME: Path to game data (r/o)
-	String path(ConfMan.get("path", _domain));
+	// GAME: Path to game data (r/o), extra data (r/o), and save data (r/w)
+	String gamePath(ConfMan.get("path", _domain));
+	String extraPath(ConfMan.get("extrapath", _domain));
+	String savePath(ConfMan.get("savepath", _domain));
 
 	// GAME: Determine the description string
 	String description(ConfMan.get("description", domain));
@@ -139,12 +149,7 @@
 	_descriptionWidget = new EditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10, kLineHeight, description);
 	yoffset += 16;
 
-	// GUI:  Label for the game path
-	new StaticTextWidget(tab, x, yoffset, labelWidth, kLineHeight, "Path: ", kTextAlignRight);
-	new StaticTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10, kLineHeight, path, kTextAlignLeft);
-	yoffset += 16;
-
-	// Languag popup
+	// Language popup
 	_langPopUp = new PopUpWidget(tab, x, yoffset, w, kLineHeight, "Language: ", labelWidth);
 	yoffset += 16;
 	_langPopUp->appendEntry("<default>");
@@ -164,10 +169,34 @@
 		_platformPopUp->appendEntry(p->description, p->id);
 	}
 
+	// 2) The 'Path' tab
+	tab->addTab("Paths");
+	yoffset = vBorder;
+	// GUI:  Button + Label for the game path
+ 	new ButtonWidget(tab, x, yoffset, kButtonWidth + 14, 16, "Game Path:", kCmdGameBrowser, 0);
+	_gamePathWidget = new StaticTextWidget(tab, x + kButtonWidth + 20, yoffset, _w - labelWidth - 10, kLineHeight, gamePath, kTextAlignLeft);
+	yoffset += 18;
+
+	// GUI:  Button + Label for the additional path
+ 	new ButtonWidget(tab, x, yoffset, kButtonWidth + 14, 16, "Extra Path:", kCmdExtraBrowser, 0);
+	_extraPathWidget = new StaticTextWidget(tab, x + kButtonWidth + 20, yoffset, _w - labelWidth - 10, kLineHeight, extraPath, kTextAlignLeft);
+	if (extraPath.isEmpty()) {
+		_extraPathWidget->setLabel("None");
+	}
+	yoffset += 18;
+
+	// GUI:  Button + Label for the save path
+ 	new ButtonWidget(tab, x, yoffset, kButtonWidth + 14, 16, "Save Path:", kCmdSaveBrowser, 0);
+	_savePathWidget = new StaticTextWidget(tab, x + kButtonWidth + 20, yoffset, _w - labelWidth - 10, kLineHeight, savePath, kTextAlignLeft);
+	if (savePath.isEmpty()) {
+		_savePathWidget->setLabel("Default");
+	}
+	yoffset += 18;
+
 	//
 	// 2) The graphics tab
 	//
-	tab->addTab("Graphics");
+	tab->addTab("Gfx");
 	yoffset = vBorder;
 
 	_globalGraphicsOverride = new CheckboxWidget(tab, x, yoffset, w, 16, "Override global graphic settings", kCmdGlobalGraphicsOverride);
@@ -231,7 +260,6 @@
 
 	// TODO: game path
 
-
 	const Common::LanguageDescription *l = Common::g_languages;
 	const Common::Language lang = Common::parseLanguage(ConfMan.get("language", _domain));
 	sel = 0;
@@ -263,6 +291,18 @@
 		else
 			ConfMan.set("language", Common::getLanguageCode(lang), _domain);
 
+		String gamePath = _gamePathWidget->getLabel();
+		if (!gamePath.isEmpty())
+			ConfMan.set("path", gamePath, _domain);
+
+		String extraPath = _extraPathWidget->getLabel();
+		if (!extraPath.isEmpty() && (extraPath != "None"))
+			ConfMan.set("extrapath", extraPath, _domain);
+
+		String savePath = _savePathWidget->getLabel();
+		if (!extraPath.isEmpty() && (extraPath != "Default"))
+			ConfMan.set("savepath", extraPath, _domain);
+
 		Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag();
 		if (platform < 0)
 			ConfMan.removeKey("platform", _domain);
@@ -286,6 +326,47 @@
 		setVolumeSettingsState(data != 0);
 		draw();
 		break;
+
+	// Change path for the game
+	case kCmdGameBrowser: {
+		BrowserDialog *_browser = new BrowserDialog("Select additional game directory");
+	        if (_browser->runModal() > 0) {
+        	        // User made his choice...
+                	FilesystemNode *dir = _browser->getResult();
+
+			// TODO: Verify the game can be found in the new directory... Best
+			// done with optional specific gameid to pluginmgr detectgames?
+			// FSList *files = dir->listDir(FilesystemNode::kListFilesOnly);
+
+			_gamePathWidget->setLabel(dir->path());
+		}
+		draw();
+		break;
+	}
+
+	// Change path for extra game data (eg, using sword cutscenes when playing via CD)
+	case kCmdExtraBrowser: { 
+		BrowserDialog *_browser = new BrowserDialog("Select additional game directory");
+	        if (_browser->runModal() > 0) {
+        	        // User made his choice...
+                	FilesystemNode *dir = _browser->getResult();
+			_extraPathWidget->setLabel(dir->path());
+		}
+		draw();
+		break;
+	}
+	// Change path for stored save game (perm and temp) data
+	case kCmdSaveBrowser: {
+		BrowserDialog *_browser = new BrowserDialog("Select directory for saved games");
+	        if (_browser->runModal() > 0) {
+        	        // User made his choice...
+                	FilesystemNode *dir = _browser->getResult();
+			_savePathWidget->setLabel(dir->path());
+		}
+		draw();
+		break;
+	}
+
 	case kOKCmd: {
 		// Write back changes made to config object
 		String newDomain(_domainWidget->getLabel());





More information about the Scummvm-git-logs mailing list