set skin setting
#1
Hey again

I am basicly trying to set up a toggle button to cycle fanart, extrafanart and just BG image and have been browsing through other skin files and see they use skin.has.setting but I can not figure out how to set a skin setting ?
Reply
#2
Look for the value in SkinSetting.xml of those skins.
Reply
#3
hey Hitcher
I have been going over a coupple of skin settings files but they just have the same skin.toggle function.
Is it enough to ad a button and use onlick skin has setting fanart and then use a visibitly tak for fanart skin has setting fanart ?
I cant find anything related to how one add a skin setting?
Reply
#4
Yes just do Skin.ToggleSetting(your_setting) and then you can check the value with Skin.HasSetting(your_setting).
Image
Reply
#5
thank you black will use the night to set this up ;D
Reply
#6
I am sorry if it is me that is daft ;(
But I can not figure out how to create a button with more then 2 states basicly I would like a button with
onclick fanart
onclick extrafanart
onclick background image
I have looked at the select button but I would like to avoid the arrow keys and plus I cant figure out for to define the actions for the hidden states
i am hoping someone will make an example of how you would set this up ?
I hope you know what I mean

Many Hours Later
I managed to set up a Toggle button that toggles fanart and extrafanart for movies and tv show,season and episodes indepentendly but I can get the label to change I have tried with variables and label condition none will do it.
Code:
            <label condition="!Skin.HasSetting(MovieExtraFanart) | !Skin.HasSetting(tvshowsExtraFanart) | !Skin.HasSetting(seasonsExtraFanart)| !Skin.HasSetting(episodesExtraFanart)">extrafanart</label>
             <label condition="Skin.HasSetting(MovieExtraFanart) | Skin.HasSetting(tvshowsExtraFanart) | Skin.HasSetting(seasonsExtraFanart)| Skin.HasSetting(episodesExtraFanart)">fanart</label>

and the variable
Code:
        <variable name="LabelOnclickFanart">
        <value condition="!Skin.HasSetting(MovieExtraFanart) | !Skin.HasSetting(tvshowsExtraFanart) | !Skin.HasSetting(seasonsExtraFanart)| !Skin.HasSetting(episodesExtraFanart)">Fanart</value>
        <value condition="Skin.HasSetting(MovieExtraFanart) | Skin.HasSetting(tvshowsExtraFanart) | Skin.HasSetting(seasonsExtraFanart)| Skin.HasSetting(episodesExtraFanart)">ExtraFanart</value>
        </variable>

button variable
Code:
        <variable name="OnclickFanart">
        <value condition="Container.Content(movies)">Skin.ToggleSetting(MovieExtraFanart)</value>
        <value condition="Container.Content(tvshows)">Skin.ToggleSetting(tvshowsExtraFanart)</value>
        <value condition="Container.Content(seasons)">Skin.ToggleSetting(seasonsExtraFanart)</value>
        <value condition="Container.Content(episodes)">Skin.ToggleSetting(episodesExtraFanart)</value>
    </variable>
Code:
        <control type="button" id="4001">
                <description>ToggleFanart</description>
                <width>330</width>
                <align>left</align>
                <onclick>$VAR[OnclickFanart]</onclick>
                <visible>!Player.HasVideo</visible>
             <label condition="!Skin.HasSetting(MovieExtraFanart) | !Skin.HasSetting(tvshowsExtraFanart) | !Skin.HasSetting(seasonsExtraFanart)| !Skin.HasSetting(episodesExtraFanart)">extrafanart</label>
             <label condition="Skin.HasSetting(MovieExtraFanart) | Skin.HasSetting(tvshowsExtraFanart) | Skin.HasSetting(seasonsExtraFanart)| Skin.HasSetting(episodesExtraFanart)">fanart</label>
            </control>
Reply
#7
Ok I can not understand why nobody has given me a clue or told me the answer is obivious but I will try to ask again since I have tried to solve it all nite
I have a button with an onclick variable that toggle fanart and extra fanart on all views but I can not figure out how to get the label to change with it.
I have tried with different togglebuttons with visibily condition for each lvl movie,season, tvshow, episode but they toggle it for all views and not indepentenly.
I hope someone will at least point me in the right direction since this is really bugging me

Wink p.s Good nite
Reply
#8
Looks like it might be due to your conditions. When using | (or) if either of them are true the whole thing will return as true. You'll want to do something like this:

Code:
<value condition="[Container.Content(movies) + !Skin.HasSetting(MovieExtraFanart)] | [Container.Content(tvshows) + !Skin.HasSetting(tvshowsExtraFanart)] | [Container.Content(seasons) + !Skin.HasSetting(seasonsExtraFanart)] | [Container.Content(episodes) + !Skin.HasSetting(episodesExtraFanart)]">Fanart</value>
<value condition="[Container.Content(movies) + Skin.HasSetting(MovieExtraFanart) | [Container.Content(tvshows) + Skin.HasSetting(tvshowsExtraFanart)] | [Container.Content(seasons) + Skin.HasSetting(seasonsExtraFanart)] | [[Container.Content(episodes) + Skin.HasSetting(episodesExtraFanart)]">ExtraFanart</value>

You also aren't using the variable in the button control.

Edit: If you're using a togglebutton control you could use <altlabel> for the alternate text. So it would be:

Code:
<control type="togglebutton" id="4001">
                 <description>ToggleFanart</description>
                 <width>330</width>
                 <align>left</align>
                 <onclick>$VAR[OnclickFanart]</onclick>
                 <label>Fanart</label>
                 <altlabel>Extrafanart</altlabel>
</control>

That may or may not be a better fit for what you're trying to achieve though you'll have to test it. Check here for more info on the toggle button control.
Reply
#9
Is this what you are looking for?

<control type="button" id="110">

https://github.com/MassIV/skin.metroid/b...s.xml#L671

One of the conditions needs to be true to work.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#10
thank you I was afraid that it was about strings ;(
only strings work in labels conditions ?
well I guess its time to sit down an learn how strings work
thank you
----------------many hours later----------------------
thank you I was afraid that it was about strings ;(
only strings work in labels conditions ?
well I guess its time to sit down an learn how strings work
thank you

Thank you both
@Sranshaft
nice tip on conditions I will use this in the future, I had looked at the toggle button but as I said it dident remember state individualy but maybe that is because of the wrong conditions.

@MassIV
Thank you for that link that was really helpfull so finally managed to make the label text into a toggle text with the use of strings and my onclick "macro" so it basicly toggle fanart and extrafanart
PHP Code:
                <control type="button" id="111">
                        <
texturenofocus colordiffuse="44FFFFFF">settingB.png</texturenofocus>
                        <include>
SettingsButton</include>
                        <
label2>$INFO[Skin.String(DarknessPercentage),,%]</label2>
                        <
label> - $LOCALIZE[31257]</label>
                        <
onclick condition="Stringcompare(Skin.String(BackgroundDarkness),FFFFFFFF) | IsEmpty(Skin.String(BackgroundDarkness))">Skin.SetString(BackgroundDarkness,FFE5E5E5)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(BackgroundDarkness),FFE5E5E5)">Skin.SetString(BackgroundDarkness,FFCCCCCC)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(BackgroundDarkness),FFCCCCCC)">Skin.SetString(BackgroundDarkness,FFB3B3B3)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(BackgroundDarkness),FFB3B3B3)">Skin.SetString(BackgroundDarkness,FF999999)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(BackgroundDarkness),FF999999)">Skin.SetString(BackgroundDarkness,FF7F7F7F)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(BackgroundDarkness),FF7F7F7F)">Skin.SetString(BackgroundDarkness,FFFFFFFF)</onclick>
                        <!-- 
only user feedback -->
                        <
onclick condition="Stringcompare(Skin.String(DarknessPercentage),0) | IsEmpty(Skin.String(DarknessPercentage))">Skin.SetString(DarknessPercentage,10)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(DarknessPercentage),10)">Skin.SetString(DarknessPercentage,20)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(DarknessPercentage),20)">Skin.SetString(DarknessPercentage,30)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(DarknessPercentage),30)">Skin.SetString(DarknessPercentage,40)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(DarknessPercentage),40)">Skin.SetString(DarknessPercentage,50)</onclick>
                        <
onclick condition="Stringcompare(Skin.String(DarknessPercentage),50)">Skin.SetString(DarknessPercentage,0)</onclick>
                    </
control

this is something i see myself using in the future WAAAAYYYYY future, I can see what it does but I cant see how it does it
do u use colordifuse somewhere else with stringcompare(BackgroundDarkness)?

could I somehow do the same with Skin.ToggleSetting(MovieExtraFanart) so the label actually followed the setting instead of just a toggle ?

Arh I had it working perfectly but it stopped working out of the blue for tvshow and now the label get stuck on labels that dont exits anymore it feel like it has something cached and it refuses to get rid of it
Reply
#11
The strings can't be empty (actually they can't be a value that is not used. Such as: empty). So this needs to be available where they could be empty. Like startup, settingscategory, addonbrowser
Code:
<onload condition="IsEmpty(Skin.String(BackgroundPercentage))">Skin.SetString(BackgroundPercentage,80)</onload>
<onload condition="IsEmpty(Skin.String(DarknessPercentage))">Skin.SetString(DarknessPercentage,70)</onload>
<onload condition="IsEmpty(Skin.String(BackgroundDarkness))">Skin.SetString(BackgroundDarkness,FFB3B3B3)</onload>

Quote:do u use colordifuse somewhere else with stringcompare(BackgroundDarkness)?
They are used on this image
https://github.com/MassIV/skin.metroid/b...s.xml#L415

Quote:could I somehow do the same with Skin.ToggleSetting(MovieExtraFanart) so the label actually followed the setting instead of just a toggle ?
Not sure what you mean.

Quote:Arh I had it working perfectly but it stopped working out of the blue for tvshow and now the label get stuck on labels that dont exits anymore it feel like it has something cached and it refuses to get rid of it
Yes it's tricky if you keep changing the values you want to use. Because the string will still have a value you are not using anymore.
Just force them in the correct value once by temporarily leaving out the IsEmpty condition for the onload.

Code:
<onload>Skin.SetString(BackgroundPercentage,80)</onload>
<onload>Skin.SetString(DarknessPercentage,70)</onload>
<onload>Skin.SetString(BackgroundDarkness,FFB3B3B3)</onload>
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#12
@ MassIV
uhhh tx for the brain food Wink but today I think I will make something with visual results instead of just a button Wink
but I am afraid I will have to revive this later on
Reply

Logout Mark Read Team Forum Stats Members Help
set skin setting0