summaryrefslogtreecommitdiffstats
path: root/gui/console.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/console.cpp')
-rw-r--r--gui/console.cpp35
1 files changed, 8 insertions, 27 deletions
diff --git a/gui/console.cpp b/gui/console.cpp
index 9c780c06b..bb70400c9 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -129,32 +129,15 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIObject(node)
child = node->first_node("font");
if (child)
{
- attr = child->first_attribute("resource");
- if (attr)
- mFont = PageManager::FindResource(attr->value());
+ mFont = LoadAttrFont(child, "resource");
}
child = node->first_node("color");
if (child)
{
- attr = child->first_attribute("foreground");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mForegroundColor);
- }
- attr = child->first_attribute("background");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mBackgroundColor);
- }
- attr = child->first_attribute("scroll");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mScrollColor);
- }
+ mForegroundColor = LoadAttrColor(child, "foreground", mForegroundColor);
+ mBackgroundColor = LoadAttrColor(child, "background", mBackgroundColor);
+ mScrollColor = LoadAttrColor(child, "scroll", mScrollColor);
}
// Load the placement
@@ -166,21 +149,19 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIObject(node)
mSlideout = 1;
LoadPlacement(child, &mSlideoutX, &mSlideoutY);
- attr = child->first_attribute("resource");
- if (attr) mSlideoutImage = PageManager::FindResource(attr->value());
+ mSlideoutImage = LoadAttrImage(child, "resource");
if (mSlideoutImage && mSlideoutImage->GetResource())
{
- mSlideoutW = gr_get_width(mSlideoutImage->GetResource());
- mSlideoutH = gr_get_height(mSlideoutImage->GetResource());
+ mSlideoutW = mSlideoutImage->GetWidth();
+ mSlideoutH = mSlideoutImage->GetHeight();
}
}
}
- mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
+ mFontHeight = mFont->GetHeight();
SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH);
SetRenderPos(mConsoleX, mConsoleY);
- return;
}
int GUIConsole::RenderSlideout(void)