Check if flag image exists
#1
I was re-doing the flags and i ran into something.

i was using for example:
<texture>$INFO[Listitem.VideoCodec,flags/,.png]</texture>
and
<visible>!IsEmpty(Listitem.VideoCodec)</visible>

But if i do not have the flag image for some uncommon codec, then i get a gap in my horizontal grouplist.

So how do i check if the image exists?
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#2
PHP Code:
<control type="image" id="1">
    [...]
    <
texture fallback=".">$INFO[Listitem.VideoCodec,flags/,.png]</texture>
    <
visible>!StringCompare(Control.GetLabel(1),.)</visible>
</
control

This doesn't work inside a list control but should work in a group list.
Image
Reply
#3
My grouplist does not like it. It's tripping out.
Am i here, am i there, idunno?

Code:
<control type="image" id="962">
    <width>96</width>
    <height>56</height>
    <texture fallback="empty.png">$INFO[Listitem.VideoCodec,flags/,.png]</texture>
    <aspectratio>keep</aspectratio>
    <visible>!StringCompare(Control.GetLabel(962),empty.png)</visible>
</control>
Tried with and without using control coordinates on the grouplist, but same result.
Tried with the dot and with empty.png. Different id's ect. Keeps tripping out.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#4
Try this...
PHP Code:
<control type="image" id="962">
    <
width>96</width>
    <
height>56</height>
    <
texture fallback="empty.png">flags/$INFO[ListItem.VideoCodec].png</texture>
    <
aspectratio>keep</aspectratio>
    <
visible>IsEmpty(ListItem.VideoCodec) | StringCompare(Control.GetLabel(962),empty)</visible>
</
control
Reply
#5
Nope. Needs !IsEmpty or it will always hide.

Is Control.Getlabel even available this way? It is off course in an include.

In the meantime, i made a pretty (Not Available) fallback image. N/A.png
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply

Logout Mark Read Team Forum Stats Members Help
Check if flag image exists0