Merge "Add conditions support to GUIImage" into twrp2.7
This commit is contained in:
+4
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -215,7 +215,7 @@ protected:
|
||||
};
|
||||
|
||||
// GUIImage - Used for static image
|
||||
class GUIImage : public RenderObject
|
||||
class GUIImage : public RenderObject, public Conditional
|
||||
{
|
||||
public:
|
||||
GUIImage(xml_node<>* node);
|
||||
|
||||
Reference in New Issue
Block a user