From 6041a78f8f8ab08258c1ef16146e49ecf2ee81b0 Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Fri, 11 Oct 2013 14:40:01 +0200 Subject: Add conditions support to GUIImage Signed-off-by: Vojtech Bocek --- gui/image.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gui/image.cpp') diff --git a/gui/image.cpp b/gui/image.cpp index 45d863673..31d9418d3 100644 --- a/gui/image.cpp +++ b/gui/image.cpp @@ -25,7 +25,7 @@ extern "C" { #include "rapidxml.hpp" #include "objects.hpp" -GUIImage::GUIImage(xml_node<>* node) +GUIImage::GUIImage(xml_node<>* node) : Conditional(node) { xml_attribute<>* attr; xml_node<>* child; @@ -79,6 +79,9 @@ GUIImage::GUIImage(xml_node<>* node) int GUIImage::Render(void) { + if (!isConditionTrue()) + return 0; + if (isHighlighted && mHighlightImage && mHighlightImage->GetResource()) { gr_blit(mHighlightImage->GetResource(), 0, 0, mRenderW, mRenderH, mRenderX, mRenderY); return 0; -- cgit v1.2.3