DisableIfLocalVarEquals


#1

Hello, I’m trying to use UIObject_OnUpdate_DisableIfLocalVarEquals to disable a OnUpdate with an UpdateRate, but it doesn’t seem to work as it’ll still keep firing the script every heartbeat. Here’s an example UI.

	<UIButton name="test" update="true" updaterate="5.0"
		OnUpdate=UIObject_OnUpdate_DisableIfLocalVarEquals(local:0,"true")
		OnUpdate0=UIObject_Misc_ExecuteServerScript("gui_testscript")
	/>	

If I can’t get it to work. Is there a way through a GUI to simulate a left click? Because if it’s disabled, OnLeftClick won’t fire.


#2

? concrete example of what you want to happen ?


#3

Is it really necessary to use that command? I see you’re calling a script as well, can’t it be handled from the script instead?

Show us the script and the conditions under which you want to disable the UI object and we can help you finding a solution.

Also, maybe I remember it wrong, but if you are using OnUpdate0 shouldn’t you use OnUpdate1 instead of OnUpdate? Granted, it’s been a while since I last toyed with an XML, so I’m not 100% sure about that.


#4

 
interesting … that page contains usage of UIObject_OnUpdate_DisableIfLocalVarEquals()