2024-03-12, 05:39
I am wondering it it is possible, either via skin code or via addon code, to conditionally load a particular skin file, is a particular (weather) addon is in use. Basically I want to intercept the weather window if the addon is enabled, and load different stuff into it.
I.e. when weather is opened:
if System.AddonIsEnabled(blah.blah) -> load CustomWeather.xml
else -> load MyWeather.xml
The best solution I have found is to replace MyWeather.xml with something like this:
...but ideally I'd like an unmolested MyWeather.xml to be present, or at most say a line in that that basically expresses 'if addon -> do this, otherwise carry on with the default you find here'
I'm open to both skin code solutions and addon solutions, if anybody has any ideas as to how this might work!
I.e. when weather is opened:
if System.AddonIsEnabled(blah.blah) -> load CustomWeather.xml
else -> load MyWeather.xml
The best solution I have found is to replace MyWeather.xml with something like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<window>
<include condition="String.IsEqual(Weather.Plugin(),weather.ozweather)" file="OzWeatherMyWeather.xml">ozweather</include>
<include condition="!String.IsEqual(Weather.Plugin(),weather.ozweather)" file="MyWeather_ConfluenceStandard.xml">normal_weather</include>
</window>
...but ideally I'd like an unmolested MyWeather.xml to be present, or at most say a line in that that basically expresses 'if addon -> do this, otherwise carry on with the default you find here'
I'm open to both skin code solutions and addon solutions, if anybody has any ideas as to how this might work!