I'm really no coder guy, it took me almost 1 week to get this code together and also working as inteded, please don't blame me if some stuff is maybe primitive or dirty.
Great thanks @
manfeed & @
jurialmunkey to get the main codes i needed for that.
Please test out the
Multirole Multiimage feature on the Movies
"Suspiria (2018)" - Tilda Swinton,
"The Lego Movie 2 (2019)" - Chris Pratt,
"Beauty and the Beast (2017)" - Dan Stevens
And the
Multiple Set Selection on
Pets 2 (2019),
Solo: A Star Wars Story (2018),
Justice League (2017)
Install:
Download the addon. You can not install immediately cause it's i .rar. First unpack then install the ZIP and after install put the resource folder into the already installed Resource Addon.
This is cause when installing the content with it all Special Character will be falsified. For example the name "Françoise Dorléac" will get "FranBLAoise DorlBLAac" so it's corrupting the files making label matching not possible anymore...
A common still unsolved problem...
Implementation:
Toggle Button to switch between alternative Sets of a Movie with Fallback.
If Choosen Alternative 4, then 4, if not falling back to 3, if not falling back to 2, if not falling back to Main.
In my skin IncludesTopMenu.xml
Code:
<control type="button" id="93154">
<label>Dialogoe Character Poster</label>
<label2>$VAR[DialogCharacterPosterToggle]</label2>
<include>TopMenuButton</include>
<onclick condition="String.IsEqual(skin.string(characterposter_toggle),Main)">Skin.SetString(characterposter_toggle,Alternative1)</onclick>
<onclick condition="String.IsEqual(skin.string(characterposter_toggle),Alternative1)">Skin.SetString(characterposter_toggle,Alternative2)</onclick>
<onclick condition="String.IsEqual(skin.string(characterposter_toggle),Alternative2)">Skin.SetString(characterposter_toggle,Alternative3)</onclick>
<onclick condition="String.IsEqual(skin.string(characterposter_toggle),Alternative3)">Skin.SetString(characterposter_toggle,Alternative4)</onclick>
<onclick condition="String.IsEqual(skin.string(characterposter_toggle),Alternative4)">Skin.SetString(characterposter_toggle,Off)</onclick>
<onclick condition="String.IsEqual(skin.string(characterposter_toggle),Off)|String.IsEmpty(skin.string(characterposter_toggle))">Skin.SetString(characterposter_toggle,Main)</onclick>
<visible>Container.Content(movies)</visible>
</control>
3 Variables, for the toggle Button, Single Image, Multi Image, in my Skin IncludesVariables.xml
Code:
<variable name="DialogCharacterPosterToggle">
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Main)">Main</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative1)">Altern 1</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative2)">Altern 2</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3)">Altern 3</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4)">Altern 4</value>
<value condition="String.IsEqual(Skin.string(characterposter_toggle),Off)">Off</value>
</variable>
Code:
<variable name="DialogCharacterPosterImageSingle">
<!--MAIN-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Main)">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label].jpg</value>
<!--ALTERNATIVE 1-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative1) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative1) + !String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label].jpg</value>
<!--ALTERNATIVE 2-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative2) + String.IsEmpty(Control.GetLabel(103002)) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative2) + String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative2) + !String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#3/$INFO[Container(50).ListItem.Label].jpg</value>
<!--ALTERNATIVE 3-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002)) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + String.IsEmpty(Control.GetLabel(104002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#3/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + !String.IsEmpty(Control.GetLabel(104002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#4/$INFO[Container(50).ListItem.Label].jpg</value>
<!--ALTERNATIVE 4-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002)) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002)) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002)) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002)) + String.IsEmpty(Control.GetLabel(104002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#3/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#4/$INFO[Container(50).ListItem.Label].jpg</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + !String.IsEmpty(Control.GetLabel(105002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#5/$INFO[Container(50).ListItem.Label].jpg</value>
</variable>
Code:
<variable name="DialogCharacterPosterImageMulti">
<!--MAIN-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Main)">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label]</value>
<!--ALTERNATIVE 1-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative1) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative1) + !String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label]</value>
<!--ALTERNATIVE 2-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative2) + String.IsEmpty(Control.GetLabel(103002)) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative2) + String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative2) + !String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#3/$INFO[Container(50).ListItem.Label]</value>
<!--ALTERNATIVE 3-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002)) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + String.IsEmpty(Control.GetLabel(104002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#3/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative3) + !String.IsEmpty(Control.GetLabel(104002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#4/$INFO[Container(50).ListItem.Label]</value>
<!--ALTERNATIVE 4-->
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002)) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002)) + String.IsEmpty(Control.GetLabel(102002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002)) + String.IsEmpty(Control.GetLabel(104002)) + String.IsEmpty(Control.GetLabel(103002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002)) + String.IsEmpty(Control.GetLabel(104002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#3/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + String.IsEmpty(Control.GetLabel(105002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#4/$INFO[Container(50).ListItem.Label]</value>
<value condition="String.IsEqual(Skin.String(characterposter_toggle),Alternative4) + !String.IsEmpty(Control.GetLabel(105002))">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#5/$INFO[Container(50).ListItem.Label]</value>
</variable>
Main Code for DialogVideoInfo.xml
Code:
<!--Character Poster BEGIN CODE-->
<!--Character Poster Single Character
PATH: resource://resource.images.characterposter/IMDBnumber/actorname.jpg
-->
<control type="image" id="101000">
<left>1482</left>
<top>123</top>
<width>393</width>
<height>575</height>
<aspectratio aligny="left">stretch</aspectratio>
<texture background="true">$VAR[DialogCharacterPosterImageSingle]</texture>
<fadetime>FanartCrossFadeTime</fadetime>
<animation effect="fade" start="0" end="100" time="500" delay="0">Visible</animation>
<animation effect="fade" start="100" end="0" time="500" delay="0">Hidden</animation>
<visible>!Control.Hasfocus(149) + !Control.Hasfocus(160) + Container.Content(movies)</visible>
</control>
<!--Character Poster Multi Character
PATH: resource://resource.images.characterposter/IMDBnumber/actorname/
If a actor has multiple roles where a Character Poster set is there (for example Chris Pratt in "The LEGO Movie 2 (2019)" or Tilda Swinton in "Suspiria (2018)")...
instead of a actor filename "actorname.jpg" there is a actor folder "actorname" deposited. Inside the first name is "actorname.jpg" for the matching of the next Code passage (Fake Image)
The second name is "actorname1.jpg". So you can run multi-image also in integer mode you'll get the main role first and the the second role second in multiimage.
Note, if you want to use the addon not with label matching, instead more like a multi image artwork type like extrafanart, there is a also a copy of the multi character images beside the other characters.
The names are there falsified actorname0.jpg and actorname1.jpg to not get a muddle for labing matching and you can't anyway do label matching if want to use this way.
-->
<control type="multiimage">
<left>1482</left>
<top>123</top>
<width>393</width>
<height>575</height>
<timeperimage>6000</timeperimage>
<randomize>false</randomize>
<aspectratio aligny="left">stretch</aspectratio>
<imagepath background="true">$VAR[DialogCharacterPosterImageMulti]</imagepath>
<fadetime>FanartCrossFadeTime</fadetime>
<animation effect="fade" start="0" end="100" time="500" delay="0">Visible</animation>
<animation effect="fade" start="100" end="0" time="500" delay="0">Hidden</animation>
<visible>!Control.Hasfocus(149) + !Control.Hasfocus(160) + Container.Content(movies) +
[!String.IsEmpty(Control.GetLabel(101001)) | !String.IsEmpty(Control.GetLabel(102001)) | !String.IsEmpty(Control.GetLabel(103001)) | !String.IsEmpty(Control.GetLabel(104001)) | !String.IsEmpty(Control.GetLabel(105001))]</visible>
</control>
<!--Character Poster Multi Image Character Fake Image
PATH: resource://resource.images.characterposter/IMDBnumber/actorname/actorname.jpg (and actorname1.jpg for the following)
DESCRIPTION:
This creates fake images outside your screen directed to the first actor Image in Subfolder for Multi-Image in Resource Addon.
Cause the dialogvideoinfo is most static it should not be that resource consuming.
This is dirty but is necessary that multi-image is also disappearing and not "get stuck"
A bit more advanced Skinner than me could do the multiimage run in a list and not a controly type multiimage so this would maybe not necessary anymore.
-->
<!--MAIN-->
<control type="image" id="101001">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<aspectratio aligny="bottom">keep</aspectratio>
<texture background="true">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]/$INFO[Container(50).ListItem.Label]/$INFO[Container(50).ListItem.Label].jpg</texture>
</control>
<!--ALTERNATIVE 1-->
<control type="image" id="102001">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<aspectratio aligny="bottom">keep</aspectratio>
<texture background="true">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#2/$INFO[Container(50).ListItem.Label]/$INFO[Container(50).ListItem.Label].jpg</texture>
</control>
<!--ALTERNATIVE 2-->
<control type="image" id="103001">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<aspectratio aligny="bottom">keep</aspectratio>
<texture background="true">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#3/$INFO[Container(50).ListItem.Label]/$INFO[Container(50).ListItem.Label].jpg</texture>
</control>
<!--ALTERNATIVE 3-->
<control type="image" id="104001">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<aspectratio aligny="bottom">keep</aspectratio>
<texture background="true">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#4/$INFO[Container(50).ListItem.Label]/$INFO[Container(50).ListItem.Label].jpg</texture>
</control>
<!--ALTERNATIVE 4-->
<control type="image" id="105001">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<aspectratio aligny="bottom">keep</aspectratio>
<texture background="true">resource://resource.images.characterposter/$INFO[ListItem.IMDBNumber]#5/$INFO[Container(50).ListItem.Label]/$INFO[Container(50).ListItem.Label].jpg</texture>
</control>
<!--Detector of Multiple Character Poster Sets
PATH: resource://resource.images.characterposter/detector/IMDBnumber#(2-5).jpg
DESCRIPTION:
This creates also fake images outside your screen.
Cause if a Movie have more Character Poster Sets Versions avaiable it's a detecting indicator with the "IMDBnumber#(2-5)" fake files deposited in the Resource addon.
If choosen in the options to prefer an Alternative Character Poster set version, the 2 variables in the IncludesVariables.xml detects if multiple sets are there and if not it's falling back.
-->
<!--ALTERNATIVE 1-->
<control type="image" id="102002">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<texture background="true">resource://resource.images.characterposter/detector/$INFO[ListItem.IMDBNumber]#2.jpg</texture>
</control>
<!--ALTERNATIVE 2-->
<control type="image" id="103002">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<texture background="true">resource://resource.images.characterposter/detector/$INFO[ListItem.IMDBNumber]#3.jpg</texture>
</control>
<!--ALTERNATIVE 3-->
<control type="image" id="104002">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<texture background="true">resource://resource.images.characterposter/detector/$INFO[ListItem.IMDBNumber]#4.jpg</texture>
</control>
<!--ALTERNATIVE 4-->
<control type="image" id="105002">
<left>-1</left>
<top>-1</top>
<width>1</width>
<height>1</height>
<texture background="true">resource://resource.images.characterposter/detector/$INFO[ListItem.IMDBNumber]#5.jpg</texture>
</control>
<!--Character Poster END CODE-->