Game Development Community

the dangerous 'X' close button!

by Rex Hiebert · in Torque 3D Professional · 03/18/2010 (7:51 am) · 0 replies

When the user clicks on the window close 'X' (in windowed mode), the application closes. That can be a problem. If a developer has unsaved work, they loose it. If the end user meant to just move or maximize the window then they will be greatly frustrated that they have lost any progress made in the game.

I see the "onExit" events in the TS but they don't seem to fire when the 'X' is clicked or at any other time. Does this mean that some of the cleanup code is not being executed as well? Can we get some events that will fire to give the user a chance to cancel the close?

EDIT: Correction- it does fire the onExit events but does not allow you to open a yes/no message box or cancel the close in any way.