Kodi Community Forum

Full Version: How to implement custom skin settings?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm designing a custom skin, I want the user to be able to toggle a radio button in settings that acts as a show hide rule for a main menu button.
For instance I could add a radio button that says "Show Weather", I know how to use visible rules to show/hide buttons but I was wondering if someone can show me where I can find some info about adding a custom variable for my skin, and finding the .xml document I need to edit to add a radio button to the settings-> appearance -> skin menu page to toggle that variable?

Thanks!
Turn on skin debug. Looking through other skins seeing how they do it and and read the skinning manual there is heaps of examples
Thanks, I figured it out for those interested. What confused me was when you go to Settings -> Appearance menu I didn't realize the second item (Settings) was a button not a label, I knew the items below that (theme, colors, fonts, etc) were located in the sysetm.settings. So I was confused how a skin could change the system settings to add a custom one.

Once I figured out Settings was a link that took you to a skin specific settings window (skinsettings.xml) I was able to make the change quite easily.

In the skinsettings.xml I added a new radio button
Code:
<control type="radiobutton" id="901">
  <width>750</width>
  <height>40</height>
  <font>font13</font>
  <label>Picture Toggle Setting</label>
  <textcolor>grey2</textcolor>
  <focusedcolor>white</focusedcolor>
  <texturefocus>MenuItemFO.png</texturefocus>
  <texturenofocus>MenuItemNF.png</texturenofocus>
  <onclick>Skin.ToggleSetting(picsToggle)</onclick>
  <selected>Skin.HasSetting(picsToggle)</selected>
</control>

Then on the home.xml for the pictures button I changed the condition to:
Code:
<visible>Skin.HasSetting(picsToggle)</visible>


And it all works like a charm. I'm actually pretty surprised, I assumed I would have a crate a custom bool variable elsewhere first, then write a function to toggle it, and access it via $VAR[picsToggle] or something to that effect. When all I needed was these two lines:
Code:
<onclick>Skin.ToggleSetting(picsToggle)</onclick>
<selected>Skin.HasSetting(picsToggle)</selected>

It even saves the value somewhere so the setting is persistent between shutdown/reboots.

-G
If using jarvis the settings are saved in userdata/addons/skin the files will be called settinhs.xml if using older version of kodi then it is in the guisettings.xml