For instance, mainline would be easy via:
Code: Select all
<visible>System.HasAddon(script.xbmc.subtitles)</visible>
Code: Select all
<visible>System.HasAddon(script.xbmc.subtitles)</visible>
So just out of curiosity - since you're already toying with things - how difficult would it be to implement the functionDan Dar3 wrote:For scripts, I'll need to look into how the installer plugin deploys it, but if say using a "script.xbmc.subtitles" addon id for now it will look for Q:\scripts\XBMC Subtitles or whatever folder it gets deploys it to; similar for plugins.
Code: Select all
Skin.SetAddon(string,type)
At least you got it to compile...and also to work btw Here's a debug (first with the "missing script button" and then the "installed script button" with above conditions) of your work in action. Worked without a hitch - well almost - 64mb ram made it a bit choppy but I'll see if I can't sort that out with some skinning trickery.I had no idea what was I getting myself into, should see the bumps on my head
Code: Select all
<control type="button" id="399"> <!--Lyrics-->
<description>LYRICS BUTTON</description>
<width>70</width>
<height>70</height>
<label>31926</label>
<focusedcolor>red</focusedcolor>
<font></font>
<texturefocus>osd-subtitles-focus.png</texturefocus>
<texturenofocus>osd-subtitles-nofocus.png</texturenofocus>
<onclick condition="System.HasAddon(script.cu.lyrics)">RunScript(special://home/scripts/CU Lyrics/default.py)</onclick>
<onclick condition="!System.HasAddon(script.cu.lyrics)">RunPlugin(plugin://programs/Addons4Xbox Installer/?installfromrepo=true&addonname=CU+Lyrics&url=http%3A%2F%2Fmirrors.xbmc.org%2Faddons%2Ffrodo%2Fscript.cu.lyrics%2Fscript.cu.lyrics-3.0.1.zip&datadir=http%3A%2F%2Fmirrors.xbmc.org%2Faddons%2Ffrodo&addonid=script.cu.lyrics&type=zip&repoid=repository.xbmc.org)</onclick>
<animation effect="zoom" end="120" center="auto" time="100">focus</animation>
<animation effect="zoom" start="120" center="auto" time="100">unfocus</animation>
</control>
Code: Select all
<control type="button" id="399"> <!--Lyrics-->
<description>LYRICS BUTTON</description>
<width>70</width>
<height>70</height>
<label>31926</label>
<focusedcolor>red</focusedcolor>
<font></font>
<texturefocus>osd-subtitles-focus.png</texturefocus>
<texturenofocus>osd-subtitles-nofocus.png</texturenofocus>
<onclick condition="System.HasAddon(script.cu.lrclyrics)">RunScript(special://home/scripts/CU LRC Lyrics/default.py)</onclick>
<onclick condition="!System.HasAddon(script.cu.lrclyrics)">RunPlugin(plugin://programs/Addons4Xbox Installer/?installfromrepo=true&addonname=CU+LRC+Lyrics&url=http%3A%2F%2Fmirrors.xbmc.org%2Faddons%2Ffrodo%2Fscript.cu.lrclyrics%2Fscript.cu.lrclyrics-1.0.7.zip&datadir=http%3A%2F%2Fmirrors.xbmc.org%2Faddons%2Ffrodo&addonid=script.cu.lrclyrics&type=zip&repoid=repository.xbmc.org)</onclick>
<animation effect="zoom" end="120" center="auto" time="100">focus</animation>
<animation effect="zoom" start="120" center="auto" time="100">unfocus</animation>
</control>