<onup> conditionals?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ekim232 Offline
Posting Freak
Posts: 1,204
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Question  <onup> conditionals? Post: #1
I was wondering if it is possible to add a conditional to <onup>

ie.
<onup>PlayMedia($INFO[ListItem.Trailer],1) condition="Skin.HasSetting(TrailerInfo)"</onup>

and then have another <onup>62</onup>

I am not sure of that would be the correct coding for it, but hopefully it give you an idea of what I am thinking. Any help would be appreciated. Thanks everyone!
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #2
ekim232 Wrote:I was wondering if it is possible to add a conditional to <onup>

ie.
<onup>PlayMedia($INFO[ListItem.Trailer],1) condition="Skin.HasSetting(TrailerInfo)"</onup>

and then have another <onup>62</onup>

I am not sure of that would be the correct coding for it, but hopefully it give you an idea of what I am thinking. Any help would be appreciated. Thanks everyone!

use includes see example below:
Code:
<include name="Trailer">
     <ondown>PlayMedia($INFO[ListItem.Trailer],1)</ondown>
</include>
<include name="Scrollbar">
     <ondown>62</ondown>
</include>

then place this in your wraplist, fixedlist , etc
Code:
<include condition="Skin.HasSetting(TrailerInfo)">Trailer</include>
<include condition="!Skin.HasSetting(TrailerInfo)">Scrollbar</include>
(This post was last modified: 2009-06-25 13:11 by andyblac.)
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,269
Joined: Jun 2006
Reputation: 55
Location: Earth
Post: #3
The problem with that way is the condition will only be true on window load
I personally would have 2 controls with the same id with the right <visible conditions> point the ondown to that id have one do <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus> and the other do <onfocus>Setfocus(62)</onfocus>

Skins I have done....
[Image: skinsq.png]
And others in the past...

Want to know what I'm working on currently? Check me out on Google+
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #4
Jezz_X Wrote:The problem with that way is the condition will only be true on window load
I personally would have 2 controls with the same id with the right <visible conditions> point the ondown to that id have one do <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus> and the other do <onfocus>Setfocus(62)</onfocus>

what type of ID should use control group ?, something like

<control type="group" id="61">
<visible>Skin.HasSetting(videomovies) + Skin.HasSetting(movietrailers)</visible>
<onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
</control>

<control type="group" id="61">
<visible>Skin.HasSetting(videotv) + Skin.HasSetting(tvpreview)</visible>
<onfocus>PlayMedia($INFO[listitem.path]$INFO[listitem.filename],1)</onfocus>
</control>

<control type="group" id="61">
<visible>!Skin.HasSetting(movietrailers) | !Skin.HasSetting(tvpreview)</visible>
<onfocus>Setfocus60</onfocus>
</control>


<ondown>61</ondown>
find quote
ekim232 Offline
Posting Freak
Posts: 1,204
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Post: #5
I haven't had eany luck with either method. Here are my groups I made

<control type="group" id="72">
<visible>!Skin.HasSetting(TrailerInfo)</visible>
<onfocus>Setfocus(61)</onfocus>
</control>
<control type="group" id="72">
<visible>Skin.HasSetting(TrailerInfo)</visible>
<onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
</control>


The window id is 57 and the page control is 61. I placed this just outside of my itemlayout coding and put my ondown to 72. Any suggestions on what I am doing wrong? Thanks everyone.
find quote
ekim232 Offline
Posting Freak
Posts: 1,204
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Post: #6
I don't really like to bump, but if anyone could help me out with this I would appreciate it. It is driving me crazy because I see what Jezz is saying, but I can't get it to work. I am not sure if I need to adjust my page control and the visibles for that id as well.

I just need a push in the right direction. Much thanks to anyone who can help.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,570
Joined: Oct 2003
Reputation: 138
Post: #7
1. A single group that you can nav to.

2. Have 2 controls inside that group, each with different <onfocus> and <visible> lines.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #8
ekim232 Wrote:I don't really like to bump, but if anyone could help me out with this I would appreciate it. It is driving me crazy because I see what Jezz is saying, but I can't get it to work. I am not sure if I need to adjust my page control and the visibles for that id as well.

I just need a push in the right direction. Much thanks to anyone who can help.

finaly figure it out see code below, just bare in mined that when you press down you will be changing focus, so you will have to amend your visbles tag on any item that uses your original control ID to include that new ID's, (in my case it was 52, so i need to add 600 & 601), don't forget about your "MyVidoeNav.xml" as well.

For your info to get it work:
ID 7000 = is the ID of the popup menubar. Change this to your ID

Try this code below for your needs:

Place outside your wraplist
Code:
<control type="button" id="600">
            <visible>Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
            <onleft>57</onleft>
            <onright>57</onright>
            <onup>7000</onup>
            <ondown>601</ondown>
            <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
            </control>

        <control type="button" id="600">
        <visible>!Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
        <onfocus>Setfocus(61)</onfocus>
        </control>

        <control type="button" id="601">
            <texturefocus>-</texturefocus>
            <texturenofocus>-</texturenofocus>
            <onleft>57</onleft>
            <onright>57</onright>
            <onup>7000</onup>
            <ondown>600</ondown>
            <onfocus>PlayerControl(stop)</onfocus>
        </control>

place this inside your wraplist:
Code:
<ondown>600</ondown>
(This post was last modified: 2009-07-01 00:44 by andyblac.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,570
Joined: Oct 2003
Reputation: 138
Post: #9
Yuck. Please don't do multiple controls with the same id unless you absolutely have to.

This is what groups are for! Just have the 2 buttons (any id you like) inside the group with id 600 and it'll just work.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #10
jmarshall Wrote:Yuck. Please don't do multiple controls with the same id unless you absolutely have to.

This is what groups are for! Just have the 2 buttons (any id you like) inside the group with id 600 and it'll just work.

Cheers,
Jonathan

could you do me a quick example ?

EDIT: never mind got it work for my mod, ii have ameended it for you ekin232,

Code:
<control type="group" id="600">
     <control type="button" id="602">
         <visible>Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
         <onleft>57</onleft>
         <onright>57</onright>
         <onup>601</onup>
         <ondown>60</ondown>  <!-- this is aeon's scrollbar so change this to what you want -->
         <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
     </control>

     <control type="button" id="603">
         <visible>!Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
         <onfocus>Setfocus(61)</onfocus>
     </control>
</control>

<control type="button" id="601">
      <texturefocus>-</texturefocus>
      <texturenofocus>-</texturenofocus>
      <onleft>57</onleft>
      <onright>57</onright>
      <onup>600</onup>
      <ondown>60</ondown>
      <onfocus>PlayerControl(stop)</onfocus>
  </control>
(This post was last modified: 2009-07-01 01:15 by andyblac.)
find quote
Post Reply