You've already forked emulationstation-next
mirror of
https://github.com/archr-linux/emulationstation-next.git
synced 2026-07-13 03:19:12 -07:00
[Theming] Support new declaration for variables ( <variable name="xx" value="xx"> ) Older declarations are unchanged.
This commit is contained in:
committed by
Douglas Teles
parent
33f29c5d94
commit
eabb425fdd
@@ -765,7 +765,7 @@ void ThemeData::loadFile(const std::string& system, const std::map<std::string,
|
||||
mVariables["themePath"] = Utils::FileSystem::getParent(mPaths.back());
|
||||
mVariables["region"] = mRegion;
|
||||
mVariables["root"] = Utils::FileSystem::getParent(mPaths.back());
|
||||
|
||||
|
||||
for (auto name : Settings::getInstance()->getSettingsNames())
|
||||
{
|
||||
if (name.find(".") != std::string::npos)
|
||||
@@ -1188,6 +1188,12 @@ void ThemeData::parseVariable(const pugi::xml_node& node)
|
||||
|
||||
std::string val = node.text().as_string();
|
||||
|
||||
if (key == "variable" && node.attribute("name") && node.attribute("value"))
|
||||
{
|
||||
key = node.attribute("name").as_string();
|
||||
val = resolvePlaceholders(node.attribute("value").as_string());
|
||||
}
|
||||
|
||||
if (val == "true" || val == "false")
|
||||
{
|
||||
mVariables[key] = val;
|
||||
|
||||
Reference in New Issue
Block a user