Creating Custom Save and Load Dialogs: Difference between revisions

*>CMK2901
No edit summary
*>CMK2901
Line 89: Line 89:
   }</code>
   }</code>


This code first checks that the text box is not empty.  It then checks whether the currently highlighted save game is the same as the one in the text box.  If so, it overwrites.  If not, a new save is created, if there is enough roomAGS is currently limited to 20 save slots.  Immediately before saving, the "Save" GUI is closed, so the player can keep playing.
This code first checks that the text box is not empty.  It then checks whether the save name in the text box is already being used.  If so, it overwrites.  If not, a new save is created, if there is enough room - AGS is currently limited to 20 save slots.  Immediately before saving, the "Save" GUI is closed, so the player can keep playing.


It is important that anything you want to do when saving is placed '''before/above''' the "SaveGameSlot()" commands.  Anything below "SaveGameSlot()" will be executed, but NOT saved into the file, because it occurs after the save command.
It is important that anything you want to do when saving is placed '''before/above''' the "SaveGameSlot()" commands.  Anything below "SaveGameSlot()" will be executed, but NOT saved into the file, because it occurs after the save command.


== Script the Delete Button ==
== Script the Delete Button ==
Anonymous user