interface
border
BRC2
layer=9
icon='Buttons.dmi'
icon_state="1"
screen_loc="14:8,1"
var/clicked
Click()if(!clicked)
usr.okay=1
clicked=1
for(var/interface/O in usr.client.screen)usr.client.screen-=O
How can i change the Click() section to a verb called Action(), which is called when the user presses the space bar? (I understand that a macro for Action is required, with a shortkey of the spacebar, but it is the set up of the verb that is confusing me). Or is it even possible?
*: This is because a macro just runs a client command (like those you can execute in an input control or from Options and Messages), and client commands can't arbitrarily run procs (or it'd be a huge stupidity as well as exploit, of course).
But since Click() is a special, verb-like proc, you can call it with a macro using the .click AtomName client command. But doing it this way is not as flexible or reliable as the other methods, so the one I already recommended is far more recommended.
By the way, if the only objects in the player's screen are of the /interface type, then you can replace the for() loop with a simple, instant emptying of the list (such as screen.Cut()) to achieve the exact same effect.