Kodi Community Forum

Full Version: precedence of identical attributes in controls
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was doing some testing to understand what the precedence order is for attributes in a control.  In particular I was looking at <colordiffuse> and am wondering if my results are generalized?

1.  Any attribute in a control will take precedence over the attribute set in the defaults.xml for that control type.

2.  The first occurrence of an attribute will be used.  For example, if there are 2 <colordiffuse> entries (either explicit in the control or via an "include") the first one in the control will be used and any subsequent ones ignored.

3.  At least for the case of <colordiffuse>, a colordiffuse="x" entry on another attribute will override the "general" <colordiffuse>.  

But maybe textures in controls are treated differently than other things (like position/size/align for example)?

scott s.
.
As far as my experience goes - you are correct.
attribute="value" > elements > defaults.xml

I can't think of many other cases like colordiffuse where there is an overlap between attributes and elements though. The few I can think of are fairly trivial (e.g. description tags, animation effects separated out, and the old old way of defining static items in a list).

Also colordiffuse is a bit of a special case. If you have a bordertexture or other textures (e.g. radiobutton control states etc.), then <colordiffuse> as an element will affect all textures in the control. If you define colordiffuse="value" as an attribute of the texture, the colordiffuse will only apply to that specific texture of the control.