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
+9 -1
View File
@@ -70,8 +70,10 @@ GUIFileSelector::GUIFileSelector(xml_node<>* node) : GUIScrollList(node)
if (attr)
mPathVar = attr->value();
attr = child->first_attribute("default");
if (attr)
if (attr) {
mPathDefault = attr->value();
DataManager::SetValue(mPathVar, attr->value());
}
}
// Handle the result variable
@@ -168,6 +170,8 @@ int GUIFileSelector::NotifyVarChange(const std::string& varName, const std::stri
} else {
// Reset the list to the top
SetVisibleListLocation(0);
if (value.empty())
DataManager::SetValue(mPathVar, mPathDefault);
}
updateFileList = true;
mUpdate = 1;
@@ -288,6 +292,10 @@ void GUIFileSelector::SetPageFocus(int inFocus)
{
GUIScrollList::SetPageFocus(inFocus);
if (inFocus) {
std::string value;
DataManager::GetValue(mPathVar, value);
if (value.empty())
DataManager::SetValue(mPathVar, mPathDefault);
updateFileList = true;
mUpdate = 1;
}