Kodi Community Forum

Full Version: $PARAM[id] focusedlayout
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm having a weirdly specific issue. Not sure if this is a known thing or what.

But I've got a list I want to reuse, so I've put it in includes and use $PARAM[id] for the id and I use it for some visibility conditions with this line.

xml:
<visible>Control.HasFocus($PARAM[id])</visible>

So far so good for <itemlayout> but for <focusedlayout> this doesn't seem to work. I've copy pasted so I know it's not a typo or anything. Moving the exact same control from focusedlayout to itemlayout gets it working. Similarly replacing $PARAM[id] in focusedlayout with the actual value "4503" has everything working fine. 

Is this a known issue with parameters?
PARAMS work fine for me in focusedlayout.

What's your actual code?

Also, is it a panel control by any chance? Note that panel controls don't use focusedlayout if the actual panel itself isn't focused (automatically uses itemlayout), whereas lists will use it even if they don't specifically have focus.
(2020-09-10, 07:44)jurialmunkey Wrote: [ -> ]PARAMS work fine for me in focusedlayout.

What's your actual code?

Also, is it a panel control by any chance? Note that panel controls don't use focusedlayout if the actual panel itself isn't focused (automatically uses itemlayout), whereas lists will use it even if they don't specifically have focus.

it's a fixed list. Here's the code. Thanks for looking.
This code is working correctly, but I've had to hardcode the ID "4503" into the controls within the focusedlayout. If I change them to the same $PARAM[id] that works everywhere else in this code, it stops working as it should

xml:

<include name="WidgetList">
    <param name="id" default="4503"/>
    <param name="visible" default="Container.Content(Movies) + !String.IsEmpty(ListItem.SetID)"/>
    <param name="top" default="1640"/>
    <param name="height" default="470"/>
    <param name="onup" default="50"/>
    <param name="ondown" default="65001"/>
    <param name="onclick" default="noop"/>
    <param name="target" default="videos"/>
    <param name="sortby" default="year"/>
    <param name="sortorder" default="ascending"/>
    <param name="path" default="videodb://movies/titles/?setid=$INFO[ListItem.SetID]"/>
    <param name="hiddenlabelid" default="9700"/>
    <definition>
        <control type="fixedlist" id="4503">
            <viewtype label="Strip">wrap</viewtype>
            <top>$PARAM[top]</top>
            <left>0</left>
            <width>2160</width>
            <height>$PARAM[height]</height>
            <onup>$PARAM[onup]</onup>
            <ondown>$PARAM[ondown]</ondown>
            <onunfocus condition="!String.IsEqual(Container($PARAM[id]).CurrentItem,1)">Control.Move($PARAM[id],$INFO[Container($PARAM[id]).CurrentItem,-])</onunfocus>
            <onunfocus condition="!String.IsEqual(Container($PARAM[id]).CurrentItem,1)">Control.Move($PARAM[id],1)</onunfocus>
            <onclick>Close</onclick>
            <onclick>$PARAM[onclick]</onclick>
            <pagecontrol>60</pagecontrol>
            <preloaditems>2</preloaditems>
            <scrolltime tween="sine" easing="inout">380</scrolltime>
            <orientation>horizontal</orientation>
            <visible>$PARAM[visible]</visible>
            <animation effect="zoom" center="auto" end="85" time="190" tween="sine" easing="out" reversible ="true" condition="!Control.HasFocus($PARAM[id])">Conditional</animation>
            <content target="$PARAM[target]" sortby="$PARAM[sortby]" sortorder="$PARAM[sortorder]">$PARAM[path]</content>
            <itemlayout width="300" height="450">
                <control type="group">
                    <left>60</left>
                    <top>10</top>
                    <width>300</width>
                    <height>450</height>
                    <control type="image">
                        <texture diffuse="views/white_20.png">$VAR[InfoScreenThumb]</texture>
                        <aspectratio>scale</aspectratio>
                    </control>
                    <control type="image">
                        <texture>$VAR[InfoScreenThumb]</texture>
                        <aspectratio>scale</aspectratio>
                        <visible>Control.HasFocus($PARAM[id])</visible>
                        <include>QuickContentFadeAnimation</include>
                    </control>
                </control>
            </itemlayout>
            <focusedlayout width="300" height="450">
                <!--Dropshadow Overlay left-->
                <include content="DropShadow">
                    <param name="left" value="-60"/>
                    <param name="top" value="10"/>
                    <param name="width" value="120"/>
                    <param name="height" value="450"/>
                    <param name="visible" value="Control.HasFocus($PARAM[id]) + Container(4503).HasPrevious"/>
                    <param name="animationtype" value="Visible"/>
                    <param name="animationcondition" value="true"/>
                    <param name="animationeffect" value="fade"/>
                    <param name="animationend" value="100"/>
                    <param name="animationtime" value="190"/>
                </include>
                <!--Dropshadow Overlay right-->
                <include content="DropShadow">
                    <param name="left" value="360"/>
                    <param name="top" value="10"/>
                    <param name="width" value="120"/>
                    <param name="height" value="450"/>
                    <param name="flipx" value="true"/>
                    <param name="texture" value="views/dropshadow_left_120.png"/>
                    <param name="visible" value="Control.HasFocus(4503) + !String.IsEmpty(Control.GetLabel(9700))"/>
                    <param name="animationtype" value="Visible"/>
                    <param name="animationcondition" value="true"/>
                    <param name="animationeffect" value="fade"/>
                    <param name="animationend" value="100"/>
                    <param name="animationtime" value="190"/>
                </include>
                <!--Thumb-->
                <control type="group">
                    <left>60</left>
                    <top>10</top>
                    <width>300</width>
                    <height>450</height>
                    <control type="image">
                        <texture diffuse="views/white_20.png">$VAR[InfoScreenThumb]</texture>
                        <aspectratio>scale</aspectratio>
                    </control>
                    <control type="image">
                        <texture>$VAR[InfoScreenThumb]</texture>
                        <aspectratio>scale</aspectratio>
                        <visible>Control.HasFocus(4503)</visible>
                        <include>QuickContentFadeAnimation</include>
                    </control>
                </control>
                <!--Border-->
                <control type="image">
                    <visible>Control.HasFocus(4503)</visible>
                    <include>QuickContentFadeAnimation</include>
                    <left>50</left>
                    <width>320</width>
                    <height>470</height>
                    <aspectratio>stretch</aspectratio>
                    <texture border="11" colordiffuse="$VAR[AccentColor]">views/border_10px.png</texture>
                </control>
            </focusedlayout>
        </control>
    </definition>
</include>