Need help reading skin settings
#1
Hi,

I was trying to dynamically set the names of my settings using Container.Content. The following works perfectly and toggled tvshows.nohighlist  and others.
xml:

<control type="togglebutton" id="6053">
    <description>LowList Toggle</description>
    <textwidth>255</textwidth>
    <include>ButtonCommonValues</include>
    <label>$LOCALIZE[31093]</label>
    <onclick>Skin.ToggleSetting($INFO[Container.Content,,.nohighlist])</onclick>
    <onclick>ReloadSkin()</onclick>
    <visible>Control.IsVisible(501)</visible>
</control>

I am, however, unable to read this back dynamically. What I am trying to do is replace nohighlist in the code below, with my setting names that are Container.Content + .nohighlist.
xml:

<visible>!Skin.HasSetting(nohighlist)</visible>

I tried just basic replacement and it didn't work.
xml:

<visible>!Skin.HasSetting($INFO[Container.Content,,.nohighlist])</visible>

I tried setting a variable and expressions and they didn't work either. Do you have any pointers for me?
Reply
#2
I'm going to preface this by saying that skinning is not one of my greatest strengths.  What I noticed when building an Estuary modification was that changing a setting on a page and then trying to read that setting further down the same page always yielded the "old" setting value.  In my case I was trying to set some default values at the top of the page, and those variables were always empty further down the page.  I had to either reload the skin or move off the page and back to it to get them to load.  My assumption is there is something in the order of operation when a skin page is created that is causing that challenge.  I fixed it by adding some logic so that the "default" action was also looking for an empty setting, but I don't think that particular strategy will help in your case.
Reply
#3
You're probably going to have to use separate controls for each condition using <visible>!Skin.HasSetting(tvshows.nohighlist)</visible> etc.
Reply
#4
Thanks you guys for taking the time to reply.

@pkscout, luckily I have the luxury of doing ReloadSkin() but to make sure I wasn't stuck in what you explained, I killed Kodi and relaunched it. Still can't read dynamic stuff into HasSetting.

@Hitcher, I guess onclick is resolving $INFO before handing it to ToggleSetting but we don't have the same behavior for visible, condition, and expression. Is that how it was meant to be or is it a bug?

Can it be that in the past 100 years of Kodi, no one has attempted to use dynamically-named settings?


For now I am using a huge expression:
xml:

<expression name="ShowHighList">
    [Container.Content(files) + !Skin.HasSetting(files.nohighlist)] |
    [Container.Content(songs) + !Skin.HasSetting(songs.nohighlist)] |
    [Container.Content(artists) + !Skin.HasSetting(artists.nohighlist)] |
    [Container.Content(albums) + !Skin.HasSetting(albums.nohighlist)] |
    [Container.Content(movies) + !Skin.HasSetting(movies.nohighlist)] |
    [Container.Content(tvshows) + !Skin.HasSetting(tvshows.nohighlist)] |
    [Container.Content(seasons) + !Skin.HasSetting(seasons.nohighlist)] |
    [Container.Content(episodes) + !Skin.HasSetting(episodes.nohighlist)] |
    [Container.Content(musicvideos) + !Skin.HasSetting(musicvideos.nohighlist)] |
    [Container.Content(genres) + !Skin.HasSetting(genres.nohighlist)] |
    [Container.Content(years) + !Skin.HasSetting(years.nohighlist)] |
    [Container.Content(actors) + !Skin.HasSetting(actors.nohighlist)] |
    [Container.Content(playlists) + !Skin.HasSetting(playlists.nohighlist)] |
    [Container.Content(plugins) + !Skin.HasSetting(plugins.nohighlist)] |
    [Container.Content(studios) + !Skin.HasSetting(studios.nohighlist)] |
    [Container.Content(directors) + !Skin.HasSetting(directors.nohighlist)] |
    [Container.Content(sets) + !Skin.HasSetting(sets.nohighlist)] |
    [Container.Content(tags) + !Skin.HasSetting(tags.nohighlist)] |
    [Container.Content(countries) + !Skin.HasSetting(countries.nohighlist)] |
    [Container.Content(roles) + !Skin.HasSetting(roles.nohighlist)] |
    [Container.Content(images) + !Skin.HasSetting(images.nohighlist)]
</expression>

If you have a better idea, I would love to hear it.
Reply

Logout Mark Read Team Forum Stats Members Help
Need help reading skin settings0