mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Refactor editor icon retrieval
This commit is contained in:
parent
06c8b5a4ff
commit
5436abefe4
29 changed files with 192 additions and 252 deletions
|
|
@ -109,11 +109,7 @@ void EditorPropertyRootMotion::_node_assign() {
|
|||
|
||||
if (base->has_node(accum)) {
|
||||
Node *node = base->get_node(accum);
|
||||
if (has_icon(node->get_class(), "EditorIcons")) {
|
||||
ti->set_icon(0, get_icon(node->get_class(), "EditorIcons"));
|
||||
} else {
|
||||
ti->set_icon(0, get_icon("Node", "EditorIcons"));
|
||||
}
|
||||
ti->set_icon(0, EditorNode::get_singleton()->get_object_icon(node, "Node"));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -235,14 +231,7 @@ void EditorPropertyRootMotion::update_property() {
|
|||
ERR_FAIL_COND(!target_node);
|
||||
|
||||
assign->set_text(target_node->get_name());
|
||||
|
||||
Ref<Texture> icon;
|
||||
if (has_icon(target_node->get_class(), "EditorIcons"))
|
||||
icon = get_icon(target_node->get_class(), "EditorIcons");
|
||||
else
|
||||
icon = get_icon("Node", "EditorIcons");
|
||||
|
||||
assign->set_icon(icon);
|
||||
assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
|
||||
}
|
||||
|
||||
void EditorPropertyRootMotion::setup(const NodePath &p_base_hint) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue