From 97e77688bb97e5930525ba14c884c3a9e6fc73d5 Mon Sep 17 00:00:00 2001 From: MrCdK Date: Sun, 25 Feb 2018 01:41:26 +0100 Subject: Now the inspector will show the custom resources added via plugin --- editor/editor_data.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'editor/editor_data.cpp') diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 95ed40d88..ef9265ecd 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -452,6 +452,31 @@ void EditorData::add_custom_type(const String &p_type, const String &p_inherits, custom_types[p_inherits].push_back(ct); } +Object *EditorData::instance_custom_type(const String &p_type, const String &p_inherits) { + + if (get_custom_types().has(p_inherits)) { + + for (int i = 0; i < get_custom_types()[p_inherits].size(); i++) { + if (get_custom_types()[p_inherits][i].name == p_type) { + Ref icon = get_custom_types()[p_inherits][i].icon; + Ref