|
@@ -59,3 +59,24 @@ behavior to quit when quit is requested, this can be changed:
|
|
|
.. code-tab:: csharp
|
|
|
|
|
|
GetTree().SetAutoAcceptQuit(false);
|
|
|
+
|
|
|
+Sending your own quit notification
|
|
|
+----------------------------------
|
|
|
+
|
|
|
+While forcing the application to close can be done by calling :ref:`SceneTree.quit <class_SceneTree_method_quit>`,
|
|
|
+doing so will not send the quit *notification*. This means the function
|
|
|
+described above won't be called. Quitting by calling
|
|
|
+:ref:`SceneTree.quit <class_SceneTree_method_quit>` will not allow custom actions
|
|
|
+to complete (such as saving, confirming the quit, or debugging), even if you try
|
|
|
+to delay the line that forces the quit.
|
|
|
+
|
|
|
+Instead, you should send a quit request:
|
|
|
+
|
|
|
+.. tabs::
|
|
|
+ .. code-tab:: gdscript GDScript
|
|
|
+
|
|
|
+ get_tree().notification(MainLoop.NOTIFICATION_WM_QUIT_REQUEST)
|
|
|
+
|
|
|
+ .. code-tab:: csharp
|
|
|
+
|
|
|
+ GetTree().Notification(MainLoop.NotificationWmQuitRequest)
|