From 65346459d39f02a021a403ff2b3f3d9a770cdee8 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 8 Nov 2023 14:02:08 +0100 Subject: [PATCH] Fix: Task scripts with global class and without icon get wrong theme icon shown --- util/limbo_utility.cpp | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/util/limbo_utility.cpp b/util/limbo_utility.cpp index bf819be..49e8d00 100644 --- a/util/limbo_utility.cpp +++ b/util/limbo_utility.cpp @@ -13,6 +13,7 @@ #include "modules/limboai/bt/tasks/bt_task.h" +#include "core/error/error_macros.h" #include "core/object/script_language.h" #include "core/variant/variant.h" #include "scene/resources/texture.h" @@ -55,26 +56,41 @@ Ref LimboUtility::get_task_icon(String p_class_or_script_path) const #ifdef TOOLS_ENABLED ERR_FAIL_COND_V_MSG(p_class_or_script_path.is_empty(), Variant(), "BTTask: script path or class cannot be empty."); + Ref theme = EditorNode::get_singleton()->get_editor_theme(); + ERR_FAIL_COND_V(theme.is_null(), nullptr); + if (p_class_or_script_path.begins_with("res:")) { Ref