Changeable button from user skin
#1
Hi,
i'm working on mdified re-touch skin .
I make it a skin for a car media. https://github.com/idorel77/skin.CarPC-t...fanart.jpg

Even i modified a hole skin , i'm still novice in skining.

Question is: How can i make a button to be changeable from a user skin (from skin settings)?

If the user don't use the navigation button , i want to be changeable in pictures button for example.
Can i do that?
How?

My navigation button is like that:

PHP Code:
<control type="group">
        <include>
Window_OpenClose_Animation_Zoom</include>
            <
posx>20</posx>
            <
posy>282</posy>
            <
control type="button">
                <
description>Navit Button</description>
                <
posx>0</posx>
                <
posy>0</posy>
                <
width>408</width>
                <
height>117</height>
                <
texturenofocus >home_2.png</texturenofocus>
                <
texturefocus border="5">home_2_p.png</texturefocus>
                <
onclick>RunScript("plugin.program.navigation")</onclick>
            </
control>
            <
control type="image">
                <
description>Navit Button Image</description>
                <
posx>30</posx>
                <
posy>27</posy>
                <
width>80</width>
                <
height>72</height>
                <
texture>navit_logo2.png</texture>
            </
control>
            <
control type="label">
                <
description>Navit label</description>
                <
posx>122</posx>
                <
posy>20</posy>
                <
height>81</height>
                <
width>250</width>
                <
label>Navigation</label>
                <
aligny>center</aligny>
                <
font>font40_title</font>
                <
textcolor>FFFFFFFF</textcolor>
            </
control>
        </
control

Thanks a lot.

Sorry for my bad English.
Reply
#2
Could you explain what you want to do with some images as I don't really understand what you're trying to achieve here?
Reply
#3
Hi,

i want to know if i can change this line from skin , not to edit xml file.
PHP Code:
<onclick>RunScript("plugin.program.navigation")</onclick>

<
label>Navigation</label>

<
texture>navit_logo2.png</texture
If i don't use navit button, i want to be able to change from skin settings , in pictures button for ex.

Thanks.
Reply
#4
I think you want to use conditional includes.

eg

Code:
<include condition="Skin.HasSetting(SOME_TYPE_OF_SKIN_SETTING)">ONCLICK_INCLUDE</include>

Then in your includes.xml

Code:
<include name="ONCLICK_INCLUDE"><onclick>RunScript("plugin.program.navigation")</onclick></include>
Reply
#5
Hi,
thaks for respons.

This is for just for onclick ? can you tell me more?

I need to change also label and icon.

For now i make it 2 diferent buttons in include.xml and in settings.xml i make it 2 radio buttons and i select wich button i want to use.

Do you know a better solution?

I have this in includes.xml

PHP Code:
<include name="Navigation">
        <
control type="group">
        <
visible>!Window.IsVisible(ExtendedProgressDialog) + !Skin.HasSetting(HideHomeButtonNavigation)</visible>
        <include>
Window_OpenClose_Animation_Zoom</include>
            <
posx>20</posx>
            <
posy>280</posy>
            <
control type="button">
                <
description>Navit Button</description>
                <
posx>0</posx>
                <
posy>0</posy>
                <
width>408</width>
                <
height>130</height>
                <
texturenofocus >home_2.png</texturenofocus>
                <
texturefocus border="5">home_2_p.png</texturefocus>
                <
onclick>RunScript("plugin.program.navigation")</onclick>
            </
control>
            <
control type="image">
                <
description>Navit Button Image</description>
                <
posx>30</posx>
                <
posy>30</posy>
                <
width>80</width>
                <
height>80</height>
                <
texture>navit_logo2.png</texture>
            </
control>
            <
control type="label">
                <
description>Navit label</description>
                <
posx>122</posx>
                <
posy>22</posy>
                <
height>90</height>
                <
width>250</width>
                <
label>Navigation</label>
                <
aligny>center</aligny>
                <
font>font40_title</font>
                <
textcolor>FFFFFFFF</textcolor>
            </
control>
        </
control>
    </include>
    <include 
name="Pictures">
        <
control type="group">
        <
visible>!Window.IsVisible(ExtendedProgressDialog) + !Skin.HasSetting(HideHomeButtonPictures)</visible>
        <include>
Window_OpenClose_Animation_Zoom</include>
            <
posx>20</posx>
            <
posy>280</posy>
            <
control type="button">
                <
description>Pictures Button</description>
                <
posx>0</posx>
                <
posy>0</posy>
                <
width>408</width>
                <
height>130</height>
                <
texturenofocus >home_2.png</texturenofocus>
                <
texturefocus border="5">home_2_p.png</texturefocus>
                <
onclick>ActivateWindow(Pictures)</onclick>
            </
control>
            <
control type="image">
                <
description>Pictures Button Image</description>
                <
posx>30</posx>
                <
posy>30</posy>
                <
width>80</width>
                <
height>80</height>
                <
texture>pictures2.png</texture>
            </
control>
            <
control type="label">
                <
description>Pictures label</description>
                <
posx>122</posx>
                <
posy>22</posy>
                <
height>90</height>
                <
width>250</width>
                <
label>Pictures</label>
                <
aligny>center</aligny>
                <
font>font40_title</font>
                <
textcolor>FFFFFFFF</textcolor>
            </
control>
        </
control>
    </include> 

and this in custom_settings.xml
PHP Code:
<control type="radiobutton" id="201">
                <
description>Button 2 Show Navigation</description>
                <
height>55</height>
                <
width>920</width>
                <
font>font24_title</font>
                <
focusedcolor>blue</focusedcolor>
                <
textcolor>black</textcolor>
                <
texturefocus border="0,2,0,2">MenuItemNF.png</texturefocus>
                <
texturenofocus border="0,2,0,2">MenuItemNF.png</texturenofocus>
                <
label>Show Navigation Button 2</label>
                <
onclick>Skin.ToggleSetting(HideHomeButtonNavigation)</onclick>
                <
selected>!Skin.HasSetting(HideHomeButtonNavigation)</selected>
            </
control>
            <
control type="radiobutton" id="202">
                <
description>Button 2 Show Pictures</description>
                <
height>55</height>
                <
width>920</width>
                <
font>font24_title</font>
                <
focusedcolor>blue</focusedcolor>
                <
textcolor>black</textcolor>
                <
texturefocus border="0,2,0,2">MenuItemNF.png</texturefocus>
                <
texturenofocus border="0,2,0,2">MenuItemNF.png</texturenofocus>
                <
label>Show Pictures Button 2</label>
                <
onclick>Skin.ToggleSetting(HideHomeButtonPictures)</onclick>
                <
selected>!Skin.HasSetting(HideHomeButtonPictures)</selected>
            </
control

Thanks a lot.
Reply

Logout Mark Read Team Forum Stats Members Help
Changeable button from user skin0