mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-03-13 16:38:53 +01:00
Added NOTIFICATION_QUITTING to MainLoop.
This commit is contained in:
parent
b264a837a8
commit
c85768ae8a
@ -65,6 +65,7 @@ void MainLoop::_bind_methods() {
|
||||
BIND_CONSTANT(NOTIFICATION_OS_IME_UPDATE);
|
||||
BIND_CONSTANT(NOTIFICATION_APP_RESUMED);
|
||||
BIND_CONSTANT(NOTIFICATION_APP_PAUSED);
|
||||
BIND_CONSTANT(NOTIFICATION_QUITTING);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("on_request_permissions_result", PropertyInfo(Variant::STRING, "permission"), PropertyInfo(Variant::BOOL, "granted")));
|
||||
};
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
NOTIFICATION_OS_IME_UPDATE = 1013,
|
||||
NOTIFICATION_APP_RESUMED = 1014,
|
||||
NOTIFICATION_APP_PAUSED = 1015,
|
||||
NOTIFICATION_QUITTING = 1016,
|
||||
};
|
||||
|
||||
virtual void input_event(const Ref<InputEvent> &p_event);
|
||||
|
@ -879,6 +879,8 @@ void SceneTree::quit(int p_exit_code) {
|
||||
}
|
||||
|
||||
_quit = true;
|
||||
|
||||
notification(NOTIFICATION_QUITTING);
|
||||
}
|
||||
|
||||
void SceneTree::_notification(int p_notification) {
|
||||
@ -888,6 +890,7 @@ void SceneTree::_notification(int p_notification) {
|
||||
|
||||
if (accept_quit) {
|
||||
_quit = true;
|
||||
get_root()->propagate_notification(NOTIFICATION_QUITTING);
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
@ -897,6 +900,7 @@ void SceneTree::_notification(int p_notification) {
|
||||
|
||||
if (quit_on_go_back) {
|
||||
_quit = true;
|
||||
get_root()->propagate_notification(NOTIFICATION_QUITTING);
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
@ -948,7 +952,9 @@ void SceneTree::_notification(int p_notification) {
|
||||
case NOTIFICATION_CRASH: {
|
||||
get_root()->propagate_notification(p_notification);
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_QUITTING: {
|
||||
get_root()->propagate_notification(p_notification);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user