Variable width with $INFO
#1
Hi all. Can anyone tell me why my ListItems Property does not work for a width field?:

Does not work:
Code:
                    <control type="image">
                        <left>700</left>
                        <top>5</top>
                        <height>20</height>
                        <width>$INFO[ListItem.Property(percentage)]</width>
                        <texture colordiffuse="FF12B2E7">colors/grey.png</texture>
                        <bordertexture border="10" infill="false"></bordertexture>
                    </control>

However, the label Control just below it shows the right number between 0-100 followed by a %:

Code:
                    <control type="label">
                        <left>700</left>
                        <top>5</top>
                        <width>100</width>
                        <height>20</height>
                        <label>$INFO[ListItem.Property(percentage)]%</label>
                        <font>font9</font>
                        <align>center</align>
                        <aligny>center</aligny>
                    </control>

I am trying to realize a simple bar that indicates the signal strength of an wifi. My idea was an image Control with max 100 witdh filled to whatever the signal strength is between 0-100. So for example if it is 90 it is almost fully filled, if it is 10, its only a small bar....
Thanks for any hint!
Reply
#2
Make a set of 20x100 pixel textures numbered 001.png to 100.png where 001.png has 1px grey and 99px transparent all the way up to 100.png that is completing grey.
Then use the following:

xml:
<control type="image">
<left>700</left>
<top>5</top>
<height>20</height>
<width>100</width>
<texture colordiffuse="FF12B2E7">$VAR[Percentage]</texture>
<bordertexture border="10" infill="false"></bordertexture>
</control>

And the variable:

xml:
<variable name="Percentage">
<value condition="String.IsEqual(ListItem.Property(percentage),100)">percentage/100.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),99)">percentage/099.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),98)">percentage/098.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),97)">percentage/097.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),96)">percentage/096.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),95)">percentage/095.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),95)">percentage/095.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),94)">percentage/094.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),93)">percentage/093.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),92)">percentage/092.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),91)">percentage/091.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),90)">percentage/090.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),89)">percentage/089.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),88)">percentage/088.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),87)">percentage/087.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),86)">percentage/086.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),85)">percentage/085.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),84)">percentage/084.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),83)">percentage/083.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),82)">percentage/082.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),81)">percentage/081.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),80)">percentage/080.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),79)">percentage/079.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),78)">percentage/078.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),77)">percentage/077.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),76)">percentage/076.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),75)">percentage/075.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),74)">percentage/074.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),73)">percentage/073.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),72)">percentage/072.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),71)">percentage/071.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),70)">percentage/070.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),69)">percentage/069.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),68)">percentage/068.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),67)">percentage/067.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),66)">percentage/066.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),65)">percentage/065.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),64)">percentage/064.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),63)">percentage/063.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),62)">percentage/062.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),61)">percentage/061.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),60)">percentage/060.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),59)">percentage/059.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),58)">percentage/058.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),57)">percentage/057.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),56)">percentage/056.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),55)">percentage/055.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),54)">percentage/054.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),53)">percentage/053.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),52)">percentage/052.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),51)">percentage/051.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),50)">percentage/050.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),49)">percentage/049.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),48)">percentage/048.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),47)">percentage/047.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),46)">percentage/046.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),45)">percentage/045.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),44)">percentage/044.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),43)">percentage/043.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),42)">percentage/042.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),41)">percentage/041.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),40)">percentage/040.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),39)">percentage/039.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),38)">percentage/038.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),37)">percentage/037.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),36)">percentage/036.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),35)">percentage/035.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),34)">percentage/034.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),33)">percentage/033.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),32)">percentage/032.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),31)">percentage/031.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),30)">percentage/030.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),29)">percentage/029.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),28)">percentage/028.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),27)">percentage/027.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),26)">percentage/026.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),25)">percentage/025.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),24)">percentage/024.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),23)">percentage/023.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),22)">percentage/022.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),21)">percentage/021.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),20)">percentage/020.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),19)">percentage/019.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),18)">percentage/018.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),17)">percentage/017.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),16)">percentage/016.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),15)">percentage/015.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),14)">percentage/014.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),13)">percentage/013.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),12)">percentage/012.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),11)">percentage/011.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),10)">percentage/010.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),9)">percentage/009.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),8)">percentage/008.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),7)">percentage/007.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),6)">percentage/006.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),5)">percentage/005.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),4)">percentage/004.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),3)">percentage/003.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),2)">percentage/002.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),1)">percentage/001.png</value>
<value condition="String.IsEqual(ListItem.Property(percentage),0)">percentage/000.png</value>
</variable>
Reply
#3
Wow! Thank you a lot Hitcher for your effort! Good to found a way to realize it, i tried all combinations including parameter forwarding and such Wink
Reply
#4
It's how I added an addon install progress bar to my skin:

Image

https://github.com/Hitcher/skin.ftv/blob...r.xml#L802
Reply
#5
Yes, thats exactly what i am trying to do, just in blue Wink
Thank you a lot again!
Reply
#6
Don't even need a variable, can just do:

Code:
$INFO[ListItem.Property(percentage),percentage/,.png]

Only difference is that you need to remove leading zeros from your textures, so 000.png would need to be 0.png and 001.png would be 1.png etc.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#7
I wonder why I used a variable then?
Reply
#8
(2024-05-11, 14:30)Hitcher Wrote: I wonder why I used a variable then?

If you use ListItem.Progress, then I think you have to use a variable. That's because ListItem.Progress doesn't give any number with $INFO since it is meant to be used in the progress control not a label control. The trick there is to use a variable with Integer.IsEqual to convert it.

Maybe that's what you were thinking of?

EDIT: Or could be you just wanted the numbers to line up nicely. Otherwise you get 1 10 11 12 100 ... 2 20 21 ... 3 30 31 32 etc. in the folder when sorting by name.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#9
I remember now - it's because I was using the progress label ListItem.Label2 when installing an addon from the list of addons.
Reply
#10
wow that looks like quite a bit of effort and resources for a progress bar, isn't there a control for that? Like the slidebar?
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
No because you can have multiple addons installing/updating at once.
Reply
#12
(2024-05-11, 21:23)CrystalP Wrote: wow that looks like quite a bit of effort and resources for a progress bar, isn't there a control for that? Like the slidebar?

In Hitcher's case, the issue for addonsbrowser is that Label2 has a percent sign on the end -- e.g. 97% -- which you can't use in a progress control. Progress bar control is pretty limited in skin engine to only accept very specific types of info labels.

You could have textures names 97%.png etc. though.

Then can do

Code:

$INFO[ListItem.Label2,percentage/,.png]

And then to reuse for values without percent on end it is as simple as adding it in

Code:

$INFO[ListItem.Property(someintegerproperty),percentage/,%.png]

Still a massive pain to need 100 textures for it, but we're used to these types of limitations as skinners!
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#13
Yeah I went with the variable so I could reuse the percentage textures for other progress bars instead of having an identical set that were just named differently.
Reply
#14
Is this beneficial compared to doing it with a single texture and conditional zoom animations?
Reply
#15
(2024-05-12, 14:52)realcopacetic Wrote: Is this beneficial compared to doing it with a single texture and conditional zoom animations?

Conditional animation will have worse performance because all conditions for all 100 animation will always evaluate.

Variable only evaluates as far down as it needs (early exit), so will only be as many conditions as the percentage value.

Info is best performance because no conditional evaluation, just asks for texture name.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
Variable width with $INFO0