PDA

View Full Version : Conditional texture and label tags


djh_
2008-07-24, 19:24
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>

Freddo
2008-07-24, 19:50
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.

skunkm0nkee
2008-07-25, 00:41
Yepo, I agree Fredo - having the ability to conditionally control all sorts of tags woud be very useful

jmarshall
2008-07-25, 01:21
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

djh_
2008-07-25, 14:15
I've left a request via trac for <label> and <texture> tags specifically. Cheers.