Hi all
For out 'save' window, I've used Mnemonic's new save script - the one that stacks the savegames oldest first - and shaped the window pretty much the same, except to add a static to display the date the save was made.
To my now weary eyes, it looks as though Mnemonic's save window script and mine are functionally identical - yet Mnemonic's script puts <<new saved game>> in Button 1, and on mine it somehow invents the notion of putting it in button 2.
I've taken these scripts apart, modelled them in Excel and on paper and I just cannot see where it's getting the idea to set the 'SlotButton' reference to '2' instead of '1'.
Mnemonic's script says this and puts the text in button 1:
for(var i=0; i<NumSlotButtons; i=i+1)
{
var SaveSlot = LastUsedSlot - ScrollOffset - i;
var SlotButton = this.GetControl(i+1);
SlotButton.Pressed = (SaveSlot==(LastUsedSlot-SelectedSlot));
if(SaveSlot >= 0)
{
SlotButton.Disabled = false;
if(Game.IsSaveSlotUsed(SaveSlot))
SlotButton.Text = Game.GetSaveSlotDescription(SaveSlot);
else
SlotButton.Text = "<new saved game>";
}
else
{
SlotButton.Disabled = true;
SlotButton.Text = "";
}
}
var SelSlot = LastUsedSlot - SelectedSlot;
if(Game.IsSaveSlotUsed(SelSlot)) Thumbnail.SetImage("savegame:" + SelSlot);
else Thumbnail.SetImage(null);
}
Whereas mine says this and puts the text in button 2
for(var i=0; i<NumSlotButtons; i=i+1)
{
var SaveSlot = LastUsedSlot - ScrollOffset - i;
var SlotButton = this.GetControl(i + 1);
SlotButton.Pressed = (SaveSlot==(LastUsedSlot-SelectedSlot));
if(SaveSlot >= 0)
{
SlotButton.Disabled = false;
if(Game.IsSaveSlotUsed(SaveSlot))
{
// date manipulation code
var SlotDate;
var q = Game.GetSaveSlotDescription(SaveSlot);
var StringSplit = new String(q);
var l = StringSplit.Length;
var ix = i+1;
SlotDate[ix] = StringSplit.Substr(0, 16);
SlotButton.Text = StringSplit.Substr(16, l-16);
}
else
{
SlotButton.Text = "<new saved game>";
}
}
else
{
SlotButton.Disabled = true;
SlotButton.Text = "";
}
}
There are no saved games to worry about BTW.
If I've done somethong stupid, feel free to tell me in your own words. I can take it.