Kodi Community Forum
Skin Variables / Conditional Labels - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Skin Variables / Conditional Labels (/showthread.php?tid=107734)

Pages: 1 2 3 4 5 6


- Jeroen - 2011-09-30

I tried the following:

<texture fallback="$VAR[variablename]" background="true">$INFO[ListItem.Thumb]</texture>

Which doesn't appear to be working. I know this is only the first steps, but I would like to know if this will be possible later down the road? Because I could do some serious code cleaning with it Smile


- `Black - 2011-09-30

As far as I know fallback doesn't allow $INFO so $VAR also won't work I guess.

This might work:

Code:
<variable name="Thumb">
  <value condition="!IsEmpty(ListItem.Thumb)">$INFO[ListItem.Thumb]</value>
  <value condition="IsEmpty(ListItem.Thumb) + SomeCondition1">Fallback1</value>
  <value condition="IsEmpty(ListItem.Thumb) + SomeCondition2">Fallback2</value>
  [...]
</variable>

<texture background="true">$VAR[Thumb]</texture>



- Jeroen - 2011-09-30

`Black Wrote:This might work:
Good thinking, works great Smile Cheers!


- `Black - 2011-10-01

I have some small problems with the value conditions... I now have this for the background fanart in my TVGuide:

Code:
<variable name="TVGuideInfoFanart">
    <value condition="Control.HasFocus(200) | stringcompare(Window(home).Property(TVGuide.MondayList),1)">$INFO[Container(200).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(201)">$INFO[Container(201).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(202)">$INFO[Container(202).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(203)">$INFO[Container(203).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(204)">$INFO[Container(204).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(205)">$INFO[Container(205).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(206)">$INFO[Container(206).ListItem.Property(Fanart)]</value>
</variable>

So only one control with $VAR[TVGuideInfoFanart] as texture. If I now open my guide menu (playercontrols), fanart is not visible anymore. It was working with the previous solution of 7 different controls with visible conditions.


- BigNoid - 2011-10-01

`Black Wrote:I have some small problems with the value conditions... I now have this for the background fanart in my TVGuide:

Code:
<variable name="TVGuideInfoFanart">
    <value condition="Control.HasFocus(200) | stringcompare(Window(home).Property(TVGuide.MondayList),1)">$INFO[Container(200).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(201)">$INFO[Container(201).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(202)">$INFO[Container(202).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(203)">$INFO[Container(203).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(204)">$INFO[Container(204).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(205)">$INFO[Container(205).ListItem.Property(Fanart)]</value>
    <value condition="Control.HasFocus(206)">$INFO[Container(206).ListItem.Property(Fanart)]</value>
</variable>

So only one control with $VAR[TVGuideInfoFanart] as texture. If I now open my guide menu (playercontrols), fanart is not visible anymore. It was working with the previous solution of 7 different controls with visible conditions.

This is working for me in script-NextAired-TVGuide.xml with same variable used:
Code:
<control type="group">
        <visible>!IsEmpty(Window(home).property(TVGuide.BackgroundFanart))</visible>
        <control type="image">
          <posx>0</posx>
          <posy>0</posy>
          <width>1280</width>
          <height>720</height>
          <aspectratio>scale</aspectratio>
          <texture background="true">$VAR[TVGuideInfoFanart]</texture>
          <include>backgroundfade</include>
          <fadetime>500</fadetime>
        </control>
</control>



- `Black - 2011-10-01

Yes, it is working but if I open the guide menu in my skin (Xperience1080), the image is hidden. This is not the case if I use a visible condition and no variable. I may have something to do with how often the condition gets evaluated but I'm not sure.


- BigNoid - 2011-10-01

Container.TvshowThumb and Container.SeasonThumb don't work in variables

Below is just for making my point
Code:
<variable name="PosterVar">
    <value>$INFO[Container.TvshowThumb]</value>
  </variable>

doesn't return in
Code:
<control type="image">
        <description>Cover image</description>
        <posx>0</posx>
        <posy>0</posy>
        <width>486</width>
        <height>720</height>
        <texture background="true">$VAR[PosterVar]</texture>
        <include>Animation_VisibleChange200</include>
        <aspectratio>stretch</aspectratio>
      </control>

If I insert it directly in the image control it does work.


- Hitcher - 2011-10-01

Just confirmed this - my guess would be it's not getting the container id.


- pieh - 2011-10-01

Big_Noid Wrote:Container.TvshowThumb and Container.SeasonThumb don't work in variables
Should be fixed in f20f1924.


- BigNoid - 2011-10-01

pieh Wrote:Should be fixed in f20f1924.

Yep it's fixed, man you work fast Big Grin


- Jeroen - 2011-10-01

What a great improvement to XBMC skinning, the amount of code I'm getting rid of is ridiculous Big Grin


- Jeroen - 2011-10-01

It seems $INFO[Container.ShowPlot] is not working in variables.


- Hitcher - 2011-10-01

This will probably fix that -

pieh Wrote:Should be fixed in f20f1924.



- pieh - 2011-10-01

I'm using newest code and Container.ShowPlot is working here (earlier fix shouldn't affect it). Do You have maybe more info on this?


- Jeroen - 2011-10-01

Yeah, it's working, my bad. It not displaying had to do with the order in which I was defining the various plot and description properties.