Fix virtual calls for GDExtension in `CollisionObject2D` for _mouse_enter, _mouse_exit, _mouse_shape_enter, _mouse_shape_exit

(cherry picked from commit 0517000e6f)
This commit is contained in:
Nikolai Davydov 2024-01-07 05:30:26 +01:00 committed by Rémi Verschelde
parent 17b1fd94af
commit 18d497d744
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 4 additions and 12 deletions

View File

@ -518,30 +518,22 @@ void CollisionObject2D::_input_event_call(Viewport *p_viewport, const Ref<InputE
} }
void CollisionObject2D::_mouse_enter() { void CollisionObject2D::_mouse_enter() {
if (get_script_instance()) { GDVIRTUAL_CALL(_mouse_enter);
get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_enter);
}
emit_signal(SceneStringNames::get_singleton()->mouse_entered); emit_signal(SceneStringNames::get_singleton()->mouse_entered);
} }
void CollisionObject2D::_mouse_exit() { void CollisionObject2D::_mouse_exit() {
if (get_script_instance()) { GDVIRTUAL_CALL(_mouse_exit);
get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_exit);
}
emit_signal(SceneStringNames::get_singleton()->mouse_exited); emit_signal(SceneStringNames::get_singleton()->mouse_exited);
} }
void CollisionObject2D::_mouse_shape_enter(int p_shape) { void CollisionObject2D::_mouse_shape_enter(int p_shape) {
if (get_script_instance()) { GDVIRTUAL_CALL(_mouse_shape_enter, p_shape);
get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_shape_enter, p_shape);
}
emit_signal(SceneStringNames::get_singleton()->mouse_shape_entered, p_shape); emit_signal(SceneStringNames::get_singleton()->mouse_shape_entered, p_shape);
} }
void CollisionObject2D::_mouse_shape_exit(int p_shape) { void CollisionObject2D::_mouse_shape_exit(int p_shape) {
if (get_script_instance()) { GDVIRTUAL_CALL(_mouse_shape_exit, p_shape);
get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_shape_exit, p_shape);
}
emit_signal(SceneStringNames::get_singleton()->mouse_shape_exited, p_shape); emit_signal(SceneStringNames::get_singleton()->mouse_shape_exited, p_shape);
} }