Solved Few skinning questions
#1
Hello all,

I'm currently in process of modding of existing skin and I hit few deadends. My skinning knowledge is quite low so I want to ask others:
  1. How to position table columns based on width of previous
    Code:
    Genre        X  Action
    Director     X  Mr.T
    First Aired  X  31.12.2013
    In example above is delimiter (X) positon based on width of 'First Aired' label. But it can be changed by translations of all three labels in first column so I want to position it dynamically. I tried to put everything in horizontal grouplist, with each "column" as own group. But problem is that these groups must have specified static width, it doesn't auto-size on its own. Is there some trick how to achieve this?

  2. How to show Season specific data in DialogVideoInfo
    I want to add season number to title in DialogVideoInfo when season is selected (for example Heroes S02). But at the moment when DialogVideoInfo is shown for season it changes Container.Content to tvshows and ListItem.Season contains nothing. Is there some way how to get season number here?

  3. How to get Season count without Specials
    My goal is to show ListItem.Art(season.poster) on DialogVideoInfo only for shows with more than 1 season. Problem is that ListItem.Property(TotalSeasons) contains value 2 for TV Shows with specials even when I have "Flatten TV show seasons" set to "If only one season" (it shows specials together with episodes, there is no seasons list). Is there some way how to check if TV Show contains specials? Didn't find anything like ListItem.HasSpecials.
Reply
#2
1. Not possible afaik. If you know that one string is definitely going to be longer than the rest then you could put that into a horizontal grouplist and set the label control's width to auto, then have the 2nd column in a group and use <usecontrolcoords>true</usecontrolcoords> in the grouplist to the position it with a negative posy

e.g. if first aired was always going to be the longest

Code:
<control type="label" description="genre">
    <posy>0</posy>
    ...
</control>
<control type="label" description="director">
    <posy>100</posy>
    ...
</control>
<control type="grouplist">
    <posy>0</posy>
    <height>300</height>
    <orientation>horizontal</orientation>
    <usecontrolcoords>true</usecontrolcoords>
    <control type="label" description="first aired">
        <posy>200</posy>
        <width>auto</width>
        ...
    </control>
    <control type="group" description="column2">
        <posy>0</posy> <!-- You either need to use 0 or -200 here. I'm not certain without testing it -->
        ...
    </control>
</control>

But that's incredibly hacky really and will only work if one label is definitely always going to be longer than the rest.



2. Have you tried $INFO[ListItem.Label] ?? That shows "Season X" - don't know about just getting the number, but you could use a variable substring
PHP Code:
<variable name="SeasonInfoNumber">
    <
value condition="substring(ListItem.Label, 12,right)">12</value>
    <
value condition="substring(ListItem.Label, 2,right)">2</value>
    <
value condition="substring(ListItem.Label, 13,right)">13</value>
    <
value condition="substring(ListItem.Label, 3,right)">3</value>
    ... 
etc.
</
variable
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
1. Not possible
2. We have no season information so tv show information is shown instead (thus Container.Content is set to tvshows). However it's possible with a workaround.
3. There is ListItem.IsSpecial so your view needs to set a property based on that in the focusedlayout.

Workaround for #2 and #3:
PHP Code:
#MyVideoNav.xml
<onunload condition="!IsEmpty(Window(movieinformation).Property(IsSeason)">ClearProperty(IsSeason,movieinformation)</onunload>
<
onunload condition="!IsEmpty(Window(movieinformation).Property(IsSpecial)">ClearProperty(IsSpecial,movieinformation)</onunload>

#This button sets all properties
<include name="SetSeasonProperties">
  <
control type="button">
    
#Set IsSeason property
    
<onfocus condition="Container.Content(seasons)">SetProperty(IsSeason,1,movieinformation)</onfocus>
    <
onfocus condition="!Container.Content(seasons)">ClearProperty(IsSeason,movieinformation)</onfocus>

    
#Set IsSpecial property
    
<onfocus condition="Container.Content(seasons) + ListItem.IsSpecial">SetProperty(IsSpecial,1,movieinformation)</onfocus>
    <
onfocus condition="Container.Content(seasons) + !ListItem.IsSpecial">ClearProperty(IsSpecial,movieinformation)</onfocus>

    
#Set poster, season number etc.
    
<onfocus condition="Container.Content(seasons)">SetProperty(Season.Poster,$INFO[ListItem.Property(season.poster)])</onfocus>
    <
onfocus condition="Container.Content(seasons)">SetProperty(Season.Number,$INFO[ListItem.Season])</onfocus>
    [...]
  </
control>
</include>

#In your views
<focusedlayout>
  <include>
SetSeasonProperties</include>
  [...]
</
focusedlayout

You can then check for season and special with

!IsEmpty(Window.Property(IsSeason))
!IsEmpty(Window.Property(IsSpecial))

in the movieinformation dialog.
Image
Reply
#4
Thanks both for help.

1. I combined jurialmunkey's trick with some conditions controlled by variable based on System.Language and it works fine. Of course it is limited to languages for which I have translation but it is much better than static width.

PHP Code:
<variable name="VideoInfo_OtherInfo_WidestLabel">
  <
value condition="Container.Content(tvshows) + SubString(System.Language,english)">2</value>
  <
value condition="Container.Content(tvshows)">2</value>
  <
value condition="SubString(System.Language,english)">3</value>
  <
value>3</value>
</
variable

2. Property works fine but I stopped liking idea when I saw it on screen Laugh
3. I noticed ListItem.Property(IsSpecial) before but somehow assumed it will work only on episodes not on directories. Now I tried it and it isn't much better. It returns true only on special episodes and specials directory in sessions view. It's empty for TV Show which has specials. So for my use-case it's useless because with "Flatten TV show seasons" set to "If only one season" I have specials directly in TV Show folder, there is no seasons view.
Anyway to solve my problem it is enough to use your IsSeason property as marker that I got to episodes over seasons view. When TV Show has only one season XBMC goes directly to episodes and show TV Show thumb, when it has more seasons then it goes over season, set IsSeason and then show Season thumb.
Reply

Logout Mark Read Team Forum Stats Members Help
Few skinning questions0