mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Add custom icons to script classes.
This commit is contained in:
parent
b4f579b5ba
commit
6d9cc032e7
12 changed files with 165 additions and 38 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue