Kodi Community Forum

Full Version: Texture Variable [DialogButtonMenu]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For some reason my buttons come up with a blank background if I use a variable in the texture tag.
When using it in the label tag it works just fine though. So it cannot be a general resolving problem.
There must be something about the texture tag, buttons or DialogButtonMenu.xml that prevents variables from working correctly.
Sure I could duplicate all controls and use the visibility tag to achieve what I want, but I'd prefer to keep the code clean if that's possible.
Your code would be helpful in order to diagnose.
Here's my code. I've added comments to the relevant lines.

Includes.xml
Code:
<variable name="ButtonMenuBg">
    <value condition="Window.IsVisible(FullscreenVideo) | Window.IsVisible(Visualisation)">buttons/button-menu-mid-dark.png</value>
    <value>buttons/button-menu-mid.png</value>
</variable>

DialogButtonMenu.xml
Code:
<controls>
    <control type="grouplist" id="9000">
        [...]
        <control type="group">
            <posx>0</posx>
            <posy>0</posy>
            <width>340</width>
            <height>57</height>
            <control type="button" id="2">
                <description>Shutdown button</description>
                <posx>0</posx>
                <posy>0</posy>
                <width>340</width>
                <height>57</height>
                <textoffsetx>55</textoffsetx>
                <textcolor>beige</textcolor>
                <focusedcolor>blue</focusedcolor>
                <shadowcolor>white</shadowcolor>
                <align>left</align>
                <textwidth>270</textwidth>
                <texturefocus border="12,0,12,0">$VAR[ButtonMenuBg]</texturefocus> <!-- BROKEN-->
                <texturenofocus border="12,0,12,0">$VAR[ButtonMenuBg]</texturenofocus> <!-- BROKEN-->
                <onclick>XBMC.Powerdown()</onclick>
                <onup>10</onup>
                <ondown>3</ondown>
                <onleft>-</onleft>
                <onright>-</onright>
                <pulseonselect>no</pulseonselect>
                <font>ContentBody</font>
                <label>$VAR[ButtonMenuBg]</label> <!-- WORKING -->
            </control>
            <control type="image">
                <posx>20</posx>
                <posy>15</posy>
                <width>27</width>
                <height>27</height>
                <texture>$VAR[IconShutdown]</texture> <!-- WORKING -->
                </control>
            </control>
        </control>
        [...]
    </control>
    [...]
</controls>
Worked around this using conditional includes.
I experience exactly the same phenomena with the latest Gotham build. Using the conditional includes works but is not really intuitive.

Is this scheduled to be fixed in a future gotham build?
It's possibly due to the fact that those buttons are duplicated for the other buttons in the buttonmenu ?

Seems odd that it wouldn't copy across as-is though.