Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: JQ on Wed 25/11/2009 19:39:56

Title: [SOLVED]Where is the "Exit Game" script located?
Post by: JQ on Wed 25/11/2009 19:39:56
I've been looking for the "QuitGame" script of the default game that comes with AGS ("¿Are you sure you want to quit? -Yes / No") in the global script and I can't find it. I'm translating the whole GUI and I'm only missing that one.

Thank you.
Title: Re: Where is the "Exit Game" script located?
Post by: Ryan Timothy B on Wed 25/11/2009 20:04:56
I believe I remember hearing that, that code is hard coded in AGS.  To translate it, you'll need to create your own "Are you sure you want to quit" GUI menu.  You'd have to call up the question GUI whenever the exit button is pressed (or whenever CTRL+Q is pressed)

if (keycode == eKeyCtrlQ) gExit_gui.visible=true;

Then when they click the yes button, have this:  QuitGame(0);

The Exit GUI should also pause the game when it's visible.

EDIT:  QuitGame(1);  -- Calls up the default quit menu.  and   QuitGame(0);   just quits the game without asking.
Title: Re: Where is the "Exit Game" script located?
Post by: arj0n on Wed 25/11/2009 20:07:35
This is the original part if I'm right:

function btnQuit_OnClick(GUIControl *control, MouseButton button)
{
 gPanel.Visible = false;
 Wait(1);
 QuitGame(1);
 gPanel.Visible = true;
 gIconbar.Visible = false;
 mouse.UseModeGraphic(eModePointer);
}
Title: Re: Where is the "Exit Game" script located?
Post by: JQ on Wed 25/11/2009 22:06:35
I did whay you said about creating a new Gui panel, it works great, thank you