mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Refactor editor icon retrieval
This commit is contained in:
parent
06c8b5a4ff
commit
5436abefe4
29 changed files with 192 additions and 252 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "visual_script_property_selector.h"
|
||||
|
||||
#include "core/os/keyboard.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor_scale.h"
|
||||
#include "modules/visual_script/visual_script.h"
|
||||
#include "modules/visual_script/visual_script_builtin_funcs.h"
|
||||
|
@ -176,10 +177,8 @@ void VisualScriptPropertySelector::_update_search() {
|
|||
Ref<Texture> icon;
|
||||
if (E->get().name == "Script Variables") {
|
||||
icon = get_icon("Script", "EditorIcons");
|
||||
} else if (has_icon(E->get().name, "EditorIcons")) {
|
||||
icon = get_icon(E->get().name, "EditorIcons");
|
||||
} else {
|
||||
icon = get_icon("Object", "EditorIcons");
|
||||
icon = EditorNode::get_singleton()->get_class_icon(E->get().name);
|
||||
}
|
||||
category->set_icon(0, icon);
|
||||
continue;
|
||||
|
@ -289,10 +288,8 @@ void VisualScriptPropertySelector::_update_search() {
|
|||
if (E->get().name == "*Script Methods") {
|
||||
icon = get_icon("Script", "EditorIcons");
|
||||
script_methods = true;
|
||||
} else if (has_icon(rep, "EditorIcons")) {
|
||||
icon = get_icon(rep, "EditorIcons");
|
||||
} else {
|
||||
icon = get_icon("Object", "EditorIcons");
|
||||
icon = EditorNode::get_singleton()->get_class_icon(rep);
|
||||
}
|
||||
category->set_icon(0, icon);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue