Missing texture, not IsEmpty
#16
(2019-09-22, 22:02)Hitcher Wrote: Does the studio flag work correctly?

yes it works perfectly on the viewwtypes, it's jut the controls I made for the dialogVideoInfo window that I Can't get working because for those ones Control.GetLabel appears empty, even though the control texture is using the same Variables as the ones that does work...
Reply
#17
I wrote it all out again and it appears to be working now so I must have made a mistake somewhere I guess. Thanks for looking at this though!
Reply
#18
(2019-09-23, 12:29)QuizKid Wrote: I wrote it all out again and it appears to be working now so I must have made a mistake somewhere I guess. Thanks for looking at this though!

Sorry to revive this, but I thought it was working and it appears it's still not. I'm not sure if I've made a mistake or this method is just too temperamental, but this is the behavior I'm seeing:

Firstly, here is my Flag include. It basically shows an MPAA flag on the right (control 911). If The MPAA texture is missing, another control shows the Studio flag on the right (control 912). If control 912 isn't visible, then it shows a control with the studio flag on the left (control 913).

xml:

<include name="Flags">
        <control type="group">
            <visible>!Window.IsVisible(contextmenu) + !Control.HasFocus(3000) + !Container.Content(artists) + !String.Contains(ListItem.Icon,Default) + !Skin.String(Flags,disabled) + Skin.String(CommonViewtypeDetails,all)</visible>
            <!-- MPAA Flag Right-->
            <control type="image" id="911">
                <right>0</right>
                <bottom>0</bottom>
                <width>120</width>
                <height>80</height>
                <aspectratio>keep</aspectratio>
                <texture colordiffuse="$VAR[TextColor]" fallback="flags/blank.png">$VAR[Info_Certificate]</texture>
                <visible>[Skin.String(Flags,all) | Skin.String(Flags,rating)]</visible>
            </control>
            <!-- Studio Flag Right if no MPAA flag-->
            <control type="image" id="912">
                <right>0</right>
                <bottom>0</bottom>
                <width>120</width>
                <height>80</height>
                <aspectratio>keep</aspectratio>
                <texture colordiffuse="$VAR[TextColor]" fallback="flags/blank.png">$VAR[Studio_Name]</texture>
                <visible>Skin.String(Flags,studio) | Skin.String(Flags,all) + String.IsEqual(Control.GetLabel(911),flags/blank.png)</visible>
            </control>
            <!-- Sudio Flag Left if Studio Flag Right not visible-->
            <control type="image" id="913">
                <right>150</right>
                <bottom>0</bottom>
                <width>120</width>
                <height>80</height>
                <aspectratio>keep</aspectratio>
                <texture colordiffuse="$VAR[TextColor]" fallback="flags/blank.png">$VAR[Studio_Name]</texture>
                <visible>Skin.String(Flags,all) + !Control.IsVisible(912)</visible>
            </control>
        </control>
    </include>

This is the behaviour I'm seeing:

1) On Kodi load, if the MPAA and Studio flags are present, they display correctly (MPAA right, Studio left)
Image
2) If the MPAA flag is missing, the studio flag is still showing left instead of right. This is even though the Studio flag on the left is only set to be visible if the Studio flag on the Right is invisible and the studio flag on the right should be visible if the MPAA flag texture is missing.
Image
3. Now things get interesting... I scroll through my views to List view (50). In the first instance (1), things are the same, but in the second instance (2), the Studio flag on the right is now displaying instead:
Image
Image
4. If I go back to the first view, in the first instance, it's now showing both studio and MPAA flags on the right (this shouldn't be possible, as studio flag on the right has a visibility condition that MPAA flag's texture is missing and it's fallenback to blank.png). IN the second instance, the studio flag shows in the right, as would be expected.

Image
Image

At this point, I'm completely stuck...
Reply
#19
Shouldn't
xml:
Skin.String(Flags,all)
Be
xml:
String.IsEqual(Skin.String(Flags),all)

Same for all the other skin strings as well.

xml:
Skin.String(Flags,rating)
String.IsEqual(Skin.String(Flags),rating)

xml:
Skin.String(Flags,studio)
String.IsEqual(Skin.String(Flags),studio)


Unless doing that works. I don't actually know if it does or not...
Scratch that it works. Now I'm wondering if I've been doing it wrong the whole time... Confused
I assume there is no difference, just one takes longer to type out.

EDIT: Not sure I get the logic of the Flags skin string but wouldn't using a slide animation to move the studio work instead of another image control?
Might be easier than figuring out, what I like to refer to as a logic puzzle.

Also a horizontal, right aligned, grouplist might do the trick.
Reply
#20
I think this <visible>Skin.String(Flags,studio) | Skin.String(Flags,all) + String.IsEqual(Control.GetLabel(911),flags/blank.png)</visible> might need brackets around the first 2 conditions.

eg <visible>[Skin.String(Flags,studio) | Skin.String(Flags,all)] + String.IsEqual(Control.GetLabel(911),flags/blank.png)</visible>

EDIT: Seeing as the first 2 image controls use the same positions and dimensions couldn't you just use 1 image control and merge the conditions to a single variable?
Reply
#21
(2019-10-06, 09:25)Hitcher Wrote: I think this <visible>Skin.String(Flags,studio) | Skin.String(Flags,all) + String.IsEqual(Control.GetLabel(911),flags/blank.png)</visible> might need brackets around the first 2 conditions.

eg <visible>[Skin.String(Flags,studio) | Skin.String(Flags,all)] + String.IsEqual(Control.GetLabel(911),flags/blank.png)</visible>

EDIT: Seeing as the first 2 image controls use the same positions and dimensions couldn't you just use 1 image control and merge the conditions to a single variable?
Thanks, that's a good idea, I'll definitely try that - right now I'm just trying to figure out the basics still, don't really know what I'm doing haha. Still mainly deconstructing bits of your code to try and see how it works then seeing if I can make it do different things, haha.
Reply
#22
I cut it down to to controls with a slide animation to change the position, so it's much simpler now:

xml:

<include name="Flags">
        <control type="group">
            <visible>!Window.IsVisible(contextmenu) + !Control.HasFocus(3000) + !Container.Content(artists) + !String.Contains(ListItem.Icon,Default) + !Skin.String(Flags,disabled) + Skin.String(CommonViewtypeDetails,all)</visible>
            <control type="label">
                <left>0</left>
                <top>0</top>
                <height>100</height>
                <width>1600</width>
                <label>$INFO[Control.GetLabel(911)]</label>
                <visible>!String.IsEmpty(Control.GetLabel(911))</visible>
                <font>list_unfocused</font>
            </control>
            <!-- MPAA-->
            <control type="image" id="911">
                <right>0</right>
                <bottom>0</bottom>
                <width>120</width>
                <height>80</height>
                <aspectratio>keep</aspectratio>
                <texture colordiffuse="$VAR[TextColor]" fallback="flags/blank.png">$VAR[Info_Certificate]</texture>
                <visible>!Skin.String(FLags, studio)</visible>
            </control>
            <!-- Studio Flag-->
            <control type="image" id="912">
                <right>0</right>
                <bottom>0</bottom>
                <width>120</width>
                <height>80</height>
                <aspectratio>keep</aspectratio>
                <texture colordiffuse="$VAR[TextColor]" fallback="flags/blank.png">$VAR[Studio_Name]</texture>
                <visible>!Skin.String(Flags,rating)</visible>
                <animation effect="slide" start="0,0" end="-150,0" time="0" condition="Skin.String(Flags,all) + !String.IsEqual(Control.GetLabel(911),flags/blank.png)">Conditional</animation>
            </control>
        </control>
    </include>

You can see in there I added a label to write out $INFO[Control.GetLabel(911)] 

Interestingly, on any view, it is empty apart from on List view, where it populates correctly. If I then navigate back to a different view, it gets stuck on whatever the last value was while I was on list view, which explains the behaviour I have been witnessing.

I am also using this method for flags on the Video Info Dialog and it works flawlessly there, so is it something to do with the way I have my other viewtype xml files set up that it isn't triggering the value to update properly?

I'm in a bit over my head at this point, but I'd be super grateful to share my xmls with anyone who might have five minutes to help me figure this one out.

Thanks
Reply
#23
(2019-10-06, 00:20)mikeSiLVO Wrote: Shouldn't
xml:
Skin.String(Flags,all)
Be
xml:
String.IsEqual(Skin.String(Flags),all)

Same for all the other skin strings as well.

xml:
Skin.String(Flags,rating)
String.IsEqual(Skin.String(Flags),rating)

xml:
Skin.String(Flags,studio)
String.IsEqual(Skin.String(Flags),studio)
Unless doing that works. I don't actually know if it does or not...
Scratch that it works. Now I'm wondering if I've been doing it wrong the whole time... Confused
I assume there is no difference, just one takes longer to type out.

EDIT: Not sure I get the logic of the Flags skin string but wouldn't using a slide animation to move the studio work instead of another image control?
Might be easier than figuring out, what I like to refer to as a logic puzzle.

Also a horizontal, right aligned, grouplist might do the trick.

Thanks, I think the syntax was changed relatively recently to skin.string.
I've put in a slide animation, but still having trouble triggering the condition correctly (see below).
Thanks for the suggestion on a right aligned grouplist, that's initially how I thought to tackle it, but for some reason I was having difficulty getting it to work properly. Bu that was a couple of weeks ago when I was at 'absolute beginner' rather than where I'm at now "no idea what I'm doing", so it might be time to have another go, thanks!
Reply
#24
Could be another control with the same id?
Reply
#25
(2019-09-16, 21:34)QuizKid Wrote: This must have come up before but I couldn't find it so apologies if it's an old question.

Does anyone have a nice way of setting a conditional or updating a Boolean in the event that a texture is empty, e.g. there is no corresponding studio flag PNG file for the name of the studio passed in List.Studio?

It doesn't show as List.IsEmpty = true because there is a value but there's no corresponding texture file available. In this scenario I'd like to shift my flags along so there is no gap or need for a generic fallback texture.

Does anyone know how to do this?

Thanks


that's how i do it on my dialogvideoinfo

...
xml:

<control type="grouplist">
<usecontrolcoords>true</usecontrolcoords>
<orientation>horizontal</orientation>
<left>0</left>
<itemgap>10</itemgap>
<height>90</height>
...
...
<control type="image" id="7999">
<visible>!String.IsEmpty(Control.GetLabel(7999)) + !String.IsEmpty(ListItem.Studio)</visible>
<width>130</width>
<height>90</height>
<aspectratio aligny="center" align="left">keep</aspectratio>
<fadetime>200</fadetime>
<texture background="true">$VAR[image_StudioLogo]</texture>
<colordiffuse condition="String.IsEqual(Skin.String(studiologos.path),resource://resource.images.studios.white/)">$VAR[AdvancedRatings_TextColor]</colordiffuse>
</control>
<control type="button" id="7998">
<visible>String.IsEmpty(Control.GetLabel(7999)) + !String.IsEmpty(ListItem.Studio)</visible>
<width max="200">auto</width>
<height>90</height>
<font>Reg20</font>
<label>$INFO[ListItem.Studio]</label>
<aligny>center</aligny>
<align>center</align>
<wrapmultiline>true</wrapmultiline>
<textcolor>$INFO[Skin.String(ViewDetailsTextColor)]</textcolor>
<disabledcolor>$INFO[Skin.String(ViewDetailsTextColor)]</disabledcolor>
<texturenofocus colordiffuse="$INFO[Skin.String(ViewDetailsTextColor)]">netflix/frame/slimframe_softedge.png</texturenofocus>
<textoffsetx>10</textoffsetx>
<textoffsety>7</textoffsety>
<enable>false</enable>
</control>

...
next item
....


without providing a fallback image, just ckeck variable.
(no need for a conditional slide, like it is needed when use 'invisible image' as fallback="foo" which will use given image control space.

if you're using a transp fallback, just replace
String.IsEmpty(Control.GetLabel(7999))
with
String.Contains(Control.GetLabel(7999),transpfallbackimage)


https://streamable.com/sofld

if you dont want a fake button fallback if empty, just exclude / ommit it in your
grouplist.
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#26
(2019-10-06, 19:31)Hitcher Wrote: Could be another control with the same id?

I've checked across the whole xml folder and I'm pretty sure 911 isn't being used anywhere else. I tried changing it to a couple of other random numbers and no luck still
Reply
#27
(2019-10-06, 18:02)QuizKid Wrote: I'm in a bit over my head at this point, but I'd be super grateful to share my xmls with anyone who might have five minutes to help me figure this one out.

Thanks

If you want to send me the skin or link to download I can give it a test run and see if I notice anything.
Reply
#28
(2019-10-06, 18:05)QuizKid Wrote:
(2019-10-06, 00:20)mikeSiLVO Wrote: Shouldn't
xml:
Skin.String(Flags,all)
Be
xml:
String.IsEqual(Skin.String(Flags),all)

Same for all the other skin strings as well.

xml:
Skin.String(Flags,rating)
String.IsEqual(Skin.String(Flags),rating)

xml:
Skin.String(Flags,studio)
String.IsEqual(Skin.String(Flags),studio)
Unless doing that works. I don't actually know if it does or not...
Scratch that it works. Now I'm wondering if I've been doing it wrong the whole time... Confused
I assume there is no difference, just one takes longer to type out.

EDIT: Not sure I get the logic of the Flags skin string but wouldn't using a slide animation to move the studio work instead of another image control?
Might be easier than figuring out, what I like to refer to as a logic puzzle.

Also a horizontal, right aligned, grouplist might do the trick.

Thanks, I think the syntax was changed relatively recently to skin.string.
I've put in a slide animation, but still having trouble triggering the condition correctly (see below).
Thanks for the suggestion on a right aligned grouplist, that's initially how I thought to tackle it, but for some reason I was having difficulty getting it to work properly. Bu that was a couple of weeks ago when I was at 'absolute beginner' rather than where I'm at now "no idea what I'm doing", so it might be time to have another go, thanks!

in addition to the suggested method using a grouplist

i noticed you use

skin.string(FLags
and
skin.string(Flags

i think the issue can lead to case sensitive string conditions.
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#29
(2019-10-07, 10:00)mardukL Wrote:
(2019-10-06, 18:05)QuizKid Wrote:
(2019-10-06, 00:20)mikeSiLVO Wrote: Shouldn't
xml:
Skin.String(Flags,all)
Be
xml:
String.IsEqual(Skin.String(Flags),all)

Same for all the other skin strings as well.

xml:
Skin.String(Flags,rating)
String.IsEqual(Skin.String(Flags),rating)

xml:
Skin.String(Flags,studio)
String.IsEqual(Skin.String(Flags),studio)
Unless doing that works. I don't actually know if it does or not...
Scratch that it works. Now I'm wondering if I've been doing it wrong the whole time... Confused
I assume there is no difference, just one takes longer to type out.

EDIT: Not sure I get the logic of the Flags skin string but wouldn't using a slide animation to move the studio work instead of another image control?
Might be easier than figuring out, what I like to refer to as a logic puzzle.

Also a horizontal, right aligned, grouplist might do the trick.

Thanks, I think the syntax was changed relatively recently to skin.string.
I've put in a slide animation, but still having trouble triggering the condition correctly (see below).
Thanks for the suggestion on a right aligned grouplist, that's initially how I thought to tackle it, but for some reason I was having difficulty getting it to work properly. Bu that was a couple of weeks ago when I was at 'absolute beginner' rather than where I'm at now "no idea what I'm doing", so it might be time to have another go, thanks! 

in addition to the suggested method using a grouplist

i noticed you use

skin.string(FLags
and
skin.string(Flags

i think the issue can lead to case sensitive string conditions. 
Thanks, yeah I noticed that and fixed it, unfortunately it didn't make a difference, but I need to keep an eye on those little mistakes!!

Cheers
Reply
#30
(2019-10-07, 04:49)mikeSiLVO Wrote:
(2019-10-06, 18:02)QuizKid Wrote: I'm in a bit over my head at this point, but I'd be super grateful to share my xmls with anyone who might have five minutes to help me figure this one out.

Thanks

If you want to send me the skin or link to download I can give it a test run and see if I notice anything. 
Thanks, that would be amazing. Here's a link. Apologies that it's all a bit of a mess right now haha


https://1drv.ms/u/s!AsNBJgb3zz70gt9m26ec...A?e=UGZatL
Reply

Logout Mark Read Team Forum Stats Members Help
Missing texture, not IsEmpty0