Problem with includes/params/IsEqual
#1
Hi,

I would be glad if you can help me with this annoying case.
Why does IsEqual not return "True"? (It always returns "False" instead)

I have this code for example:
Code:
    <include content="Tag_NF">
       <param name="tagstyle" value="landscapesmall" />                        
    </include>

    <include name="Tag_NF">  
        <include content="ThumbsTagOverlaySmall">
            <param name="tagstyle" value="$PARAM[tagstyle]" />            
        </include>
    </include>

    <include name="ThumbsTagOverlaySmall">
        <control type="group">
            <include content="LandscapeSmallTagOverlayVisibility">
                <param name="tagstyle" value="$PARAM[tagstyle]" />                        
            </include>
        </control>
    </include>

     <include name="LandscapeSmallTagOverlayVisibility">
        <visible>String.IsEqual($PARAM[tagstyle], landscapesmall)</visible> 
    </include>
Reply
#2
You have a space after the comma and before landscapesmall.
Reply
#3
(2021-10-26, 12:44)Hitcher Wrote: You have a space after the comma and before landscapesmall.

Still the same with your fix:
Code:
<visible>String.IsEqual($PARAM[tagstyle],landscapesmall)</visible>

I don't know why it returns false here.
Reply
#4
Can you even use $PARAM in String.IsEqual?
Reply
#5
(2021-10-26, 12:56)Hitcher Wrote: Can you even use $PARAM in String.IsEqual?

Per the wiki, it can only be an InfoLabel.
OSMC Skinner      |    The OSMC Skin for Kodi v20 Nexus (native 16:9, 21:9 and 4:3 skin, special cinemascope/CIH version available)      |     GitHub: https://github.com/Ch1llb0/skin.osmc
Reply
#6
So what can I do instead?

What other ways can I pass a parameter like this or comparing values except "String.IsEqual"?
Reply
#7
(2021-10-26, 13:35)burekas Wrote: So what can I do instead?

What other ways can I pass a parameter like this or comparing values except "String.IsEqual"?

You could print a PARAM to a hidden label with an ID inside an include and compare to that label by using Control.GetLabel(id).
OSMC Skinner      |    The OSMC Skin for Kodi v20 Nexus (native 16:9, 21:9 and 4:3 skin, special cinemascope/CIH version available)      |     GitHub: https://github.com/Ch1llb0/skin.osmc
Reply
#8
(2021-10-26, 14:11)Chillbo Wrote:
(2021-10-26, 13:35)burekas Wrote: So what can I do instead?

What other ways can I pass a parameter like this or comparing values except "String.IsEqual"?

You could print a PARAM to a hidden label with an ID inside an include and compare to that label by using Control.GetLabel(id).
Could you please show me an example according to my code above?

Thanks.
Reply
#9
(2021-10-26, 14:53)burekas Wrote: Could you please show me an example according to my code above?

Thanks.

Maybe something like this:

xml:

<include name="LandscapeSmallTagOverlayVisibility">
        <visible>String.IsEqual(Control.GetLabel(5000), landscapesmall)</visible>
</include>

<include name="LandscapeSmallTagOverlayVisibilityLabel">
       <control type="label" id="5000">
              <label>$PARAM[tagstyle]</label>
              <textcolor></textcolor>
       </control>
</include>

But keep in mind that includes are only evaluated and written once when the window is being opened. If that's enough for you and you don't need it to change on-the-fly, this might work.
OSMC Skinner      |    The OSMC Skin for Kodi v20 Nexus (native 16:9, 21:9 and 4:3 skin, special cinemascope/CIH version available)      |     GitHub: https://github.com/Ch1llb0/skin.osmc
Reply
#10
@Chillbo 

Thanks.
So I tried that, but Control.GetLabel(5000) is always empty, even when setting the label hardcoded.
I verify that by String.IsEmpty(Control.GetLabel(5000)).

Code:
<include>LandscapeSmallTagOverlayVisibilityLabel</include>
<include>LandscapeSmallTagOverlayVisibility"</include>
* I'm currently testing it with hardcoded label text so I call the include without parameters.
* And I set another id which is not in use.

I guess maybe it something with the Includes.
Reply
#11
(2021-10-26, 12:54)burekas Wrote:
(2021-10-26, 12:44)Hitcher Wrote: You have a space after the comma and before landscapesmall.

Still the same with your fix:
Code:
<visible>String.IsEqual($PARAM[tagstyle],andscapesmall)</visible>

I don't know why it returns false here.


string.isequal can just be used with existing strings.

landscapesmall is not a valid string (infolabel)

you need something like

e.g
string.isequal(skin.string(skinstringname),landscapesmall)

the engine must need to know what (infolabel) is to take for a equation.
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#12
By the way, at the end I found another creative way to implement what I wanted.
Instead of the comparison way, I'm using the $PARAM value inside the include name.
So I set another value, I set another include with a different visible condition for each case.

Following the example in my first comment:
Code:
    <include content="Tag_NF">
       <param name="includeName" value="landscapesmall" />                        
    </include>

    <include name="Tag_NF">  
        <include content="ThumbsTagOverlaySmall">
            <param name="includeName" value="$PARAM[includeName]" />            
        </include>
    </include>

    <include name="ThumbsTagOverlaySmall">
        <control type="group">
            <include>$PARAM[includeName]</include>
        </control>
    </include>

    <include name="landscapesmall">
        <visible>true</visible> 
    </include>
Reply

Logout Mark Read Team Forum Stats Members Help
Problem with includes/params/IsEqual0