summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-09-14 17:24:04 +0200
committerGitHub <noreply@github.com>2018-09-14 17:24:04 +0200
commit5961a6da03e70dbfa811c30c4ec684d3a7746bf6 (patch)
tree8c5eb977e7a417f978e1ef39b9f3cacd4397e799 /modules
parent2aad7f1376897a6cb57471d03169507fac178b42 (diff)
parent5436abefe4f40eb84f96c36ae372df39ec4295d7 (diff)
Merge pull request #21717 from willnationsdev/edicon-refactor
Refactor editor icon retrieval
Diffstat (limited to 'modules')
-rw-r--r--modules/visual_script/visual_script_property_selector.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp
index 39997d14c4..9942d5baa6 100644
--- a/modules/visual_script/visual_script_property_selector.cpp
+++ b/modules/visual_script/visual_script_property_selector.cpp
@@ -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);