Hello everybody.
I have a problem with the button save of my game, i don't know why cant's save the game. In the debug mode it do well but don't put the save game's name in the list box. Sorry for my english.
int gameSlotToSaveInto = lstSaveGamesList.ItemCount + 1;
int i = 0;
while (i < lstSaveGamesList.ItemCount)
{
if (lstSaveGamesList.Items == txtNewSaveName.Text)
{
gameSlotToSaveInto = lstSaveGamesList.SaveGameSlots;
}
i++;
}
SaveGameSlot(gameSlotToSaveInto, txtNewSaveName.Text);
close_save_game_dialog();
Edit: I'm using the Default template
I have tried with a new project and it's works, but no in my project. Help please.
Solved. If someone happen the same:
Listbox.FillSaveGameList();
In the template isn't and gone back me crazy :tongue:
The relevant functions from the Default template of AGS 3.3.4:
function show_restore_game_dialog()
{
gRestoreGame.Visible = true;
lstRestoreGamesList.FillSaveGameList();
mouse.UseModeGraphic(eModePointer);
gIconbar.Visible = false;
}
function show_save_game_dialog()
{
gSaveGame.Visible = true;
// Get the list of save games
lstSaveGamesList.FillSaveGameList();
if (lstSaveGamesList.ItemCount > 0)
{
// If there is at least one, set the default text
// to be the first game's name
txtNewSaveName.Text = lstSaveGamesList.Items[0];
}
else
{
// No save games yet, default empty text.
txtNewSaveName.Text = "";
}
mouse.UseModeGraphic(eModePointer);
gIconbar.Visible = false;
}