summaryrefslogtreecommitdiffstats
path: root/editor/property_editor.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-15 15:16:29 +0200
committerGitHub <noreply@github.com>2018-08-15 15:16:29 +0200
commit040c6be426ea915a70eb7ded687c7618c33ad3ff (patch)
treed390ce325032a57568dc8d8730748602c9b9c812 /editor/property_editor.cpp
parent140b6db219c8b123ad3d5727df7f781f035fb399 (diff)
parent6d9cc032e71ccc768064bf908623b0954d01181c (diff)
downloadredot-engine-040c6be426ea915a70eb7ded687c7618c33ad3ff.tar.gz
Merge pull request #20560 from willnationsdev/class_icons
Add custom icons to script classes.
Diffstat (limited to 'editor/property_editor.cpp')
-rw-r--r--editor/property_editor.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index b370a711e3..408e67149a 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -287,7 +287,11 @@ void CustomPropertyEditor::_menu_option(int p_which) {
Object *obj = ClassDB::instance(intype);
if (!obj) {
- obj = EditorNode::get_editor_data().instance_custom_type(intype, "Resource");
+ if (ScriptServer::is_global_class(intype)) {
+ obj = EditorNode::get_editor_data().script_class_instance(intype);
+ } else {
+ obj = EditorNode::get_editor_data().instance_custom_type(intype, "Resource");
+ }
}
ERR_BREAK(!obj);
@@ -1132,7 +1136,11 @@ void CustomPropertyEditor::_type_create_selected(int p_idx) {
Object *obj = ClassDB::instance(intype);
if (!obj) {
- obj = EditorNode::get_editor_data().instance_custom_type(intype, "Resource");
+ if (ScriptServer::is_global_class(intype)) {
+ obj = EditorNode::get_editor_data().script_class_instance(intype);
+ } else {
+ obj = EditorNode::get_editor_data().instance_custom_type(intype, "Resource");
+ }
}
ERR_FAIL_COND(!obj);
@@ -1334,7 +1342,11 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
Object *obj = ClassDB::instance(intype);
if (!obj) {
- obj = EditorNode::get_editor_data().instance_custom_type(intype, "Resource");
+ if (ScriptServer::is_global_class(intype)) {
+ obj = EditorNode::get_editor_data().script_class_instance(intype);
+ } else {
+ obj = EditorNode::get_editor_data().instance_custom_type(intype, "Resource");
+ }
}
ERR_BREAK(!obj);