Merge pull request #67024 from alessandrofama/fix-gdvirtual-call-node3dgizmo

EditorNode3DGizmoPlugin: Add GDVIRTUAL_CALL for get_gizmo_name and get_priority
This commit is contained in:
Rémi Verschelde 2022-12-15 12:16:42 +01:00
commit cda7df0255
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 6 additions and 4 deletions

View File

@ -1016,8 +1016,9 @@ Ref<StandardMaterial3D> EditorNode3DGizmoPlugin::get_material(const String &p_na
} }
String EditorNode3DGizmoPlugin::get_gizmo_name() const { String EditorNode3DGizmoPlugin::get_gizmo_name() const {
if (get_script_instance() && get_script_instance()->has_method("_get_gizmo_name")) { String ret;
return get_script_instance()->call("_get_gizmo_name"); 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."); 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 { int EditorNode3DGizmoPlugin::get_priority() const {
if (get_script_instance() && get_script_instance()->has_method("_get_priority")) { int ret;
return get_script_instance()->call("_get_priority"); if (GDVIRTUAL_CALL(_get_priority, ret)) {
return ret;
} }
return 0; return 0;
} }