Kodi Community Forum

Full Version: Visible condition when no image found?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want the ability to slide Alaska's media flags based on whether some are visible or not and it works fine for everything except the Studio flag.
I can't base it on whether Listitem.studio is empty because that may well return a studio even though we don't have an icon for it, so what I really need is something like this -

Code:
<visible>!IsEmpty(Listitem.studio,special://skin/extras/studios/,.png)</visible>

Of course that doesn't work, or I wouldn't be asking here, but is there another way of doing it?

Thanks.

EDIT: Also tried substring -

Code:
<visible>substring((Listitem.studio,special://skin/extras/studios/,.png),ListItem.studio,left)</visible>
i've been struggling with exactly the same for quite a while, but finally found something that works.

studio flag code:
Quote:<control type="image" id="5083">
...
<texture fallback="-">special://skin/images/flags/movies/studio/$INFO[ListItem.Studio,,.png]</texture>
</control>

animation code:
Quote:<animation effect="slide" start="0,0" end="100,0" time="0" condition="stringcompare(Control.GetLabel(5083),-)">conditional</animation>
I was wondering whether it was possible using the fallback texture but didn't think of not actually setting one.

Many thanks ronie.
Not working using the latest ikons build.
Here's the code I'm using -
Code:
<control type="group">
    <posx>784</posx>
    <posy>118</posy>
    <visible>!Skin.HasSetting(nostudiopanel) + Control.IsVisible(50)</visible>
    <control type="image" id="779">
        <posx>2</posx>
        <posy>2</posy>
        <width>88</width>
        <height>59</height>
        <colordiffuse>FlagDiffuse</colordiffuse>
        <texture fallback="-">special://skin/extras/studios/$INFO[ListItem.Studio,,.png]</texture>
    </control>
    <control type="image">
        <width>92</width>
        <height>63</height>
        <colordiffuse>FlagDiffuse</colordiffuse>
        <texture>flags/studioframe.png</texture>
        <animation effect="slide" start="0,0" end="100,0" time="0" condition="stringcompare(Control.GetLabel(779),-)">conditional</animation>
    </control>
</control>
Any help greatly appreciated.
Well this is getting weirder, it gets the condition if I enter the view and there's no studio flag but then it doesn't update until I re-enter. Huh

http://www.youtube.com/watch?v=nmoiSMZBvzk

ronie, what build are you using where this works?
i'm using svn r25072 on linux.

what exactly are you trying to accomplish?
by looking at the code it seems you want to slide the frame when there's no studio icon, correct?

i'm not home right now, so can't test it myself, but try this:

Code:
<control type="group">
    <posx>784</posx>
    <posy>118</posy>
    <animation effect="slide" start="0,0" end="100,0" time="0" condition="stringcompare(Control.GetLabel(779),-)">conditional</animation>
    <visible>!Skin.HasSetting(nostudiopanel) + Control.IsVisible(50)</visible>
    <control type="image" id="779">
        <posx>2</posx>
        <posy>2</posy>
        <width>88</width>
        <height>59</height>
        <colordiffuse>FlagDiffuse</colordiffuse>
        <texture fallback="-">special://skin/extras/studios/$INFO[ListItem.Studio,,.png]</texture>
    </control>
    <control type="image">
        <width>92</width>
        <height>63</height>
        <colordiffuse>FlagDiffuse</colordiffuse>
        <texture>flags/studioframe.png</texture>
    </control>
</control>
Ultimately I want to either hide or slide the studio frame, and then slide the other media flags when there's no studio one to display.
Still no joy.
oops, sorry
for the border why can't you just use the <texture border> command ?

bordertexture Specifies the image file which should be displayed as a border around the image. Use the <bordersize> to specify the size of the border. The <width>,<height> box specifies the size of the image plus border.

bordersize Specifies the size of the border. A single number specifies the border should be the same size all the way around the image, whereas a comma separated list of 4 values indicates left,right,top,bottom values.

http://wiki.xbmc.org/?title=Image_Control
Yeah, I was just being lazy at the time. But I'd still like to be able to slide the other flags when there's no studio flags available.
I'd try something other than "-" which (in some cases) has a special meaning.

eg use "empty" as the fallback or something and stringcompare on that?
Unfortunately that doesn't work either.
To hide the control when no image is found I used the following code:

Code:
<control type="image">
    <description>Cover</description>
    <width>203</width>
    <height>289</height>
    <texture background="true">$INFO[ListItem.Thumb]</texture>
    <aspectratio>stretch</aspectratio>
    <bordertexture border="6">item-shadow-border.png</bordertexture>
    <bordersize>6</bordersize>
    <fadetime>IconCrossfadeTime</fadetime>
    <visible>StringCompare(Control.GetLabel(100),empty)</visible>
</control>

<control type="image" id="100">
    <description>Cover</description>
    <width>203</width>
    <height>289</height>
    <texture background="true" fallback="empty">$INFO[ListItem.FolderName,,poster.jpg]</texture>
    <aspectratio>stretch</aspectratio>
    <bordertexture border="6">item-shadow-border.png</bordertexture>
    <bordersize>6</bordersize>
    <fadetime>IconCrossfadeTime</fadetime>
    <visible>!StringCompare(Control.GetLabel(100),empty)</visible>
</control>

Seems to work just fine when hiding the image except I'm getting a flashing of the first image (the one that should show if the control(100) returns empty. It looks as if the label constantly changes for a split second, perhaps during the StringCompare?

I have a label set up to check what the Control.GetLabel is returning and it is definitely changing every millisecond or so (goes from "empty" to blank). The label appears not to be a constant thing.
Pages: 1 2