diff options
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/timer.cpp | 24 | ||||
-rw-r--r-- | scene/main/timer.h | 10 | ||||
-rw-r--r-- | scene/main/window.cpp | 4 |
3 files changed, 19 insertions, 19 deletions
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 3661b6c394..4bc159f6aa 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -46,7 +46,7 @@ void Timer::_notification(int p_what) { } } break; case NOTIFICATION_INTERNAL_PROCESS: { - if (!processing || timer_process_mode == TIMER_PROCESS_PHYSICS || !is_processing_internal()) { + if (!processing || timer_process_callback == TIMER_PROCESS_PHYSICS || !is_processing_internal()) { return; } time_left -= get_process_delta_time(); @@ -63,7 +63,7 @@ void Timer::_notification(int p_what) { } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { - if (!processing || timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal()) { + if (!processing || timer_process_callback == TIMER_PROCESS_IDLE || !is_physics_processing_internal()) { return; } time_left -= get_physics_process_delta_time(); @@ -143,12 +143,12 @@ float Timer::get_time_left() const { return time_left > 0 ? time_left : 0; } -void Timer::set_timer_process_mode(TimerProcessMode p_mode) { - if (timer_process_mode == p_mode) { +void Timer::set_timer_process_callback(TimerProcessCallback p_callback) { + if (timer_process_callback == p_callback) { return; } - switch (timer_process_mode) { + switch (timer_process_callback) { case TIMER_PROCESS_PHYSICS: if (is_physics_processing_internal()) { set_physics_process_internal(false); @@ -162,15 +162,15 @@ void Timer::set_timer_process_mode(TimerProcessMode p_mode) { } break; } - timer_process_mode = p_mode; + timer_process_callback = p_callback; } -Timer::TimerProcessMode Timer::get_timer_process_mode() const { - return timer_process_mode; +Timer::TimerProcessCallback Timer::get_timer_process_callback() const { + return timer_process_callback; } void Timer::_set_process(bool p_process, bool p_force) { - switch (timer_process_mode) { + switch (timer_process_callback) { case TIMER_PROCESS_PHYSICS: set_physics_process_internal(p_process && !paused); break; @@ -201,12 +201,12 @@ void Timer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_time_left"), &Timer::get_time_left); - ClassDB::bind_method(D_METHOD("set_timer_process_mode", "mode"), &Timer::set_timer_process_mode); - ClassDB::bind_method(D_METHOD("get_timer_process_mode"), &Timer::get_timer_process_mode); + ClassDB::bind_method(D_METHOD("set_timer_process_callback", "callback"), &Timer::set_timer_process_callback); + ClassDB::bind_method(D_METHOD("get_timer_process_callback"), &Timer::get_timer_process_callback); ADD_SIGNAL(MethodInfo("timeout")); - ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_timer_process_mode", "get_timer_process_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_timer_process_callback", "get_timer_process_callback"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.001,4096,0.001,or_greater"), "set_wait_time", "get_wait_time"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart"); diff --git a/scene/main/timer.h b/scene/main/timer.h index 672290cf50..3d9e21d7fc 100644 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -49,7 +49,7 @@ protected: static void _bind_methods(); public: - enum TimerProcessMode { + enum TimerProcessCallback { TIMER_PROCESS_PHYSICS, TIMER_PROCESS_IDLE, }; @@ -73,15 +73,15 @@ public: float get_time_left() const; - void set_timer_process_mode(TimerProcessMode p_mode); - TimerProcessMode get_timer_process_mode() const; + void set_timer_process_callback(TimerProcessCallback p_callback); + TimerProcessCallback get_timer_process_callback() const; Timer(); private: - TimerProcessMode timer_process_mode = TIMER_PROCESS_IDLE; + TimerProcessCallback timer_process_callback = TIMER_PROCESS_IDLE; void _set_process(bool p_process, bool p_force = false); }; -VARIANT_ENUM_CAST(Timer::TimerProcessMode); +VARIANT_ENUM_CAST(Timer::TimerProcessCallback); #endif // TIMER_H diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 9a2ffab199..8198fa41c5 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1345,8 +1345,8 @@ void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("has_focus"), &Window::has_focus); ClassDB::bind_method(D_METHOD("grab_focus"), &Window::grab_focus); - ClassDB::bind_method(D_METHOD("set_ime_active"), &Window::set_ime_active); - ClassDB::bind_method(D_METHOD("set_ime_position"), &Window::set_ime_position); + ClassDB::bind_method(D_METHOD("set_ime_active", "active"), &Window::set_ime_active); + ClassDB::bind_method(D_METHOD("set_ime_position", "position"), &Window::set_ime_position); ClassDB::bind_method(D_METHOD("is_embedded"), &Window::is_embedded); |