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:
...
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?
Maybe the OnClick event in the GUI properties is empty or pointing wrong?
Nope, tried renaming it, deleting the original function, etc. :/
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?
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):
function btnIconExit_Click(GUIControl *control, MouseButton button) {
QuitGame(1); // Will bring up the Quit Yes/No.
QuitGame(0); // Will quit immediately.
}