I cannot exit the game clicking the exit icon - why?

Started by bx83, Mon 05/06/2017 13:43:13

Previous topic - Next topic

bx83

Hi,

I have a GUI with the icon bar in it; the bExit button runs a script, which, from the other buttons, I assume is bExit_Click:

Code: ags

...
function btnIconSave_Click(GUIControl *control, MouseButton button) 
{
  show_save_game_dialog();
}

function btnIconLoad_Click(GUIControl *control, MouseButton button) 
{
  show_restore_game_dialog();
}

function bExit_Click(GUIControl *control, MouseButton button)
{
  QuitGame(1);
}
...


This is all in globalscript.

This is the *only* button that doesn't work - clicking it just make the iconbar invisible.
All other *exactly the same buttons* work.

I've tried using breakpoints next to the 'QuitGame(1)', and it never reaches it.

What do I do?


arj0n

Maybe the OnClick event in the GUI properties is empty or pointing wrong?

bx83

Nope, tried renaming it, deleting the original function, etc. :/

Mandle

Perhaps check through all the properties of the button? Is it set as "unclickable" or is it's Z-order hiding it behind another control? I don't remember off the top of my head all the properties, but maybe there's a conflict in there?

Slasher

If you are using the default IconBar then the Exit button is named btnIconExit.

The properties for this button should be: RunScript..

Click it's Events button and add (if not already):

Code: ags

function btnIconExit_Click(GUIControl *control, MouseButton button) {
 QuitGame(1); // Will bring up the Quit Yes/No.
 QuitGame(0); // Will quit immediately.
}





SMF spam blocked by CleanTalk