diff options
Diffstat (limited to 'editor/inspector_dock.cpp')
-rw-r--r-- | editor/inspector_dock.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index ce4e51e54c..e36c86fb10 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -33,6 +33,8 @@ #include "editor/editor_scale.h" #include "editor/plugins/animation_player_editor_plugin.h" +InspectorDock *InspectorDock::singleton = nullptr; + void InspectorDock::_menu_option(int p_option) { _menu_option_confirm(p_option, false); } @@ -108,7 +110,7 @@ void InspectorDock::_menu_option_confirm(int p_option, bool p_confirmed) { Variant v = current->get(E->get().name); REF ref = v; RES res = ref; - if (v.is_ref() && ref.is_valid() && res.is_valid()) { + if (v.is_ref_counted() && ref.is_valid() && res.is_valid()) { // Valid resource which would be duplicated if action is confirmed. resource_propnames.append(E->get().name); } @@ -145,7 +147,7 @@ void InspectorDock::_menu_option_confirm(int p_option, bool p_confirmed) { } Variant v = current->get(prop_info.name); - if (v.is_ref()) { + if (v.is_ref_counted()) { REF ref = v; if (ref.is_valid()) { RES res = ref; @@ -156,7 +158,7 @@ void InspectorDock::_menu_option_confirm(int p_option, bool p_confirmed) { res = duplicates[res]; current->set(prop_info.name, res); - editor->get_inspector()->update_property(prop_info.name); + get_inspector_singleton()->update_property(prop_info.name); } } } @@ -531,6 +533,7 @@ void InspectorDock::go_back() { } InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { + singleton = this; set_name("Inspector"); editor = p_editor; @@ -686,4 +689,5 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { } InspectorDock::~InspectorDock() { + singleton = nullptr; } |