Kodi Community Forum

Full Version: Conditional buttons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
more of a feature suggestion, but wanted to discuss any implimentation issues first.

im curious if it would be possible to make buttons who's navigation targets can be dynamically changed via conditions or buttons who's <execute>/<hyperlink> navigation can be controlled by conditions

specifically im thinking of dynamic buttons being displayed depending on what the buttons scroller has currently selected.
implimentation may be easier to create a new <type> of button whos textures, hyperlink, and font can change depending on a condition. this sort of implimentation could possibly have some memory advantages too

this could make a cascading style menu much more possible.
should be able to use...

buttonscroller.hasicon(<icon # goes here>)


... this works for image visibility
yea from what i understand you should be able to create several buttons at the same location with the visibility dependant upon what is going on. but remember if you set it up to be dependent on the current focused button it will no longer be focused if you move it off to select the button that became visible. so you would have to put in a visible if main button has focus or if self has focus. so it would not disapear when you moved to it. again i am not sure if this is posible but it makes sense. but does xbmc not allow a button to be selected if it is not visible.
but how would navigation work. the button scroller does not have individual <left> / <right> tags for each entry in the button scroller. how would the proper button (and therefor proper <hyperlink>) be used.

for example if when videos is displayed a button linking to 'titles' database view is presented in location x,y with id 100. when music is focused then 'library' button is presented in location x,y with id 200. the <right> tag in the button scroller may only ever be linked to either 100 or 200. if this were to be used then only one of the two buttons would work as only one could ever be selected



1. put a stack of buttons on top of each other as outlined above.

2. make their visibile conditions a separate entry in the button scroller, and make sure they're visible if they are focused.

3. make them all the same id. the <execute> tags will take care of what the buttons do.

4. make this the <right> id out of the button scroller.

that should do the trick i think.

cheers,
jonathan
ty jm
:oops:
should have realized that myself