I need some help with this code. I've used the above code and most of the time it works. There are occasions when I come back from the Save and the music is no longer playing. What am I missing?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu#sectionstart partidas_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
function partidas_SelectionChanged(GUIControl *control) {
guardar.Text=partidas.Items[partidas.SelectedIndex];
}
#sectionend partidas_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart guardar_Activate // DO NOT EDIT OR REMOVE THIS LINE
function guardar_Activate(GUIControl *control) {
if(guardar.Text==""){
gSavemsg.Visible=true;
savemsglbl.TextColor = 65296;
savemsglbl.Text = ("Please enter a name before saving");
//Display("Please enter a name before saving");
return;
}
int p = 0;
while(p<=partidas.ItemCount){
if((partidas.ItemCount>p)&&(partidas.Items[p]==guardar.Text)){
//Display("The game will be overwritten");
gOverwrite.Visible=true;
cerrar.Enabled=false;
gSavemsg.Visible=false;
return;
}
p++;
}
UnPauseGame();
gSaverestore.Visible=false;
SaveGameSlot(partidas.ItemCount+1, guardar.Text);
partidas.FillSaveGameList();
guardar.Text="";
gSavemsg.Visible=true;
savemsglbl.TextColor = 65296;
savemsglbl.Text = ("Game Saved");
Wait(80);
gSavemsg.Visible=false;
//Display("Game saved");
mouse.UseDefaultGraphic();
return;
}
#sectionend guardar_Activate // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart savegame_Click // DO NOT EDIT OR REMOVE THIS LINE
function savegame_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
if(guardar.Text==""){
gSavemsg.Visible=true;
savemsglbl.TextColor = 65296;
savemsglbl.Text = ("Please enter a name before saving");
//Display("Please enter a name before saving");
return;
}
int p = 0;
while(p<=partidas.ItemCount){
if((partidas.ItemCount>p)&&(partidas.Items[p]==guardar.Text)){
//Display("The game will be overwritten");
gOverwrite.Visible=true;
cerrar.Enabled=false;
return;
}
p++;
}
UnPauseGame();
gSaverestore.Visible=false;
SaveGameSlot(partidas.ItemCount+1, guardar.Text);
partidas.FillSaveGameList();
guardar.Text="";
gSavemsg.Visible=true;
savemsglbl.TextColor = 65296;
savemsglbl.Text = ("Game Saved");
Wait(80);
gSavemsg.Visible=false;
//Display("Game saved");
mouse.UseDefaultGraphic();
UnPauseAudio();
return;
}
#sectionend savegame_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart restoregame_Click // DO NOT EDIT OR REMOVE THIS LINE
function restoregame_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
if(partidas.ItemCount!=0){
int index = partidas.SelectedIndex;
RestoreGameSlot(savegameindex[index]);
partidas.FillSaveGameList();
savegame.Enabled=true;
guardar.Enabled=true;
cerrar.Enabled=true;
SetGameOption(OPT_WHENGUIDISABLED, 2);
}else {
gSavemsg.Visible=true;
savemsglbl.TextColor = 65296;
savemsglbl.Text = ("There is no game to load");
Wait(80);
gSavemsg.Visible=false; }
//Display("There is no game to load");
}
#sectionend restoregame_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart borrar_Click // DO NOT EDIT OR REMOVE THIS LINE
function borrar_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
if(partidas.ItemCount>=1){
int index = partidas.SelectedIndex;
DeleteSaveSlot(savegameindex[index]);
partidas.FillSaveGameList();
}
}
#sectionend borrar_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart cerrar_Click // DO NOT EDIT OR REMOVE THIS LINE
function cerrar_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
UnPauseGame();
gSaverestore.Visible=false;
guardar.Text="";
mouse.UseDefaultGraphic();
UnPauseAudio();
}
#sectionend cerrar_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart FlechaPartidasUP_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
function FlechaPartidasUP_btn_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
partidas.ScrollUp();
}
#sectionend FlechaPartidasUP_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart FlechaPartidasDOWN_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
function FlechaPartidasDOWN_btn_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
partidas.ScrollDown();
}
#sectionend FlechaPartidasDOWN_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart overwriteSI_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
function overwriteSI_btn_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
int p = 0;
while(p<=partidas.ItemCount){
if((partidas.ItemCount>p)&&(partidas.Items[p]==guardar.Text)){
UnPauseGame();
gOverwrite.Visible=false;
gSaverestore.Visible=false;
cerrar.Enabled=true;
SaveGameSlot(savegameindex[p], guardar.Text);
partidas.FillSaveGameList();
guardar.Text="";
gSavemsg.Visible=true;
savemsglbl.TextColor = 65296;
savemsglbl.Text = ("Game Overwritten");
Wait(80);
gSavemsg.Visible=false;
//Display("Game overwritten");
UnPauseAudio();
return;
}
p++;
}
}
#sectionend overwriteSI_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart overwriteNO_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
function overwriteNO_btn_Click(GUIControl *control, MouseButton button) {
aSound11.Play();
gOverwrite.Visible=false;
cerrar.Enabled=true;
}
#sectionend overwriteNO_btn_Click // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart gSavemsg_Click // DO NOT EDIT OR REMOVE THIS LINE
function gSavemsg_Click(GUIControl *control, MouseButton button) {
if (mouse.IsButtonDown(eMouseLeft)) {
gSavemsg.Visible=false; }
}
#sectionend gSavemsg_Click // DO NOT EDIT OR REMOVE THIS LINE
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.044 seconds with 14 queries.