I'm implementing a "Resume Game" button to my startmenu when you launch the game. It's disabled if there are no savegames present, and if there are savegames present it is active and is supposed to load the latest savegame automaticly on click.
I so far worked around reading if there are save games present. But how can I approach that it finds out which of the savegames is the latest and loads that? WME has a File Object and I thought that would come in handy, but I couldn't find out how or if at all you can read the Date attribute of the files with that.
What solution is there for this problem?
How I read if there are save games:
var SaveGamePresent;
for(var i=0; i<101; i=i+1) // 101 is my amount of save slots
{
// set to true and break loop the moment a savegame is found
{
SaveGamePresent = true;
break;
} else SaveGamePresent = false;
}
// activate the button if there are no savegames, disable it if there are none
var button;
if(SaveGamePresent
) button.
Disabled =
false;
Thanks alot
Darky