diff options
| author | Max Horn | 2006-03-09 12:52:10 +0000 | 
|---|---|---|
| committer | Max Horn | 2006-03-09 12:52:10 +0000 | 
| commit | 46ee5c8f26b8b53d0c7268a8328edea0b4134611 (patch) | |
| tree | f59d90e1b7aa70dc0a5e9e0e37112cf5023899bd /base/plugins.cpp | |
| parent | cd732d680bf251458fe8c22e8694e2475e3b2927 (diff) | |
| download | scummvm-rg350-46ee5c8f26b8b53d0c7268a8328edea0b4134611.tar.gz scummvm-rg350-46ee5c8f26b8b53d0c7268a8328edea0b4134611.tar.bz2 scummvm-rg350-46ee5c8f26b8b53d0c7268a8328edea0b4134611.zip | |
Added new method DetectedGame::updateDesc, to ease generation of uniform description strings
svn-id: r21166
Diffstat (limited to 'base/plugins.cpp')
| -rw-r--r-- | base/plugins.cpp | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/base/plugins.cpp b/base/plugins.cpp index 0f1fc62b18..80f19bd775 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -71,6 +71,37 @@ PluginRegistrator::PluginRegistrator(const char *name, GameList games, GameIDQue  #pragma mark - + +void DetectedGame::updateDesc(const char *extra) { +	// TODO: The format used here (LANG/PLATFORM/EXTRA) is not set in stone. +	// We may want to change the order (PLATFORM/EXTRA/LANG, anybody?), or +	// the seperator (instead of '/' use ', ' or ' '). +	const bool hasCustomLanguage = (language != Common::UNK_LANG); +	const bool hasCustomPlatform = (platform != Common::kPlatformUnknown); +	const bool hasExtraDesc = (extra && extra[0]); + +	// Adapt the description string if custom platform/language is set. +	if (hasCustomLanguage || hasCustomPlatform || hasExtraDesc) { +		description += " ("; +		if (hasCustomLanguage) +			description += Common::getLanguageDescription(language); +		if (hasCustomPlatform) { +			if (hasCustomLanguage) +				description += "/"; +			description += Common::getPlatformDescription(platform); +		} +		if (hasExtraDesc) { +			if (hasCustomPlatform || hasCustomLanguage) +				description += "/"; +			description += extra; +		} +		description += ")"; +	} +} + + +#pragma mark - +  #ifndef DYNAMIC_MODULES  class StaticPlugin : public Plugin {  	PluginRegistrator *_plugin; | 
