Make custom types more subtle and more useful

Implements #6067 (aaronfranke's idea)
Fixes #26980
This commit is contained in:
Bojidar Marinov
2019-07-19 22:21:30 +03:00
parent 22c843b0c4
commit 4f72178868
6 changed files with 104 additions and 31 deletions

View File

@@ -499,7 +499,6 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i
for (int i = 0; i < get_custom_types()[p_inherits].size(); i++) {
if (get_custom_types()[p_inherits][i].name == p_type) {
Ref<Texture> icon = get_custom_types()[p_inherits][i].icon;
Ref<Script> script = get_custom_types()[p_inherits][i].script;
Object *ob = ClassDB::instance(p_inherits);
@@ -508,8 +507,6 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i
ob->call("set_name", p_type);
}
ob->set_script(script.get_ref_ptr());
if (icon.is_valid())
ob->set_meta("_editor_icon", icon);
return ob;
}
}