mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-30 03:55:40 +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},
|
||||
{"visible", BOOLEAN},
|
||||
{"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}}},
|
||||
{"helpsystem",
|
||||
{{"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
|
||||
// attribute to prevent nodes overwriting each other.
|
||||
// Special parsing instruction for recurring options.
|
||||
// Store as it's attribute to prevent nodes overwriting each other.
|
||||
if (strcmp(node.name(), "customButtonIcon") == 0) {
|
||||
const auto btn = node.attribute("button").as_string("");
|
||||
if (strcmp(btn, "") == 0)
|
||||
|
@ -513,6 +522,13 @@ void ThemeData::parseElement(const pugi::xml_node& root,
|
|||
else
|
||||
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
|
||||
element.properties[node.name()] = path;
|
||||
|
||||
|
|
|
@ -242,6 +242,10 @@ based on: 'recalbox-multi' by the Recalbox community
|
|||
<origin>0 0</origin>
|
||||
<direction>row</direction>
|
||||
<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>
|
||||
<!-- This block prevents additional elements from interfering when mixing layouts. -->
|
||||
<image name="backframe4" extra="false"></image>
|
||||
|
|
Loading…
Reference in a new issue