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-18 14:35:00 -06:00
parent 10ec0175c8
commit 21ff02a693
25 changed files with 1055 additions and 2977 deletions

View File

@@ -27,9 +27,6 @@ extern "C" {
GUIImage::GUIImage(xml_node<>* node) : GUIObject(node)
{
xml_attribute<>* attr;
xml_node<>* child;
mImage = NULL;
mHighlightImage = NULL;
isHighlighted = false;
@@ -37,15 +34,11 @@ GUIImage::GUIImage(xml_node<>* node) : GUIObject(node)
if (!node)
return;
child = node->first_node("image");
if (child)
{
mImage = LoadAttrImage(child, "resource");
mHighlightImage = LoadAttrImage(child, "highlightresource");
}
mImage = LoadAttrImage(FindNode(node, "image"), "resource");
mHighlightImage = LoadAttrImage(FindNode(node, "image"), "highlightresource");
// Load the placement
LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
if (mImage && mImage->GetResource())
{