jurialmunkey / script.skinvariables

A helper script for Kodi skinners to construct multiple variables
GNU General Public License v3.0
37 stars 16 forks source link

Add ability to create multiple variable templates #16

Closed roidy closed 2 years ago

roidy commented 2 years ago

Allow for building multiple skinvariable templates:-

RunScript(script.skinvariables,action=buildvariables) Will build the default script-skinvariables-includes.xml from the template skinvariables.xml/json

RunScript(script.skinvariables,action=buildvariables,template=backgrounds) Will build script-skinvariables-backgrounds-includes.xml from the template skinvariables-backgrounds.xml/json

Skinvariable include files can get very large and hard to navigate, this pull request allows the includes to be built in smaller more modular chunks.

Also I found myself needing to manually edit small portions of the generated includes, meaning that if another part of the template needed to be changed I would lose all of my manual edits, this way I can split the template, allowing manual changes to be made where necessary and still rebuild other parts without losing my manual changes.

jurialmunkey commented 2 years ago

This is a great idea. I need to give it a quick test once I'm back at my computer before I merge but the code looks good to me.

jurialmunkey commented 2 years ago

Updated it to change the hash setting name based on the template. Each template will need a separate hash value so SV knows when its xml needs to be rewritten and the skin reloaded.

Also, I switched the template name to be passed as a keyword argument rather than passing the whole params dictionary. That's more future proofing than an immediate issue though.