Query if a button has no action?

Started by Knox, Thu 07/11/2013 17:55:29

Previous topic - Next topic

Knox

Right now I'm implementing a system that if a button is set to non-clickable and you try to click it, the current mouse cursor graphic gets an "x" overlayed on top.

I have to manually set a butt-load of certain buttons Clickable = false...is there a way to query if a button's "ClickAction" has the value "NoAction" set in the editor? Would save me some time! :=

Something like (pseudo-code):
Code: ags

oCg = GUIControl.GetAtScreenXY(mouse.x, mouse.y); 
if (!oCg.HasAction) ShowXClickOverlay();
--All that is necessary for evil to triumph is for good men to do nothing.

Slasher

#1
Hi,

no one else has replied.

What if you 'if' query Button(s) to test if it is clickable true/false?

Have not tried but maybe AGS will recognize this.




Khris

What exactly are you trying to do? Are these actual buttons that are disabled in certain circumstances?
Did you look into the differences between .Enabled and .Clickable?

Also, I don't think it's possible to read the editor setting of what the button does.

Knox

Yeah I can set and check enabled and clickable no probs, its just that I would rather not have to initially set those buttons disabled one by one at game_start. Im re-using the same "base" graphic for multiple GUIs where only some areas are different (I just change certain button graphics to make the overall GUI different for each one). Those "buttons" will never have any actions, ever.

I just thought I could save scripting time if I could access the editor properties on various objects/controls. If its not possible, maybe in another ags version we could access all editor properties via script?
--All that is necessary for evil to triumph is for good men to do nothing.

SMF spam blocked by CleanTalk