From 6ddd0c1fa3d1e25be6ef16af1fafe880b5ff6f27 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 17 Nov 2022 12:07:02 +0100 Subject: [PATCH] Fix non-tools builds. --- .../paint_tools_property_inspector.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/paint/ui/property_inspectors/paint_tools_property_inspector.cpp b/modules/paint/ui/property_inspectors/paint_tools_property_inspector.cpp index 5a7e85e0f..22e7b433f 100644 --- a/modules/paint/ui/property_inspectors/paint_tools_property_inspector.cpp +++ b/modules/paint/ui/property_inspectors/paint_tools_property_inspector.cpp @@ -22,7 +22,6 @@ SOFTWARE. #include "paint_tools_property_inspector.h" -#include "editor/editor_node.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/flow_container.h" @@ -33,14 +32,22 @@ SOFTWARE. #include "../../nodes/paint_node.h" #include "../../nodes/paint_project.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_node.h" +#include "core/config/engine.h" +#endif + void PaintToolsPropertyInspector::add_button(int id, const String &hint, const String &icon, const String &theme_type) { Button *button = memnew(Button); Ref icon_tex; - if (EditorNode::get_singleton()) { +#ifdef TOOLS_ENABLED + if (EditorNode::get_singleton() && Engine::get_singleton()->is_editor_hint()) { icon_tex = EditorNode::get_singleton()->get_gui_base()->get_theme_icon(icon, theme_type); - } else { + } else +#endif + { icon_tex = get_theme_icon(icon, theme_type); }