Expressions in Variables
#1
Apologies if this is already out there in the wild. Results from searching yielded nothing of use.

As part of Krypton, the idea behind expressions is a godsend. Seemingly they do not work as a value condition in a variable though despite first glance suggesting otherwise.

If a Kodi dev or a knowledgeable soul sees this, if they could let me know if this is intended behavior, a bug, or whatever, It'd aid me in my skinning pursuits. Smile
Reply
#2
Hmm...noone can asnwer this?
I guess the question is justified.
The post (http://forum.kodi.tv/showthread.php?tid=...pid2280099) from ronie in the Krypton skinning changes thread says

Quote: expressions can be used in the following tags/attributes:

visible
enable
usealttexture
selected
condition

An the variable also has a condition attribute
PHP Code:
<variable name="SomeVar">
    <
value condition="String.IsEmpty(ListItem.PlayCount)">some value</value>
    <
value>some other value</value>
</
variable

So either it's unsupported on purpose or variables were forgotten Smile
Which one is it?
Reply
#3
Can anyone please tell me why expressions don't work as a value condition in variables, please? Anyone?
Reply
#4
Because noone fixed it yet. Wink
Can confirm the issue. Will try to fix when I find some time.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#5
Thanks a bunch, phil65. Greatly appreciated. Smile
Reply
#6
I too am working with variables. But I'm new, trying to figure how to set and use them. Rather than using <variable> I am doing things like:

<onclick condition="!Player.HasVideo">Skin.ToggleSetting(RyeBSValue)</onclick>

I'm storing my variables in my settings.xml using commands like onclick, onfocus ondasher, and ondancer ETC.
I'm using them in the usual way:<visible>Skin.HasSetting(RyeBSValue)

I'm really new to this but could this work for you? As a newbie, I don't see why <variable> is needed.
Reply
#7
(2016-12-21, 23:10)RyeHumor Wrote: I too am working with variables. But I'm new, trying to figure how to set and use them. Rather than using <variable> I am doing things like:

<onclick condition="!Player.HasVideo">Skin.ToggleSetting(RyeBSValue)</onclick>

I'm storing my variables in my settings.xml using commands like onclick, onfocus ondasher, and ondancer ETC.
I'm using them in the usual way:<visible>Skin.HasSetting(RyeBSValue)

I'm really new to this but could this work for you? As a newbie, I don't see why <variable> is needed.

What you're doing is just straight conditions. As the name implies, variables are useful for being variable... A basic example would be, let's say I have designed a view and I want this view to be in multiple areas of the skin (Movies, Music, Programs) but certain elements need to change depending on area. Let's say I have a label that says "About This Movie:" just before the plot but I need to have it so it changes to "About This Album:" when in Music. Rather than having to have two separate label controls with visible tags to determine when they appear I can have a single label control that references a variable.

Also, what you appear to be doing there has nothing to do with variables. Tongue

Here is my basic example in actual code for you, maybe it'll help in some way:

<control type="label">
<left>100</left>
<top>580</top>
<width>560</width>
<height>20</height>
<align>left</align>
<aligny>center</aligny>
<font>font_18</font>
<textcolor>ff5aabdf</textcolor>
<shadowcolor>black</shadowcolor>
<label>$VAR[ABOUTTHISITEM]</label>
</control>

<variable name="ABOUTTHISITEM">
<value condition="Window.IsVisible(Movies)">About This Movie:</value>
<value condition="Window.IsVisible(Music)">About This Album:</value>
<value></value>
<variable>

If you have any direct questions, feel free to shoot me a PM. Smile
Reply
#8
Thanks to rmrector and xhaggi for the necessary changes that were merged into master branch.
Nightlies starting tomorrow should have the new functionality.

https://github.com/xbmc/xbmc/pull/12035
Reply
#9
(2017-06-03, 11:48)Kib Wrote: Thanks to rmrector and xhaggi for the necessary changes that were merged into master branch.
Nightlies starting tomorrow should have the new functionality.

https://github.com/xbmc/xbmc/pull/12035

Wonderful news. Been waiting a long time for that one to be fixed. Smile

Thanks for all the effort.
Reply

Logout Mark Read Team Forum Stats Members Help
Expressions in Variables0