Hide text if studio image is not available
#1
Ok, so I currently have the following in my dialogvideoinfo:

Code:
    <item>
    <label>$LOCALIZE[572]</label><!-- Studios -->
    <label2>                                      $INFO[ListItem.Studio]</label2>
    <onclick>noop</onclick>
    <visible>!IsEmpty(ListItem.Studio)</visible>
    </item>

I placed the large amount of space in label2 because I have my studio images load on top of that group within that space. Everything works as it should. Now for the studios that do NOT have images(but have studio filled in), it looks goofy with that large space. Here is what I would like for the finished product to look like:

Code:
    <item>
    <label>$LOCALIZE[572]</label><!-- Studios -->
    <label2>                                      $INFO[ListItem.Studio]</label2>
    <onclick>noop</onclick>
    <visible></visible>
    </item>
    <item>
    <label>$LOCALIZE[572]</label><!-- Studios -->
    <label2>$INFO[ListItem.Studio]</label2>
    <onclick>noop</onclick>
    <visible></visible>
    </item>

I tried:
Code:
    <visible>!IsEmpty(ListItem.Studio,flags/studios/,.png)</visible>
among other things and no go. Is this possible or will I have to use defaulttexture and assign a place holder?
Reply
#2
you cannot check for file existence of images placed inside a list container. It´s a core limitation.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
Do you need to use a list container? From memory, if you are just using normal controls outside a container, you can use the following hack:
Code:
<control type="image" id="9001">
    <texture fallback="blank.png">$INFO[ListItem.Studio,pathtostudiotexture,.png]</texture>
</control>

<control type="label">
    <label>$INFO[ListItem.Studio]</label>
    <visible>stringcompare(Control.GetLabel(9001),blank.png)</visible>
</control>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#4
(2015-11-23, 04:34)jurialmunkey Wrote: Do you need to use a list container? From memory, if you are just using normal controls outside a container, you can use the following hack:
Code:
<control type="image" id="9001">
    <texture fallback="blank.png">$INFO[ListItem.Studio,pathtostudiotexture,.png]</texture>
</control>

<control type="label">
    <label>$INFO[ListItem.Studio]</label>
    <visible>stringcompare(Control.GetLabel(9001),blank.png)</visible>
</control>

I will check into this later when I get home! Thanks for the replies guys!
Reply
#5
Absolutely beautiful! Worked like a charm, thanks so much!
Reply
#6
I know this is old-ish, but would like to add a way to avoid the stringcompare for future reference:

Set the fallback to "" and you can use <visible>isEmpty(Control.GetLabel(74747))</visible>

It should be faster I think.
Reply

Logout Mark Read Team Forum Stats Members Help
Hide text if studio image is not available0