Suggestion: Close window

Started by tiagocorreia, Thu 13/07/2006 14:01:17

Previous topic - Next topic

tiagocorreia

Can it be possible to have an event that it is triggered when the Close button of the game window is pressed? It would be nice to control the way it quits the game. So it could ask before it simple closes.

strazer

#1
Already on the tracker: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=552

Edit:

Hm, but even with the suggestion in the tracker entry there would still be no way to abort the quitting. I'm not sure how it could be handled best. Let's see what CJ thinks.

Pumaman

The question is whether the "X" button should act like Alt+X or Ctrl+Q -- ie. whether it aborts the game or quits nicely. At the moment it effectively does an Alt+X, but perhaps it should just fire some sort of in-game event; I'm not really sure.

monkey0506

I think pressing the 'X' button should react like Alt+X does by default without generating the "abort key pressed" error (basically the way it works now).

However, I think there should still be some script capture technique so things like DynamicSprites can be taken care of first...(i.e., eEventQuitGame :D).

And actually...in retrospect, a function like:

Code: ags
#sectionstart game_end  // DO NOT EDIT OR REMOVE THIS LINE
function game_end() {
}
#sectionend game_end  // DO NOT EDIT OR REMOVE THIS LINE


Would be more compliant with the way AGS currently handles the game starting (game_start).

tiagocorreia

Waht I thought would be nice, is to have a way of preventing the user to close the window. It would should a GUI, and after showing, the user could choose to quit or not. As most applications do.

GarageGothic

Why not just add an event for clicking X/pressing Alt+F4 and then let people do whatever they feel like within that function? If they want to open a GUI, fine (though I personally dislike games that don't quit instantly when Alt+F4 is pressed) - if they just want to run clean-up functions such as deleting DynamicSprites or saving data to an external file, let them do so.

Radiant

Quote from: tiagocorreia on Fri 14/07/2006 09:59:58
Waht I thought would be nice, is to have a way of preventing the user to close the window. It would should a GUI, and after showing, the user could choose to quit or not. As most applications do.

I disagree that this would be nice. If I click on a window's X, I expect it to close. A 'do you want to save before you quit' dialog might be acceptable, but preventing the user to close the window would not be.

Gilbert

I too disagree, that's what the X button's for.
If you don't like them to click that, just try to force the players to run their games at Full Screen (i.e. don't let them mess with the config files).

tiagocorreia

When i mean prevent user to close the appication, I mean by acident. The game I developing is for children, and some of them might do this.
I know I could force fullscreen, but in some computers, but very strange reason, in fullscreen the screen remains black. Also if the child use an input like Volito2 or Graphire, if fullscreen these devices don't work correctly.

SMF spam blocked by CleanTalk