Patch v5.2 from #1752243: "backends lib patches"

svn-id: r29283
This commit is contained in:
Eugene Sandulenko 2007-10-28 12:04:38 +00:00
parent 4073e7f8f8
commit 61c96353cf
5 changed files with 25 additions and 3 deletions

View File

@ -886,6 +886,17 @@ public:
*/
virtual Common::SaveFileManager *getSavefileManager() = 0;
/**
* Return String which is used for backend-specific addition to theme
* config.
*
* Typical usage is to disable unneeded GUI widgets or defining
* theme-specific tab.
*/
virtual Common::String getExtraThemeConfig() {
return "";
}
//@}
};

View File

@ -70,7 +70,7 @@ bool ThemeClassic::init() {
if (isThemeLoadingRequired()) {
loadTheme(_defaultConfig);
loadTheme(_configFile, false);
loadTheme(_configFile, false, true);
setupConfig();
}

View File

@ -135,7 +135,7 @@ bool ThemeModern::init() {
if (isThemeLoadingRequired()) {
loadTheme(_defaultConfig);
loadTheme(_configFile, false); // Don't reset
loadTheme(_configFile, false, true); // Don't reset
processExtraValues();
}

View File

@ -765,5 +765,16 @@ void Theme::loadTheme(Common::ConfigFile &config, bool reset) {
debug(3, "Number of variables: %d", _evaluator->getNumVars());
}
void Theme::loadTheme(Common::ConfigFile &config, bool reset, bool doBackendSpecificPostProcessing) {
loadTheme(config, reset);
if (doBackendSpecificPostProcessing && !g_system->getExtraThemeConfig().empty()) {
Common::ConfigFile myConfig;
Common::String myConfigINI = g_system->getExtraThemeConfig();
Common::MemoryReadStream s((const byte *)myConfigINI.c_str(), strlen(myConfigINI.c_str()));
myConfig.loadFromStream(s);
loadTheme(myConfig, false);
}
}
} // End of namespace GUI

View File

@ -210,7 +210,7 @@ public:
bool isThemeLoadingRequired();
bool sectionIsSkipped(Common::ConfigFile &config, const char *name, int w, int h);
void loadTheme(Common::ConfigFile &config, bool reset = true);
void loadTheme(Common::ConfigFile &config, bool reset, bool doBackendSpecificPostProcessing);
Eval *_evaluator;
static bool themeConfigUseable(const Common::String &file, const Common::String &style="", Common::String *cStyle=0, Common::ConfigFile *cfg=0);