Solved "IsEmpty" not working with variable?
#2
Solved, it's always the same, you strugle with something for a long time (not that much, just a couple of days) and inmediately after you ask for help, you finally find the solution. For completeness, I include it here, maybe it'll help somebody in the future.

Short answer: NO, String.IsEmpty doesn't work with variables.

...but there is a simple hack or workaround:

You have to create a dummy text label. It'll be invisible and it'll contain the text of the variable:


<control type="label" id="6661">
    <description>Dummy label to control the visibility of fanart image</description>
    <label>$VAR[MetaFanart]</label>
    <visible>false</visible>
</control>

Then, you control the visibility of your "real" control checking if the dummy control is empty or not:

<control type="image">
    <description>Fanart Image</description>
    <include>BackgroundDimensions</include>
    <texture>$VAR[MetaFanart]</texture>
    <visible>!String.IsEmpty(Control.GetLabel(6661))</visible>
</control>
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average


Messages In This Thread
RE: "IsEmpty" not working with variable? - by PixelGordo - 2019-09-06, 10:47


Logout Mark Read Team Forum Stats Members Help
"IsEmpty" not working with variable?00