Conditional texture and label tags
#1
I have lines upon lines of redundant code in Aeon because, if I want different things to appear in certain situations, every instance has to be a separate control. I know this can be alleviated somewhat by using loads of includes, but how about simply making the labels and textures within each control conditional?

Examples:

<texture condition="Skin.HasSetting(bugaboo)">Texture One</texture>
<texture condition="!Skin.HasSetting(bugaboo)">Texture Two</texture>

<label condition="Window.IsActive(Home)">This is Home</label>
<label condition="!Window.IsActive(Home)">This is not Home</label>
Reply
#2
I've always thought this would be handy but why not make it so any tag can be conditional, for example posx and posy conditionals would also be handy, and i'm certain people could find a use for others too.
Reply
#3
Yepo, I agree Fredo - having the ability to conditionally control all sorts of tags woud be very useful
Reply
#4
It's on my list. The problem is that it's tricky for <some> things to be conditional as there's lots + lots of stuff relying on them not changing.

I plan on looking into allowing more stuff like this to be conditional at some point, it's just tricky to make time for it when there's so much more other stuff to do - particularly as there's always multiple controls to do it for you.

If you could make a feature request on trac detailing exactly which tags (or tag types) would be most useful for you, that'd be great.

Freddo: The easiest way to do that is via conditional slide anims. The problems specific to <posx> is that you can have <posx>180r</posx> so it would have to know at rendertime where it's supposed to be measuring from. Once you have <posx> done conditional, you want <width> and <height> done as well, and you're in for a world of pain if you still allow <posx>180r</posx> to be doable without knowing everything there is to know about the render rect at all times. It's doable, but it needs to be thought through very, very carefully.

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
#5
I've left a request via trac for <label> and <texture> tags specifically. Cheers.
Reply
#6
Maybe this is too old to address now, but... I've looked for a solution to this and the forums don't have one, so I thought I would share it.
Also, the feature of using "conditional" for a texture/label still doesn't exist, so I guessed others are still having trouble with this.

This can be accomplished with a conditional variable.
In my case, I wanted to create a conditional texture, just like @djh_ wanted. Instead of using:
Code:
<texture condition="condition">texture one</texture>
<texture condition="!condition">texture two</texture>
which doesn't work, you can add a variable (to Includes.xml or Variables.xml), and then use that variable as your texture:
Code:
Variables.xml:
<variable name="conditional_texture">
  <value condition="condition">texture one</variable>
  <value condition="!condition">texture two</variable>
</variable>

(in the template file):
<texture>$VAR[conditional_texture]</texture>

This works Smile
Reply
#7
It is perhaps a little old yes. But it's nice that you were thinking about others.
If you are looking for more information on how to do things, there is now a wiki with the manual:

http://wiki.xbmc.org/?title=XBMC_Skinning_Manual

Variables is par. 3.1
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#8
Quote: you can add a variable (to Includes.xml or Variables.xml), and then use that variable as your texture:

includes does also work.

But sometimes i'm just to thierd/lazy to do a other (conditional) include!

Sometime it's just painstaking to finde a Name for the include set the condition and so on...

Would realy save a lot of code if "<texture>" could be conditional.
(label could also be handy.)

regards.
Reply
#9
Sorry for bringing up a old thread but I agree and would like to see this feature available
Aussie, Aussie, Aussie, Oi, Oi, Oi

Don't forget the Thank User button if i have helped!
|
V
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional texture and label tags0