Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Cookie_Wood on Fri 19/10/2018 14:45:59

Title: Confirmation dialog "quit game" problem
Post by: Cookie_Wood on Fri 19/10/2018 14:45:59
Hi folks !

First of all, I apologize if I don't make myself totally clear. English is not my mother tongue.

I'm working on my very first game on AGS, so I'm what we might called "a big newbie". I'm using the LW BASS template which is great ! I only have one big problem with it that i'm not able to solved by myself...

I created some GUI's (save, load, pause etc...) on which there's some buttons including a "Quit Button".

When I script like this :

Code (ags) Select
function Button3_OnClick(GUIControl *control, MouseButton button)
{
QuitGame(0);
}


The game is just quitting without any confirmation dialog (Are you sure you want to quit? Yes, No")

Which is totally normal BUT, when I script like this :
Code (ags) Select
function Button3_OnClick(GUIControl *control, MouseButton button)
{
QuitGame(1);
}


There's a very ugly grey "by default" confirmation dialog that open and I really can't find anywhere on my project tree where I can custom that with my own background image and button...etc... Is that "hard-coded" or somethhing like this ?

Where can I set that default confirmation dialog ? Because I really don't want the game to close directly even if this would be solving my problem^^

Thanks :)
Title: Re: Confirmation dialog "quit game" problem
Post by: VampireWombat on Fri 19/10/2018 15:07:34
The "ugly gray" is hard coded in. As well as the default save and restore GUIs.

What you need to do is create a new Gui with 2 buttons. One to confirm quit and the other to cancel. Use QuitGame(0); for the confirm button and gQuit.visible=false (or whatever you name the gui) for the cancel. After that you can customize it however you want.
Title: Re: Confirmation dialog "quit game" problem
Post by: Cookie_Wood on Fri 19/10/2018 16:15:08
Hi VampireWombat :)

Thank you for your quick answer !

Actually, I did create my own "gConfirm" GUI with buttons, but they are both displaying at the same time when I try to Quit ! Mine and the hardcoded one... I just want mine to be displayed :'(
What I am missing ?
Title: Re: Confirmation dialog "quit game" problem
Post by: VampireWombat on Fri 19/10/2018 16:23:42
Sounds like you have QuitGame(1); in your code somewhere. Remove that and make sure that QuitGame(0); is only used when pushing the confirm button on your GUI.
Title: Re: Confirmation dialog "quit game" problem
Post by: Cookie_Wood on Fri 19/10/2018 17:19:51
Ok, thank you so much. :grin:

That was very dumb...I found out where was my problem.

Sorry for the disturbance, I will think a little bit more before asking something here... :-D
Title: Re: Confirmation dialog "quit game" problem
Post by: Monsieur OUXX on Mon 22/10/2018 14:08:54
We should really improve all the templates (BASS, etc.) to include custom, clean confirmation GUIs and fonts by default. The hard-coded stuff must go! (roll) (that's just my opinion)