What are we supposed to use now that interface_click is obsolete

Started by LateBlt, Mon 04/08/2014 23:32:07

Previous topic - Next topic

LateBlt

Sorry if this has already been answered somewhere, but I couldn't find the answer to this anywhere...

The interface_click function is marked as obsolete: "This function is obsolete, from 2.62 and earlier versions."

My question, then: What are we supposed to use instead?

If you're making an adventure game with a text parser in it, you need to make a GUI with a text box. The only way to "finish off" with a GUI containing a text box, as far as I know, is to use the interface_click function, since that function is called when the player presses Enter in the text box.

So, since interface_click is now obsolete, I figure there are 2 possibilities:
1. There is now a different function which we are supposed to used to handle the player pressing Enter in a text box. (In which case, what function is it?)
2. Text boxes are no longer handled through functions, but some other means entirely. (In which case, how do we deal with players pressing Enter in text boxes?)

If neither of these is the case, then why is interface_click obsolete? What are we expected to do instead?

Khris

GUI controls have their own event handlers now; just click the lighting bolt icon as usual and there will be a OnActivate / OnClick / Onchange event.

LateBlt

Got it. I see what you mean, and I see why this makes more sense (since now each object has its own handler, and you don't have to use an argument to interface_click to figure out what object called the function).

If anyone is up to it, might I gently suggest that this could probably be documented somewhere? I'm not a regular enough member of this community to know how to edit the relevant FAQ/wiki or where this information should go, but this seems like it could be a little clearer since information online still suggests using interface_click with text boxes.

Thanks very much for the answer! Cheers! :)

SMF spam blocked by CleanTalk