Creating Custom Save and Load Dialogs: Difference between revisions

no edit summary
*>CMK2901
No edit summary
*>CMK2901
No edit summary
Line 1: Line 1:


== Introduction ==
== Introduction ==
Line 127: Line 126:
== Applying To a Load GUI ==
== Applying To a Load GUI ==


Applying this to a "load" GUI would be fairly easy.  Simply create a nearly identical GUI to the "Save" one and, in the element script names, replace all instances of the word "Save" with "Load".  Do the same with the "Cancel", "Delete", and "List Box" code, and those will be ready.  The only real difference would be the "Load" button, which you would change to this:
Applying this to a "load" GUI would be fairly easy.  Simply create a nearly identical GUI to the "Save" one and, in the element script names, replace all instances of the word "Save" with "Load".  Do the same with the "Cancel", "Delete", and "List Box" code, and those will be ready.  The load dialogue probably doesn't need the Text Box element.  The only real difference would be the "Load" button, which you would change to this:


<code>
<code>
Line 139: Line 138:
     return;
     return;
   }
   }
   if(lstLoads.SelectedIndex == -1) //no highlighted item
   if(lstLoadGames.SelectedIndex == -1) //no highlighted item
   {
   {
     Display("Please select a saved game to be loaded");
     Display("Please select a saved game to be loaded");
   }
   }
   else if(lstLoads.SelectedIndex >= 0) //an item is selected...  
   else if(lstLoadGames.SelectedIndex >= 0) //an item is selected...  
   {
   {
     RestoreGameSlot(savegameindex[lstLoadGames.SelectedIndex]);
     RestoreGameSlot(savegameindex[lstLoadGames.SelectedIndex]);
Line 157: Line 156:


1) On the save GUI, more than one save can have the same name, leading to considerable confusion (3 saves named "Library", for example).  This is because an entered save name is only checked against the highlighted save.
1) On the save GUI, more than one save can have the same name, leading to considerable confusion (3 saves named "Library", for example).  This is because an entered save name is only checked against the highlighted save.
'''TO BE CONTINUED'''
Anonymous user