summaryrefslogtreecommitdiffstats
path: root/gui/progressbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/progressbar.cpp')
-rw-r--r--gui/progressbar.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/gui/progressbar.cpp b/gui/progressbar.cpp
index a4d132932..a49e0abb2 100644
--- a/gui/progressbar.cpp
+++ b/gui/progressbar.cpp
@@ -45,13 +45,8 @@ GUIProgressBar::GUIProgressBar(xml_node<>* node) : GUIObject(node)
child = node->first_node("resource");
if (child)
{
- attr = child->first_attribute("empty");
- if (attr)
- mEmptyBar = PageManager::FindResource(attr->value());
-
- attr = child->first_attribute("full");
- if (attr)
- mFullBar = PageManager::FindResource(attr->value());
+ mEmptyBar = LoadAttrImage(child, "empty");
+ mFullBar = LoadAttrImage(child, "full");
}
// Load the placement
@@ -61,23 +56,13 @@ GUIProgressBar::GUIProgressBar(xml_node<>* node) : GUIObject(node)
child = node->first_node("data");
if (child)
{
- attr = child->first_attribute("min");
- if (attr) mMinValVar = attr->value();
-
- attr = child->first_attribute("max");
- if (attr) mMaxValVar = attr->value();
-
- attr = child->first_attribute("name");
- if (attr) mCurValVar = attr->value();
- }
-
- if (mEmptyBar && mEmptyBar->GetResource())
- {
- mRenderW = gr_get_width(mEmptyBar->GetResource());
- mRenderH = gr_get_height(mEmptyBar->GetResource());
+ mMinValVar = LoadAttrString(child, "min");
+ mMaxValVar = LoadAttrString(child, "max");
+ mCurValVar = LoadAttrString(child, "name");
}
- return;
+ mRenderW = mEmptyBar->GetWidth();
+ mRenderH = mEmptyBar->GetHeight();
}
int GUIProgressBar::Render(void)