Noob question regarding includes
#1
Hey guys,
I am currently trying to learn how to skin, the reason is, i would like to use my favorite skin Titan within leia, but unfortunately it seems Titans development has come to an end (I know about the mods, but I 'd prefer to have something different). Now Titan is a rather complex skin and I am not sure if I ever will be able to make everything work, but I 'd like to try.

So, I right now, I am looking into the skin, with the skinning manual open, trying to understand how things work. This is when I stumbled over this piece of code in home.xml:
           
<include name="WidgetsAutoRotate" content="WidgetsAutoRotate"
             condition="[String.Contains(Skin.String(HomeLayout), netflix) | Skin.String(HomeLayout, win10)] + Skin.String(widgets_rotate_delay) + !Skin.String(widgets_rotate,disabled)">
             <param name="interval" value="$INFO[Skin.String(widgets_rotate_delay)]"/>
</include>

If I understand it correctly, the intention was to call the include WidgetsAutoRotate, not to define it? Unfortunately, i found a lot of those include name= content= constructions, so I am a bit unsure if I can safely remove the name attributes.

This brings me to my follow up question, How are includes even defined and used? More precisely, are they always defined globally? Or is there a difference between global and local includes? if so, how would I know which is which? So in case of previously mentioned include WidgetsAutoRotate, Am i right that such an include should be defined only once? (As I said, right now there are several includes all over the place where I assume they always define a new include)
Reply
#2
Yeah, that include looks wrong. You use <include name="foobar"> to define an include and <include content="foobar"> to call it (or <include>foobar</include> without passing params).
In your example, the include is definitely intended to be calling the include. You can tell because it has a condition tag and the params have value="" tags (whereas include definitions have default="" tags in the params to define default values).

Yes, you are correct - includes are always defined globally and only once. You can put them in any includes file that is included in Includes.xml
Reply
#3
Thanks for your reply, that was very helpful.
There are still several things not fully clear to me, but it is a start. In the meantime i got even sublime somewhat working, unfortunately that opened another worm can of problems. It seems that this skin has several invalid arguments and deprecated tags and i start to wonder if i wouldn't be better of to start from scratch, since my intention is to only keep a fraction of titans features anyway.
However right now i keep fighting, especially since I solved another mysterious behavior just now (It seems like kodi will always write vars in settings.xml, as soon as the skin tries to read them via Skin.String(var), even when they are never defined via Skin.SetString(var, value)
Reply
#4
Regarding vars - you would be better served using window properties if the values are intended to be temporary. Only use skin strings if you need the value to persist after a restart of kodi.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Noob question regarding includes00