GUI: Support styles in xml to reduce xml file size

Also allow sliders to have their own text label instead of
requiring a whole separate text object for the label in the xml.

Change-Id: I6e314efb4bb454d496555ff7e003d743063a1308
This commit is contained in:
Ethan Yonker
2015-02-21 08:14:24 -06:00
parent 10ec0175c8
commit 21ff02a693
25 changed files with 1055 additions and 2977 deletions
+5 -9
View File
@@ -44,18 +44,14 @@ GUIText::GUIText(xml_node<>* node)
mHighlightColor = LoadAttrColor(node, "highlightcolor", mColor);
// Load the font, and possibly override the color
xml_node<>* child = node->first_node("font");
if (child)
{
mFont = LoadAttrFont(child, "resource");
mColor = LoadAttrColor(child, "color", mColor);
mHighlightColor = LoadAttrColor(child, "highlightcolor", mColor);
}
mFont = LoadAttrFont(FindNode(node, "font"), "resource");
mColor = LoadAttrColor(FindNode(node, "font"), "color", mColor);
mHighlightColor = LoadAttrColor(FindNode(node, "font"), "highlightcolor", mColor);
// Load the placement
LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH, &mPlacement);
LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH, &mPlacement);
child = node->first_node("text");
xml_node<>* child = FindNode(node, "text");
if (child) mText = child->value();
// Simple way to check for static state