tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
177 stars 41 forks source link

Allow Config.saves.onSave to cancel saving #153

Open HiEv opened 2 years ago

HiEv commented 2 years ago

I had a user ask for a way so that, when the player attempts to save the game, they can get a prompt to name the save. I wrote this up in my "Custom Save Titles" sample code. Now I have another user who wants the "Cancel" button on the prompt to cancel the save.

If you could make it so that if the Config.saves.onSave function returns false, then the save is canceled, that would allow people to cancel a save there.

Hopefully that's a minor and easy-to-implement change.

Thanks!