- _ready() callback only happens once now, if you want to receive it again, use request_ready()

- C++ Nodes mostly do an internal process callback, so it does not conflict with users willing to use their own process callbacks
- callbacks such as _input, _process, _fixed_process _unhandled_input, _unhandled_key_input do not requiere calling a function to enable them. They are enabled automatically if found on the script.
This commit is contained in:
Juan Linietsky
2017-01-10 18:02:19 -03:00
parent 6eeb994a7b
commit f3f4a11cfb
15 changed files with 170 additions and 60 deletions

View File

@@ -45,8 +45,8 @@ void Timer::_notification(int p_what) {
autostart=false;
}
} break;
case NOTIFICATION_PROCESS: {
if (timer_process_mode == TIMER_PROCESS_FIXED || !is_processing())
case NOTIFICATION_INTERNAL_PROCESS: {
if (timer_process_mode == TIMER_PROCESS_FIXED || !is_processing_internal())
return;
time_left -= get_process_delta_time();
@@ -61,8 +61,8 @@ void Timer::_notification(int p_what) {
}
} break;
case NOTIFICATION_FIXED_PROCESS: {
if (timer_process_mode == TIMER_PROCESS_IDLE || !is_fixed_processing())
case NOTIFICATION_INTERNAL_FIXED_PROCESS: {
if (timer_process_mode == TIMER_PROCESS_IDLE || !is_fixed_processing_internal())
return;
time_left -= get_fixed_process_delta_time();
@@ -147,15 +147,15 @@ void Timer::set_timer_process_mode(TimerProcessMode p_mode) {
switch (timer_process_mode) {
case TIMER_PROCESS_FIXED:
if (is_fixed_processing()) {
set_fixed_process(false);
set_process(true);
if (is_fixed_processing_internal()) {
set_fixed_process_internal(false);
set_process_internal(true);
}
break;
case TIMER_PROCESS_IDLE:
if (is_processing()) {
set_process(false);
set_fixed_process(true);
if (is_processing_internal()) {
set_process_internal(false);
set_fixed_process_internal(true);
}
break;
}
@@ -171,8 +171,8 @@ Timer::TimerProcessMode Timer::get_timer_process_mode() const{
void Timer::_set_process(bool p_process, bool p_force)
{
switch (timer_process_mode) {
case TIMER_PROCESS_FIXED: set_fixed_process(p_process && active); break;
case TIMER_PROCESS_IDLE: set_process(p_process && active); break;
case TIMER_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break;
case TIMER_PROCESS_IDLE: set_process_internal(p_process && active); break;
}
processing = p_process;
}