Control visibility is only dynamic?
#1
I have been looking for a skin where watched movies/shows are shown in a different color for an easy overview (compared to the Watched overlay).

Since I couldn't find one, I decided to do a little digging and finally came up with a solution. There wasn't a listitem flag for watched/unwatched, so I tried using the ListItem.Overlay which contains the name of the overlay icon.

I'm using the Rapier skin and the value of ListItem.Overlay is OverlayWatched.png/OverlayUnWatched.png so to set a condition I can use stringcompare(ListItem.Overlay,OverlayWatched.png) which will be True if the current item is flagged as watched.

Then I take the title label and make a white version for unwatched and a blue version for watched and use the <visible> tag to turn them on/off.

In the Rapier Views.xml I go to the EpisodesListInfo2BannerStyle which displays the list of episodes of a TV show in library mode using the List Info 2 list, which is the one I use.

In the <focusedlayout> I exchange the title label with these two:

<control type="label">
<description>Title</description>
<posx>150</posx>
<posy>5</posy>
<width>430</width>
<font>MediaInfoHeadFont</font>
<textcolor>SelectedColor</textcolor>
<shadowcolor>ShadowColor</shadowcolor>
<label>$INFO[ListItem.Label]</label>
<visible>!stringcompare(ListItem.Overlay,OverlayWatched.png)</visible>
</control>

<control type="label">
<description>Title</description>
<posx>150</posx>
<posy>5</posy>
<width>430</width>
<font>MediaInfoHeadFont</font>
<textcolor>SelectedColor2</textcolor>
<shadowcolor>ShadowColor</shadowcolor>
<label>$INFO[ListItem.Label]</label>
<visible>stringcompare(ListItem.Overlay,OverlayWatched.png)</visible>
</control>

and it works beautifully. If a show is watched, the name shows in blue when I select it or in white if it hasn't been watched.

Now I want to do the same for the ones not in focus, which would be simple enough, just do the same in the <itemlayout> section... nope! No

It turns out that the condition check in <visibility> is dynamic. When a label is created, all the ListItem info used (name, episode number, etc) is taken from that particular item as it should be. But the system will keep checking the condition for visibility, so if it changes it will updated.
Since ListItem will always reflect the latest selected item, the check for each label's visibility will be checked against the one in focus atm.

If you move the focus to a show that has been watched, ALL the labels will be shown as blue and if you move to an unwatched show, they all turn white.


Now, my question is: is there a way to only do the condition check at the moment of creating the control or another option of switching color according to watched status or another solution whatsoever? Any help will be appreciated Nod
Reply
#2
Reason is that the stringcompare functionality means it's dropped down to the global visibility section which thus means the listitem.* variables are taken from the focus.

You can't do anything about it that I'm aware of.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Thanks. I was afraid it would be the case. I'll try something else, or see if I can make the developers add flag to make a condition dynamic/fixed or conditional colour tags... and ofc a ListItem.Watched property.
Reply

Logout Mark Read Team Forum Stats Members Help
Control visibility is only dynamic?0