Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Knox on Thu 07/11/2013 17:55:29

Title: Query if a button has no action?
Post by: Knox on Thu 07/11/2013 17:55:29
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) Select

oCg = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if (!oCg.HasAction) ShowXClickOverlay();
Title: Re: Query if a button has no action?
Post by: Slasher on Sun 10/11/2013 13:41:00
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.



Title: Re: Query if a button has no action?
Post by: Khris on Sun 10/11/2013 14:43:22
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.
Title: Re: Query if a button has no action?
Post by: Knox on Mon 11/11/2013 04:44:24
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?