mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-19 13:25:38 +00:00
add badges definition to theme interpreter
This commit is contained in:
parent
7193d09845
commit
6b727e3883
|
@ -146,6 +146,15 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>> The
|
||||||
{"unfilledPath", PATH},
|
{"unfilledPath", PATH},
|
||||||
{"visible", BOOLEAN},
|
{"visible", BOOLEAN},
|
||||||
{"zIndex", FLOAT}}},
|
{"zIndex", FLOAT}}},
|
||||||
|
{"badges",
|
||||||
|
{{"pos", NORMALIZED_PAIR},
|
||||||
|
{"size", NORMALIZED_PAIR},
|
||||||
|
{"origin", NORMALIZED_PAIR},
|
||||||
|
{"direction", STRING},
|
||||||
|
{"slots", STRING},
|
||||||
|
{"customBadgeIcon", PATH},
|
||||||
|
{"visible", BOOLEAN},
|
||||||
|
{"zIndex", FLOAT}}},
|
||||||
{"sound", {{"path", PATH}}},
|
{"sound", {{"path", PATH}}},
|
||||||
{"helpsystem",
|
{"helpsystem",
|
||||||
{{"pos", NORMALIZED_PAIR},
|
{{"pos", NORMALIZED_PAIR},
|
||||||
|
@ -503,8 +512,8 @@ void ThemeData::parseElement(const pugi::xml_node& root,
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special parsing instruction for customButtonIcon -> save node as it's button
|
// Special parsing instruction for recurring options.
|
||||||
// attribute to prevent nodes overwriting each other.
|
// Store as it's attribute to prevent nodes overwriting each other.
|
||||||
if (strcmp(node.name(), "customButtonIcon") == 0) {
|
if (strcmp(node.name(), "customButtonIcon") == 0) {
|
||||||
const auto btn = node.attribute("button").as_string("");
|
const auto btn = node.attribute("button").as_string("");
|
||||||
if (strcmp(btn, "") == 0)
|
if (strcmp(btn, "") == 0)
|
||||||
|
@ -513,6 +522,13 @@ void ThemeData::parseElement(const pugi::xml_node& root,
|
||||||
else
|
else
|
||||||
element.properties[btn] = path;
|
element.properties[btn] = path;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(node.name(), "customBadgeIcon") == 0) {
|
||||||
|
const auto btn = node.attribute("badge").as_string("");
|
||||||
|
if (strcmp(btn, "") == 0)
|
||||||
|
LOG(LogError) << "<customBadgeIcon> element requires the `badge` property.";
|
||||||
|
else
|
||||||
|
element.properties[btn] = path;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
element.properties[node.name()] = path;
|
element.properties[node.name()] = path;
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,10 @@ based on: 'recalbox-multi' by the Recalbox community
|
||||||
<origin>0 0</origin>
|
<origin>0 0</origin>
|
||||||
<direction>row</direction>
|
<direction>row</direction>
|
||||||
<slots>favorite completed kids broken</slots>
|
<slots>favorite completed kids broken</slots>
|
||||||
|
<customBadgeIcon badge="favorite">:/graphics/star_filled.svg</customBadgeIcon>
|
||||||
|
<customBadgeIcon badge="completed">:/graphics/star_filled.svg</customBadgeIcon>
|
||||||
|
<customBadgeIcon badge="kids">:/graphics/star_filled.svg</customBadgeIcon>
|
||||||
|
<customBadgeIcon badge="broken">:/graphics/star_filled.svg</customBadgeIcon>
|
||||||
</badges>
|
</badges>
|
||||||
<!-- This block prevents additional elements from interfering when mixing layouts. -->
|
<!-- This block prevents additional elements from interfering when mixing layouts. -->
|
||||||
<image name="backframe4" extra="false"></image>
|
<image name="backframe4" extra="false"></image>
|
||||||
|
|
Loading…
Reference in a new issue