Retreiving Numerical value saved by a skin and fallback on width&height
#1
So I'm on Helix, still @ 14.0stable at the moment and working on my confluence custom mod a bit.

I'm setting a value in the skin settings xml, to make a numerical input:
Code:
<onclick>Skin.SetNumeric(CustomPointerSize)</onclick>

But I'm not sure how to go about getting this to work right... the image ends up full size of the image file.
Code:
<width fallback="64">$INFO[Skin.String(CustomPointerSize)]</width>
<height fallback="64">$INFO[Skin.String(CustomPointerSize)]</height>

Any Idea how to handle retreiving a Numeric rather than a string or the built-in function to make it a numerical maybe? and does fallback="..." work on all properties or just <texture> ?

I tried using Skin.Numeric which i couldn't find even exists as a function anyways. Also tried int() around it.

Any ideas?

This might be an awesome idea for Kodi 15.x if it doesn't already exist.

To better understand my reasons, I'm basically making the skin allow custom cursor(s) and I'd also like to do custom width/height (equal ratio) size. Potentially maybe even ColorDiffuse.

Anyways it would be nice to know if its possible to fetch and use the numerical values like that on width/height.

I also just tried $NUMBER[] found @ http://kodi.wiki/view/Label_Formatting but

<width fallback="64">$NUMBER[$INFO[Skin.String(CustomPointerSize)]]</width>

didn't seem to work.
Reply
#2
Maybe

$NUMBER[Skin.String(CustomPointerSize)]
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#3
width and height cannot take $INFO[] labels afaik. you have to use fixed ones.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#4
(2015-02-09, 19:28)phil65 Wrote: width and height cannot take $INFO[] labels afaik. you have to use fixed ones.

Yep, the only thing you can do is use multiple includes

e.g.

Code:
<include name="Width300"><width>300</width></include>
<include name="Width301"><width>301</width></include>
<include name="Width302"><width>302</width></include>
etc.

<include condition="StringCompare(Skin.String(CustomPointerSize),300)">Width300</include>
<include condition="StringCompare(Skin.String(CustomPointerSize),301)">Width301</include>
<include condition="StringCompare(Skin.String(CustomPointerSize),302)">Width302</include>
etc.

As you can imagine that is quite a tedious and excessive bit of code. I would suggest having a few common sizes (e.g. 24x24, 32x32, 48x48, 64x64) selectable from a list.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
Thank you guys.

Code:
<onclick condition="IsEmpty(Skin.String(CustomPointerSize))">Skin.SetString(CustomPointerSize,64)</onclick>
<onclick condition="Skin.String(CustomPointerSize,64)">Skin.SetString(CustomPointerSize,90)</onclick>
<onclick condition="Skin.String(CustomPointerSize,90)">Skin.SetString(CustomPointerSize,120)</onclick>
<onclick condition="Skin.String(CustomPointerSize,120)">Skin.SetString(CustomPointerSize,128)</onclick>
<onclick condition="Skin.String(CustomPointerSize,128)">Skin.SetString(CustomPointerSize,218)</onclick>
<onclick condition="Skin.String(CustomPointerSize,218)">Skin.SetString(CustomPointerSize,256)</onclick>
<onclick condition="Skin.String(CustomPointerSize,256)">Skin.SetString(CustomPointerSize,16)</onclick>
<onclick condition="Skin.String(CustomPointerSize,16)">Skin.SetString(CustomPointerSize,24)</onclick>
<onclick condition="Skin.String(CustomPointerSize,24)">Skin.SetString(CustomPointerSize,32)</onclick>
<onclick condition="Skin.String(CustomPointerSize,32)">Skin.SetString(CustomPointerSize,48)</onclick>
<onclick condition="Skin.String(CustomPointerSize,48)">Skin.SetString(CustomPointerSize,64)</onclick>
<!--onclick condition="Skin.String(CustomPointerSize,48)">Skin.Reset(CustomPointerSize)</onclick-->
<onclick>ReloadSkin()</onclick>

I was able to do this in SkinSettings.xml as well to switch between the values. Glad I spotted that in ccm.helix skin. Had to do a ReloadSkin() it seemed to be able to get the pointer's size to update.

All in all Thank you all a BUNCH! This will work quite nicely.
Reply

Logout Mark Read Team Forum Stats Members Help
Retreiving Numerical value saved by a skin and fallback on width&height1