Req Conditional Textures
#1
Okay- this may be a ridiculous request, but would it be possible to add support for conditional textures in Image controls for Helix? So many other attributes support conditionals, I think it is kind of crazy textures do not. I also noticed a request was made for this like 6 years ago and it was mentioned it was planned, but to date we haven't seen support for it... figured it couldn't hurt to bring it up again.

The more I work on my skin it becomes more and more clear that this would cut down on a crazy amount of skinning code.

Basically instead of having to do this-

PHP Code:
            <control type="image" id="100">
     <
visible>Container.Content(tvshows) | Container.Content(seasons) | Container.Content(movies)</visible>
     <
posy>20</posy>
     <
width>1280</width>
     <
height>100</height>
     <
texture background="true">$INFO[ListItem.Art(clearlogo)]</texture>
     <
fadetime>100</fadetime>
     <
aspectratio scalediffuse="false">keep</aspectratio>
</
control>
            
<
control type="image" id="101">
     <
visible>Container.Content(tvshows) | Container.Content(seasons) | Container.Content(movies)</visible>
     <
visible>IsEmpty(ListItem.Art(clearlogo))</visible>
     <
posy>20</posy>
     <
width>1280</width>
     <
height>100</height>
     <
texture background="true">$INFO[ListItem.path]logo.png</texture>
     <
fadetime>100</fadetime>
     <
aspectratio scalediffuse="false">keep</aspectratio>
</
control

We could do this-

PHP Code:
            <control type="image" id="100">
     <
visible>Container.Content(tvshows) | Container.Content(seasons) | Container.Content(movies)</visible>
     <
posy>20</posy>
     <
width>1280</width>
     <
height>100</height>
     <
texture background="true" condition="!IsEmpty(ListItem.Art(clearlogo)">$INFO[ListItem.Art(clearlogo)]</texture>
     <
texture background="true" condition="IsEmpty(ListItem.Art(clearlogo)">$INFO[ListItem.path]logo.png</texture>
     <
fadetime>100</fadetime>
     <
aspectratio scalediffuse="false">keep</aspectratio>
</
control

Oh, and I know about fallback and/or variables, but I see this as being a different use case and could definitely be useful.
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#2
Does a variable not work?
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
Variables will do exactly what you want.
Reply
#4
You can use variables to do this, but there is overhead associated with variables, particularly if you are doing one-offs. I prefer using variables for things that are used repeatedly (ie- the above instance would be added to every video view). However there are quite a few instances where you only need to do something once and to me it just doesn't make sense to use a variable ONCE (why create 4 lines of code when two lines do the job?). Besides, why have conditionality on attributes at all then?
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#5
But using a variable would reduce the checks because it's stops as soon as a condition is met; whereas your code it would be checked twice even if the first condition was met.
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional Textures0