$ADDON[] stringcompare
#1
Should it be possible to use a stringcompare on $ADDON[] labels?

I'm trying to enable / disable buttons based on the value of a label provided by an add-on:

PHP Code:
<control type="button" id="10">
    <
left>756</left>
    <
top>600</top>
    <
label>$LOCALIZE[186]</label>
    <
onup>301</onup>
    <
onleft>308</onleft>
    <
onright>-</onright>
    <
ondown>401</ondown>
    <
onclick>RunScript(script.skinshortcuts,type=buildxml&amp;mode=single&amp;mainmenuID=9110)</onclick>
    <
onclick>Close</onclick>
    <include>
dialog_WindowButton</include>
    <
visible>StringCompare(Control.GetLabel(500),$ADDON[script.skinshortcuts 32071])</visible>
</
control

(Label ID 500 can be either $LOCALIZE[31071] or $LOCALIZE[31072])

But this doesn't work. However when I use the non-localized string 32071 refers to, the condition does work.

I also tried to use

PHP Code:
<onclick condition="StringCompare(Control.GetLabel(500),$ADDON[script.skinshortcuts 32071])">RunScript(script.skinshortcuts,type=buildxml&amp;mode=single&amp;mainmenuID=9110)</onclick

because that way I would only need one button instead of one, but that will not work either.
Reply
#2
Not sure about comparing to an $ADDON string - and hopefully someone else will come along who can answer that - but in this particular situation you can use (and I would suspect actually are for button 405 Wink) the following:

Code:
StringCompare(Window.Property("groupname"),mainmenu)
Reply
#3
sigh...sometimes the solution is just right under the nose isn't it... Blush Thanks man

Out of curiosity and possible future reference, I'm still interested in the answer though Smile
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
$ADDON[] stringcompare00