Kodi Community Forum

Full Version: Support view and path unique settings or strings in Skin engine
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently we have Skin.String en skin settings from script.skin.helper.service to help us with applying and storing user settings within the skin. Furthermore when a user opens up a certain page/list or path he/she can then select the desired view to use and that view will be automatically loaded the next time a user opens that specific path.

Now what if we want to have a specific toggle, flag or setting which a user can enable or set for that specific view and even that specific path? Currently we cannot do that. It would be great if the skin engine of kodi would get this feature. We would have much more flexibility in what to show in a view as a developer, but also the users have more control in tweaking their views for a path.

For example: User has two TV Series and for both he uses the same view for the seasons pages. What if TV Series A has DVD cases for each season and TV Series B only banners? It is really hard to support multiple thumb shape sizes when you create a view. It would be nice if we could just have a path specific setting where the user can choose its desired thumb shape and it will be saved only for that specific path.
Like:
xml:

Skin.SetPathString('ThumbShape', 'Poster')

As a work around I tried to use a combined key of $INFO[Container.FolderPath] and a custom text with Skin.String(..), but unfortunately reading Skin.String with a $INFO label etc is also not supported.
the settings are in Kodi\userdata\addon_data\skin.estuary so if you could find a way to write to it
i have been using
<control type="radiobutton" id="610">
       <textcolor>button_focus</textcolor>
       <label>- widget freeview</label>
       <include>DefaultSettingButton</include>
       <selected>!Skin.HasSetting(home_no_freeview_widget)</selected>
       <onclick>Skin.ToggleSetting(home_no_freeview_widget)</onclick>
      </control>

eg
<settings>
  <setting id="home_no_freeview_widget" type="bool">false</setting> 

Image
online image hosting free

may need to write a script
<control type="button" id="6066">
     <label>$LOCALIZE[31149]</label>
     <label2>$INFO[Skin.String(MovieGenreFanart.Name)]</label2>
     <include>DefaultSettingButton</include>
     <onclick condition="!System.HasAddon(script.image.resource.select)">InstallAddon(script.image.resource.select)</onclick>
     <onclick condition="System.HasAddon(script.image.resource.select)">RunScript(script.image.resource.select,property=MovieGenreFanart&amp;type=resource.images.moviegenrefanart)</onclick>
    </control>

 <setting id="HomeFanart.name" type="string">Skin Backgrounds - Clear Design</setting>
(2019-04-23, 03:44)the_other_guy Wrote: [ -> ]the settings are in Kodi\userdata\addon_data\skin.estuary so if you could find a way to write to it
i have been using
<control type="radiobutton" id="610">
       <textcolor>button_focus</textcolor>
       <label>- widget freeview</label>
       <include>DefaultSettingButton</include>
       <selected>!Skin.HasSetting(home_no_freeview_widget)</selected>
       <onclick>Skin.ToggleSetting(home_no_freeview_widget)</onclick>
      </control>

eg
<settings>
  <setting id="home_no_freeview_widget" type="bool">false</setting> 

..
may need to write a script
<control type="button" id="6066">
     <label>$LOCALIZE[31149]</label>
     <label2>$INFO[Skin.String(MovieGenreFanart.Name)]</label2>
     <include>DefaultSettingButton</include>
     <onclick condition="!System.HasAddon(script.image.resource.select)">InstallAddon(script.image.resource.select)</onclick>
     <onclick condition="System.HasAddon(script.image.resource.select)">RunScript(script.image.resource.select,property=MovieGenreFanart&amp;type=resource.images.moviegenrefanart)</onclick>
    </control>

 <setting id="HomeFanart.name" type="string">Skin Backgrounds - Clear Design</setting>

I don't fully understand what you mean, but setting and retrieving a single setting is of course already supported and not a problem. And trying to read write to the settings file directly is not really recommended. Also you'll still need a script and cannot do it from the skin itself.

So it's more like:
xml:

skin.string($info[container.folderpath,thumbshape_],wide)

And you'll get something like this in the settings file.
xml:

<setting id="thumbshape_plugin://plugin.program.advanced.emulator.launcher/?catID=06769a6d83a2d2dcd0988c0054abe6c4&amp;com=SHOW_ROMS&amp;launID=8f699a541378d389c75fa293e747f6c8" type="string">wide</setting>

Unfortunately reading the setting like that will not work. So it would be great to just have that support build in into Kodi skin engine.
So like:
xml:

skin.pathString(thumbshape,wide)