I used ListBox.FillSaveGameList(); code in my custom Save GUI's list box and it works fine, but when I do the same thing for my Restore GUI's list box, I get nothing. I've checked and double-checked and triple-checked the code and it should be working, but it just doesn't fill my load list with saves. What gives?
On another note, I've been trying to get my Save GUI to overwrite save games if the input to the Text Box is the same as the name of a previously saved game (In the Sierra style). I've got this code:
[code]
int saves;
#sectionstart SaveButton_Click//SAVE BUTTON IN THE CONTROL PANEL GUI
function SaveButton_Click(GUIControl *control, MouseButton button)
{gControl.Visible = false;
gSavegame.Centre();
gSavegame.Visible = true;
saves = (SaveList.ItemCount);
if (saves > 19) {
DisplayMessage(990);
}
}
#sectionend SaveButton_Click//SAVE BUTTON IN THE CONTROL PANEL GUI
#sectionstart SavegameButton_Click // DO NOT EDIT OR REMOVE THIS LINE
function SavegameButton_Click(GUIControl *control, MouseButton button) {
String input = SaveText.Text;
String item = SaveList.Items[SaveList.SelectedIndex];
if (input.CompareTo(item) == 0) { // i.e. strings match
SaveGameSlot(SaveList.SelectedIndex, SaveText.Text);
}
else {
SaveGameSlot(saves, SaveText.Text);
SaveList.AddItem(input);
}
gSavegame.Visible = false;
gIconbar.Visible = true;
}
#sectionend SavegameButton_Click // DO NOT EDIT OR REMOVE THIS LINE[/code]
However, every time I try to save a game with this code, the game crashes and tells me I've got an "invalid index specified." I've scoured the manual,
this thread and
this thread, but I've still come up with nothing. What's the story here?
I swear to God if I ever get this down I'm making a tutorial. No one should have to search as much as I did for anything regarding this engine, much less something so universally desired as custom Save and Load GUIs.