From d2b4e300585ebd3fa1f284315fd012f2f74a0e8e Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Mon, 19 Sep 2022 17:39:35 +0100 Subject: Change `_can_handle` and `_edit` virtual methods to take `Object*` --- editor/editor_inspector.h | 2 +- editor/editor_plugin.cpp | 6 +----- editor/editor_plugin.h | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'editor') diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 37ff2e9b52..9a07413943 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -223,7 +223,7 @@ public: protected: static void _bind_methods(); - GDVIRTUAL1RC(bool, _can_handle, Variant) + GDVIRTUAL1RC(bool, _can_handle, Object *) GDVIRTUAL1(_parse_begin, Object *) GDVIRTUAL2(_parse_category, Object *, String) GDVIRTUAL2(_parse_group, Object *, String) diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 14cdbc364e..7b01ae69bf 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -662,11 +662,7 @@ void EditorPlugin::make_visible(bool p_visible) { } void EditorPlugin::edit(Object *p_object) { - if (Object::cast_to(p_object)) { - GDVIRTUAL_CALL(_edit, Ref(Object::cast_to(p_object))); - } else { - GDVIRTUAL_CALL(_edit, p_object); - } + GDVIRTUAL_CALL(_edit, p_object); } bool EditorPlugin::handles(Object *p_object) const { diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index a5a17acdf1..74f46b2d0b 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -164,8 +164,8 @@ protected: GDVIRTUAL0RC(Ref, _get_plugin_icon) GDVIRTUAL0RC(bool, _has_main_screen) GDVIRTUAL1(_make_visible, bool) - GDVIRTUAL1(_edit, Variant) - GDVIRTUAL1RC(bool, _handles, Variant) + GDVIRTUAL1(_edit, Object *) + GDVIRTUAL1RC(bool, _handles, Object *) GDVIRTUAL0RC(Dictionary, _get_state) GDVIRTUAL1(_set_state, Dictionary) GDVIRTUAL0(_clear) -- cgit v1.2.3