Fix non-tools builds.

This commit is contained in:
Relintai 2022-11-17 12:07:02 +01:00
parent 526800fcf9
commit 6ddd0c1fa3

View File

@ -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<Texture> 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);
}