Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: shaun9991 on Fri 25/03/2022 19:42:33

Title: Pressing Enter/Return key to Save game [SOLVED]
Post by: shaun9991 on Fri 25/03/2022 19:42:33
Hi there,

Apologies for all the questions recently!

I'm looking to implement a little "ease of life" feature into my game - once the player has typed the name of their Save game, it will be cool if they could just press the Enter/Return key for the game to save and the Save gui to close (rather than having to then click the "Save" button with the mouse after they've typed it) . Is there a way of doing this? I've tried a few things but nothing has worked so far.

I have a very standard set up for the save system, as seen here: https://www.adventuregamestudio.co.uk/wiki/Creating_Custom_Save_and_Load_Dialogs

Any suggestions are greatly appreciated :)

Many thanks,
Shaun
Title: Re: Pressing Enter/Return key to Save game
Post by: eri0o on Fri 25/03/2022 19:50:29
If they select the previous save, doesn't it overwrite the previous and it works?
Title: Re: Pressing Enter/Return key to Save game
Post by: Crimson Wizard on Fri 25/03/2022 21:32:09
Quote from: shaun9991 on Fri 25/03/2022 19:42:33
I'm looking to implement a little "ease of life" feature into my game - once the player has typed the name of their Save game, it will be cool if they could just press the Enter/Return key for the game to save and the Save gui to close (rather than having to then click the "Save" button with the mouse after they've typed it)

The text box control has OnActivate event which is called when player presses enter; add a function for that event and call Save button's handler from there.
Title: Re: Pressing Enter/Return key to Save game [SOLVED]
Post by: shaun9991 on Fri 25/03/2022 22:39:43
Thanks CW! That works perfectly :)

I completely missed the OnActivate event!