From 105438d77ce83972d70a1ce67728aaf72c9ec2b6 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sat, 10 Jul 2010 19:00:50 +0200 Subject: Moved parsing of specials.xml from gui/specialswindow.cpp to separate source files. Restored functional recharge bars in specials window. Individual specials are only shown after the server informed the client about their status. Made level label, use button and progress bars optional. Their use is controlled through specials.xml. The special window button is again shown even when the player has no specials. This problem needs to be solved differently now for architecture reasons. Reviewed-by: Jaxad0127 --- src/utils/xml.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/utils/xml.cpp') diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 341f34c0..94e0e38d 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -27,6 +27,7 @@ #include #include +#include namespace XML { @@ -135,6 +136,15 @@ namespace XML return def; } + bool getBoolProperty(xmlNodePtr node, const char* name, bool def) + { + xmlChar *prop = xmlGetProp(node, BAD_CAST name); + + if (xmlStrEqual(prop, BAD_CAST "true" ) ) return true; + if (xmlStrEqual(prop, BAD_CAST "false") ) return false; + return def; + } + xmlNodePtr findFirstChildByName(xmlNodePtr parent, const char *name) { for_each_xml_child_node(child, parent) -- cgit v1.2.3-70-g09d2