Godot Version
v4.2.1.stable.arch_linux
Question
I am attempting to do clean-up before my application is closed by the user.
Currently I have a singleton autoload node for handling the application clean-up before closing. It sets auto_accept_quit to false in its _ready function. This allows me to catch NOTIFICATION_WM_CLOSE_REQUEST in its _notification override. I would like to propagate a custom notification from this node such as NOTIFICATION_WM_CLOSE_ACCEPTED. This way other nodes in the tree could perform their clean-up if they receive this custom notification. After the custom notification is propagated I can then quit the application.
My concern with this approach is that I am unsure of what range of values Godot provides for user defined notifications (if any).
My questions are:
Is it within Godot’s defined behavior to propagate custom notifications?
If yes, then does Godot have a reserved range I can use that guarantees the value I choose will not be overridden later?
If not, then would you please provide suggestions/examples on how I could run clean-up code before the application is confirmed to close?