Kodi Community Forum
Help with xml conditions - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Help with xml conditions (/showthread.php?tid=171775)



Help with xml conditions - karrade - 2013-08-21

hey, i'm having some serious trouble wrapping my head around the xml conditions and was wondering if someone could help me understand what they mean.

Code:
<settings>
  <category label="30001">
    <setting id="StreamUrl" type="labelenum" label="30002" lvalues="30003|30004" default="0" />
    <setting id="YoutubeVideo" type="labelenum" label="30005" lvalues="31001|31002|31003|31004|31005|31006|31007|31008|31009|31010" visible="lt(-1,1)" default="" />
    <setting id="TVRageStream" type="labelenum" label="30006" lvalues="30007|30008" visible="gt(-2,0) + lt(-2,2)" default="0" />
    <setting id="TVRageLocation" type="folder" source="video" label="30009" lvalues="30007|30008" visible="" default="" />
  </category>
</settings>

thats my code and what I want is to have 'ID:TVRageLocation to be visible only if ID:TVRageStream has 30008 selected'

but what I would really like is if someone could help me understand how eq() gt() lt() works.

like if I was a 5 year old lol.

thanks for any help in advance


RE: Help with xml conditions - Martijn - 2013-08-21

visible="eq(-1,1)"

-1 = one setting above
1 = the second option (as we start counting from 0)


untested™ Smile


RE: Help with xml conditions - karrade - 2013-08-21

ok so if I wanted the same thing but if 30007 was selected it would be

eq(-1,0)

and thank you very much that worked.

EDIT::
I tested that theory and it worked, I cant believe it was that easy and I was missing it, thank you very much