button shows based on variable

Help each other out

button shows based on variable

Postby sssscary on Fri Nov 05, 2010 6:03 pm

Hi, I wonder if I can have a button that only shows on movie viewer when I have a value in movies>trailers> in my movie.xml. If no value, or empty, then hide button. something like that? please and thanks!
sssscary
 
Posts: 4
Joined: Sun Dec 24, 2006 12:40 am

Re: button shows based on variable

Postby P3rv3rt B3ar on Sat Nov 13, 2010 12:52 pm

Thats (among other things) exactly the reason which gave birth to my xPerT plugin. However based on user feedback here its a nasty thing to use. :lol: If u consider yourself a poweruser and r confident of your computing skills and preferably have degree or two of formal education in fields of computer science, network technology, etc rocket science... u might wanna take a look :lol:

Besides interfacing xlobby with my plugin architecture (pervtalk) theres a loads of convinience features built in xpert. Including command logic like "if". That and "loadpic" are two commands u need to utilize to build a structured statement to achieve what u r after in the xpert way... feel free to check it out.

EDIT: i just realised that needed documentation to achieve what u r after might not be available anymore... ill see if i can write u example of use here bit later.

EDIT:

Ok here is part of my of .xml command file which is associated to movie screen on my skin
Code: Select all
      <command>
        <type>plugin</type>
        <execute>command</execute>
        <parameter>xPerT</parameter>
        <parameter>If</parameter>
        <parameter>[movies&gt;trailerpath]|xlobby;button show;PT3</parameter>
      </command>


that is a one command of event which is launched when screen is entered or movie changed and so on... its function is to show trailer button whenever theres trailer associated to the movie in question. so apperently u use "If" command of expert with parameter: "[your_movie_database_name>your_database_atribute]|xlobby;button show;ID_of_your_button" or in more general case of if "value_if_depends|command_to_be_run_if_has_value". notice the angled parenthesis in example above im pretty sure theyre needed so xpert can call back xlobby to determ the value of the variable. If u dont get that to work, i can look it up more throroughly.
.
Also that is the original way to do such thing with xpert (If as command), but im pretty sure i later on added a more convinient way which uses if and loadpic (if as variable).

EDIT: to get xPerT.dll u can download marble's zoneskin. To make it work u only need to put xPerT.dll on your plugin folder

EDIT: and ofcourse if u wanna make the command presented above to work u need another command in the same event before that one which hides the button as default case. obviously.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: button shows based on variable

Postby sssscary on Sat Nov 13, 2010 8:31 pm

Thanks very much for the detailed explanation. I will try it out as soon as I get the chance. In the meantime, I used XVirtualEvents to pop up a message saying 'no trailer' when you click on the button and there is no trailer value. Obviously, not having the button would be better, so i will definitely try your suggestion out.
sssscary
 
Posts: 4
Joined: Sun Dec 24, 2006 12:40 am