diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-15 12:16:42 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-15 12:16:42 +0100 |
commit | cda7df0255b56da5d37b4021582cfe901be2a06e (patch) | |
tree | ce2d48cb23c4d8e93325c8f15de070d15e944c3b /editor | |
parent | bc9afb8d47ac16c65a47f4281a10aec23d4273a9 (diff) | |
parent | 17d1555127d096307602b81b21408d2f29c8bdde (diff) |
Merge pull request #67024 from alessandrofama/fix-gdvirtual-call-node3dgizmo
EditorNode3DGizmoPlugin: Add GDVIRTUAL_CALL for get_gizmo_name and get_priority
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/node_3d_editor_gizmos.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp index c8b80db334..91c7fbc06a 100644 --- a/editor/plugins/node_3d_editor_gizmos.cpp +++ b/editor/plugins/node_3d_editor_gizmos.cpp @@ -1016,8 +1016,9 @@ Ref<StandardMaterial3D> EditorNode3DGizmoPlugin::get_material(const String &p_na } String EditorNode3DGizmoPlugin::get_gizmo_name() const { - if (get_script_instance() && get_script_instance()->has_method("_get_gizmo_name")) { - return get_script_instance()->call("_get_gizmo_name"); + String ret; + if (GDVIRTUAL_CALL(_get_gizmo_name, ret)) { + return ret; } WARN_PRINT_ONCE("A 3D editor gizmo has no name defined (it will appear as \"Unnamed Gizmo\" in the \"View > Gizmos\" menu). To resolve this, override the `_get_gizmo_name()` function to return a String in the script that extends EditorNode3DGizmoPlugin."); @@ -1025,8 +1026,9 @@ String EditorNode3DGizmoPlugin::get_gizmo_name() const { } int EditorNode3DGizmoPlugin::get_priority() const { - if (get_script_instance() && get_script_instance()->has_method("_get_priority")) { - return get_script_instance()->call("_get_priority"); + int ret; + if (GDVIRTUAL_CALL(_get_priority, ret)) { + return ret; } return 0; } |