EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   UI Developer Discussion (https://www.eq2interface.com/forums/forumdisplay.php?f=3)
-   -   Conditional Help (https://www.eq2interface.com/forums/showthread.php?t=14767)

TalTal 09-24-2010 07:31 PM

Conditional Help
 
OnShow="
Parent.Parent.MakeLarge.LargeReady ? Parent.Parent.MakeLarge.Press=true : ''"

Should that work?

My goal is to get a button to be pressed but only if another data element is set to true.

So far it fires no matter whatever the data element is set to.

Silat

EQAditu 09-25-2010 12:09 AM

Your syntax looks incorrect. And looking at it a second time, needlessly complicated.

I'm not exactly sure what your code wants to do... but I'm guessing this is more what you want.

Parent.Parent.MakeLarge.Press=Parent.Parent.MakeLarge.LargeReady

This would be exactly the same as:
Parent.Parent.MakeLarge.Press=Parent.Parent.MakeLarge.LargeReady ? true : false

Synax:
ValueToBeAssigned=BooleanValue ? ValueIfBooleanTrue : ValueIfBooleanFalse

gm9 09-25-2010 05:08 AM

Quote:

Originally Posted by EQAditu (Post 93367)
Parent.Parent.MakeLarge.Press=Parent.Parent.MakeLarge.LargeReady

This would be exactly the same as:
Parent.Parent.MakeLarge.Press=Parent.Parent.MakeLarge.LargeReady ? true : false

Unless this was changed I don't think so. The .Press command disregards the argument, so it would fire even on Press=false. You must use .Activated for stuff like this.

EQAditu 09-25-2010 06:39 AM

*shrug* I've never used buttons to run scripting through scripting so I guess I wouldn't know. Supposedly Buttons and Pages are both direct children of Widgets, but it seemed cleaner to me to use the simpler object to contain my scripts instead of using a UI element that expects input but is getting it simulated.

Regardless, I stand by what I said about the incorrect syntax and the comparison of complexities. What was originally written would have had the same problem regardless of the event triggered.

TalTal 09-25-2010 08:25 AM

Yea .Press fires regardless of argument so that was why I was trying the conditional. I will look into .Activated.

Thanks for the input.

Edit: Figured out another way to achieve the same goal. Now I just want to try to fix the dropdown problem. ;)



Silat


All times are GMT -5. The time now is 09:40 PM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI