v18 GetLabel() on image Control not working with special path
#1
Ok, this is driving me crazy.
consider this piece of code:
xml:

            <control type="image">
                <include>mediaflags_large_layout</include>
                <texture>flags/flags_large/extras.png</texture>
                <visible>!String.Contains(Control.GetLabel(44444),blank)</visible>
                <visible>System.HasAddon(script.videoextras) + Window.IsVisible(Videos) + Container.Content(TVShows)</visible>
            </control>
and
xml:

        <control type="image" id="44444">
            <description>hidden image to verify if any extras exist</description>
            <posx>-100</posx>
            <posy>-100</posy>
            <width>1</width>
            <height>1</height>
            <texture fallback="blank.png">$INFO[ListItem.DBID,special://profile/addon_data/script.videoextras/tvshows/,.png]</texture>
            <visible>true</visible>
        </control>

but that doesn't work as expected, image flags/flags_large/extras.png is always there, when it should be just visible if a file, 25.png for example, exists in the addons user data.
i tried something more simpler then:
xml:

            <control type="image" id="112233">
                <texture fallback="blank.png">$INFO[ListItem.DBID,special://profile/addon_data/script.videoextras/tvshows/,.png]</texture>
                <visible>System.HasAddon(script.videoextras) + Window.IsVisible(Videos) + Container.Content(TVShows)</visible>
            </control>
            <control type="label">
                <width>auto</width>
                <posx>300</posx>
                <height>80</height>
                <aligny>center</aligny>
                <label>$INFO[Control.GetLabel(112233)]</label>
            </control>
And this is where the fun begins. The Image is shown as expected, if there is 25.png for show with id 25, it will be shown.
However, the coresponding debug label shows nothing at all. i tried to replace the texture again with flags/flags_large/extras.png, and here the debug label shows the path as expected.
why is that? Bug? or made i something stupid? Probably system dependend? (I am on windows 10, just in case that matters)

Update:
Ok, i guess i am lost here. I thought i might try this on a very basic skin, namely confluence, and here everything works. This is super annoying. (Just in case someone else has time and want to give that a try, the skin i am fighting with is Titan Vanilla, this code peace is from IncludeMediaFlags.xml)
Reply
#2
(2020-04-29, 22:14)Canuma Wrote: Ok, this is driving me crazy.
consider this piece of code:
xml:

            <control type="image">
                <include>mediaflags_large_layout</include>
                <texture>flags/flags_large/extras.png</texture>
                <visible>!String.Contains(Control.GetLabel(44444),blank)</visible>
                <visible>System.HasAddon(script.videoextras) + Window.IsVisible(Videos) + Container.Content(TVShows)</visible>
            </control>
and
xml:

        <control type="image" id="44444">
            <description>hidden image to verify if any extras exist</description>
            <posx>-100</posx>
            <posy>-100</posy>
            <width>1</width>
            <height>1</height>
            <texture fallback="blank.png">$INFO[ListItem.DBID,special://profile/addon_data/script.videoextras/tvshows/,.png]</texture>
            <visible>true</visible>
        </control>

but that doesn't work as expected, image flags/flags_large/extras.png is always there, when it should be just visible if a file, 25.png for example, exists in the addons user data.
i tried something more simpler then:
xml:

            <control type="image" id="112233">
                <texture fallback="blank.png">$INFO[ListItem.DBID,special://profile/addon_data/script.videoextras/tvshows/,.png]</texture>
                <visible>System.HasAddon(script.videoextras) + Window.IsVisible(Videos) + Container.Content(TVShows)</visible>
            </control>
            <control type="label">
                <width>auto</width>
                <posx>300</posx>
                <height>80</height>
                <aligny>center</aligny>
                <label>$INFO[Control.GetLabel(112233)]</label>
            </control>
And this is where the fun begins. The Image is shown as expected, if there is 25.png for show with id 25, it will be shown.
However, the coresponding debug label shows nothing at all. i tried to replace the texture again with flags/flags_large/extras.png, and here the debug label shows the path as expected.
why is that? Bug? or made i something stupid? Probably system dependend? (I am on windows 10, just in case that matters)

Update:
Ok, i guess i am lost here. I thought i might try this on a very basic skin, namely confluence, and here everything works. This is super annoying. (Just in case someone else has time and want to give that a try, the skin i am fighting with is Titan Vanilla, this code peace is from IncludeMediaFlags.xml)
Reply
#3
(2020-04-29, 22:14)Canuma Wrote: Ok, this is driving me crazy.
consider this piece of code:
xml:

            <control type="image">
                <include>mediaflags_large_layout</include>
                <texture>flags/flags_large/extras.png</texture>
                <visible>!String.Contains(Control.GetLabel(44444),blank)</visible>
                <visible>System.HasAddon(script.videoextras) + Window.IsVisible(Videos) + Container.Content(TVShows)</visible>
            </control>
and
xml:

        <control type="image" id="44444">
            <description>hidden image to verify if any extras exist</description>
            <posx>-100</posx>
            <posy>-100</posy>
            <width>1</width>
            <height>1</height>
            <texture fallback="blank.png">$INFO[ListItem.DBID,special://profile/addon_data/script.videoextras/tvshows/,.png]</texture>
            <visible>true</visible>
        </control>

but that doesn't work as expected, image flags/flags_large/extras.png is always there, when it should be just visible if a file, 25.png for example, exists in the addons user data.
i tried something more simpler then:
xml:

            <control type="image" id="112233">
                <texture fallback="blank.png">$INFO[ListItem.DBID,special://profile/addon_data/script.videoextras/tvshows/,.png]</texture>
                <visible>System.HasAddon(script.videoextras) + Window.IsVisible(Videos) + Container.Content(TVShows)</visible>
            </control>
            <control type="label">
                <width>auto</width>
                <posx>300</posx>
                <height>80</height>
                <aligny>center</aligny>
                <label>$INFO[Control.GetLabel(112233)]</label>
            </control>
And this is where the fun begins. The Image is shown as expected, if there is 25.png for show with id 25, it will be shown.
However, the coresponding debug label shows nothing at all. i tried to replace the texture again with flags/flags_large/extras.png, and here the debug label shows the path as expected.
why is that? Bug? or made i something stupid? Probably system dependend? (I am on windows 10, just in case that matters)

Update:
Ok, i guess i am lost here. I thought i might try this on a very basic skin, namely confluence, and here everything works. This is super annoying. (Just in case someone else has time and want to give that a try, the skin i am fighting with is Titan Vanilla, this code peace is from IncludeMediaFlags.xml)
Reply
#4
as far as i know u cant pull out info from image control. and second i have no idea why to use control.getlabel when u can use $INFO[ListItem.DBID]
Reply
#5
The logic seems good. Where are the controls? I had issues doing something similar (moving the location of my flags based on whether or not they were blank). I did it the same way as you, using an 'empty' fallback value on the texture then using a Control.GetLabel in my visibility condition to see if the "empty" value was being passed.

xml:

            <control type="image" id="915">
                <visible>false</visible>
                <texture fallback="flags/blank.png">$VAR[MPAA_Label]</texture>
            </control>

Then using the following condition for my visibility/animations etc

xml:

condition="String.IsEqual(Control.GetLabel(915),flags/blank.png)"

Only thing I can think that I had troubles with was when the image was placed in my includes instead of directly in MyVideoNav.xml. I think it's something to do with when the controls are evaluated or it was clashing with the visibility conditions on my includes or something.

Anyway, to get around this, I had my dummy image ("915") directly in myvideonav.xml, then it worked ok.
Reply

Logout Mark Read Team Forum Stats Members Help
GetLabel() on image Control not working with special path0