Author Topic: Confirmation dialog "quit game" problem  (Read 444 times)

Confirmation dialog "quit game" problem
« on: 19 Oct 2018, 14:45 »
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: Adventure Game Studio
  1. function Button3_OnClick(GUIControl *control, MouseButton button)
  2. {
  3. QuitGame(0);
  4. }

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: Adventure Game Studio
  1. function Button3_OnClick(GUIControl *control, MouseButton button)
  2. {
  3. QuitGame(1);
  4. }

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 :)

VampireWombat

  • Not a chupacabra
    • I can help with animation
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
Re: Confirmation dialog "quit game" problem
« Reply #1 on: 19 Oct 2018, 15:07 »
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.
« Last Edit: 19 Oct 2018, 15:12 by VampireWombat »

Re: Confirmation dialog "quit game" problem
« Reply #2 on: 19 Oct 2018, 16:15 »
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 ?
« Last Edit: 19 Oct 2018, 16:18 by Cookie_Wood »

VampireWombat

  • Not a chupacabra
    • I can help with animation
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
Re: Confirmation dialog "quit game" problem
« Reply #3 on: 19 Oct 2018, 16:23 »
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.

Re: Confirmation dialog "quit game" problem
« Reply #4 on: 19 Oct 2018, 17:19 »
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

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Confirmation dialog "quit game" problem
« Reply #5 on: 22 Oct 2018, 14:08 »
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)