From 52f218e6b9bf6243559604085e827484dc61797e Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 11 Jan 2024 11:22:02 +0100 Subject: [PATCH] Don't compile editor classes into template builds --- editor/action_banner.cpp | 4 ++++ editor/action_banner.h | 6 +++++- editor/debugger/behavior_tree_view.cpp | 2 +- editor/debugger/behavior_tree_view.h | 4 ++-- editor/debugger/limbo_debugger.cpp | 2 +- editor/debugger/limbo_debugger.h | 2 +- editor/debugger/limbo_debugger_plugin.cpp | 2 +- editor/debugger/limbo_debugger_plugin.h | 8 ++++---- editor/editor_property_bb_param.cpp | 6 +++++- editor/editor_property_bb_param.h | 8 ++++++-- editor/limbo_ai_editor_plugin.cpp | 2 +- editor/limbo_ai_editor_plugin.h | 4 ++-- editor/mode_switch_button.cpp | 4 ++++ editor/mode_switch_button.h | 15 +++++++++------ editor/task_palette.cpp | 4 ++++ editor/task_palette.h | 7 ++++++- editor/task_tree.cpp | 4 ++++ editor/task_tree.h | 6 +++++- 18 files changed, 65 insertions(+), 25 deletions(-) diff --git a/editor/action_banner.cpp b/editor/action_banner.cpp index 207ab94..bd203f0 100644 --- a/editor/action_banner.cpp +++ b/editor/action_banner.cpp @@ -9,6 +9,8 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #include "action_banner.h" #include "../util/limbo_compat.h" @@ -93,3 +95,5 @@ ActionBanner::ActionBanner() { spacer->set_custom_minimum_size(Size2(0, 16)); hbox->add_child(spacer); } + +#endif // ! TOOLS_ENABLED diff --git a/editor/action_banner.h b/editor/action_banner.h index 70f8c6e..cbc186a 100644 --- a/editor/action_banner.h +++ b/editor/action_banner.h @@ -10,6 +10,8 @@ */ /* action_banner.h */ +#ifdef TOOLS_ENABLED + #ifndef ACTION_BANNER_H #define ACTION_BANNER_H @@ -55,4 +57,6 @@ public: ActionBanner(); }; -#endif // ! ACTION_BANNER \ No newline at end of file +#endif // ! ACTION_BANNER + +#endif // ! TOOLS_ENABLED diff --git a/editor/debugger/behavior_tree_view.cpp b/editor/debugger/behavior_tree_view.cpp index cfc5130..449fc13 100644 --- a/editor/debugger/behavior_tree_view.cpp +++ b/editor/debugger/behavior_tree_view.cpp @@ -203,4 +203,4 @@ BehaviorTreeView::BehaviorTreeView() { tree->set_anchor(SIDE_BOTTOM, ANCHOR_END); } -#endif // TOOLS_ENABLED +#endif // ! TOOLS_ENABLED diff --git a/editor/debugger/behavior_tree_view.h b/editor/debugger/behavior_tree_view.h index fe1a99e..3fdc7a3 100644 --- a/editor/debugger/behavior_tree_view.h +++ b/editor/debugger/behavior_tree_view.h @@ -69,6 +69,6 @@ public: BehaviorTreeView(); }; -#endif // BEHAVIOR_TREE_VIEW +#endif // ! BEHAVIOR_TREE_VIEW_H -#endif // TOOLS_ENABLED \ No newline at end of file +#endif // ! TOOLS_ENABLED diff --git a/editor/debugger/limbo_debugger.cpp b/editor/debugger/limbo_debugger.cpp index 6ef5102..8a3a7f9 100644 --- a/editor/debugger/limbo_debugger.cpp +++ b/editor/debugger/limbo_debugger.cpp @@ -199,4 +199,4 @@ void LimboDebugger::_on_state_updated(float _delta, NodePath p_path) { EngineDebugger::get_singleton()->send_message("limboai:bt_update", arr); } -#endif // DEBUG_ENABLED +#endif // ! DEBUG_ENABLED diff --git a/editor/debugger/limbo_debugger.h b/editor/debugger/limbo_debugger.h index c502b46..72c4c22 100644 --- a/editor/debugger/limbo_debugger.h +++ b/editor/debugger/limbo_debugger.h @@ -69,4 +69,4 @@ public: #endif // ! DEBUG_ENABLED }; -#endif // ! LIMBO_DEBUGGER +#endif // ! LIMBO_DEBUGGER_H diff --git a/editor/debugger/limbo_debugger_plugin.cpp b/editor/debugger/limbo_debugger_plugin.cpp index 691ed50..9eabbc1 100644 --- a/editor/debugger/limbo_debugger_plugin.cpp +++ b/editor/debugger/limbo_debugger_plugin.cpp @@ -358,4 +358,4 @@ LimboDebuggerPlugin::~LimboDebuggerPlugin() { singleton = nullptr; } -#endif // TOOLS_ENABLED +#endif // ! TOOLS_ENABLED diff --git a/editor/debugger/limbo_debugger_plugin.h b/editor/debugger/limbo_debugger_plugin.h index 4408272..1cb1580 100644 --- a/editor/debugger/limbo_debugger_plugin.h +++ b/editor/debugger/limbo_debugger_plugin.h @@ -9,11 +9,11 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #ifndef LIMBO_DEBUGGER_PLUGIN_H #define LIMBO_DEBUGGER_PLUGIN_H -#ifdef TOOLS_ENABLED - #include "../../editor/debugger/behavior_tree_data.h" #include "../../editor/debugger/behavior_tree_view.h" #include "../../gdextension/window_wrapper.h" @@ -129,6 +129,6 @@ public: ~LimboDebuggerPlugin(); }; -#endif // ! TOOLS_ENABLED - #endif // ! LIMBO_DEBUGGER_PLUGIN_H + +#endif // ! TOOLS_ENABLED diff --git a/editor/editor_property_bb_param.cpp b/editor/editor_property_bb_param.cpp index d35fd94..2ce7eff 100644 --- a/editor/editor_property_bb_param.cpp +++ b/editor/editor_property_bb_param.cpp @@ -9,6 +9,8 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #ifdef LIMBOAI_MODULE #include "editor_property_bb_param.h" @@ -348,4 +350,6 @@ bool EditorInspectorPluginBBParam::parse_property(Object *p_object, const Varian return false; } -#endif // LIMBOAI_MODULE +#endif // ! LIMBOAI_MODULE + +#endif // ! TOOLS_ENABLED diff --git a/editor/editor_property_bb_param.h b/editor/editor_property_bb_param.h index b882641..e077a7d 100644 --- a/editor/editor_property_bb_param.h +++ b/editor/editor_property_bb_param.h @@ -9,6 +9,8 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #ifndef EDITOR_PROPERTY_BB_PARAM_H #define EDITOR_PROPERTY_BB_PARAM_H @@ -70,6 +72,8 @@ public: virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const BitField p_usage, const bool p_wide = false) override; }; -#endif // LIMBOAI_MODULE +#endif // ! LIMBOAI_MODULE -#endif // EDITOR_PROPERTY_BB_PARAM_H +#endif // ! EDITOR_PROPERTY_BB_PARAM_H + +#endif // ! TOOLS_ENABLED diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 8e96c55..4ae0224 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -1431,4 +1431,4 @@ LimboAIEditorPlugin::LimboAIEditorPlugin() { LimboAIEditorPlugin::~LimboAIEditorPlugin() { } -#endif // TOOLS_ENABLED +#endif // ! TOOLS_ENABLED diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index fec355e..e31a4b8 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -250,6 +250,6 @@ public: ~LimboAIEditorPlugin(); }; -#endif // LIMBO_AI_EDITOR_PLUGIN_H +#endif // ! LIMBO_AI_EDITOR_PLUGIN_H -#endif // ! TOOLS_ENABLED \ No newline at end of file +#endif // ! TOOLS_ENABLED diff --git a/editor/mode_switch_button.cpp b/editor/mode_switch_button.cpp index 5bf7a19..ff509ea 100644 --- a/editor/mode_switch_button.cpp +++ b/editor/mode_switch_button.cpp @@ -9,6 +9,8 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #include "mode_switch_button.h" #include "../util/limbo_string_names.h" @@ -82,3 +84,5 @@ void ModeSwitchButton::_bind_methods() { ModeSwitchButton::ModeSwitchButton() { } + +#endif // ! TOOLS_ENABLED diff --git a/editor/mode_switch_button.h b/editor/mode_switch_button.h index c2a3ec4..b2ab845 100644 --- a/editor/mode_switch_button.h +++ b/editor/mode_switch_button.h @@ -9,19 +9,21 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #ifndef MODE_SWITCH_BUTTON #define MODE_SWITCH_BUTTON #include "../util/limbo_compat.h" #ifdef LIMBOAI_MODULE -#include "scene/gui/button.h" - #include "core/typedefs.h" +#include "scene/gui/button.h" #include "scene/resources/texture.h" #define SET_ICON(m_tex) set_icon(m_tex) -#endif // LIMBOAI_MODULE + +#endif // ! LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION #include @@ -29,8 +31,7 @@ #include using namespace godot; - -#endif // LIMBOAI_GDEXTENSION +#endif // ! LIMBOAI_GDEXTENSION class ModeSwitchButton : public Button { GDCLASS(ModeSwitchButton, Button); @@ -68,4 +69,6 @@ public: ModeSwitchButton(); }; -#endif // MODE_SWITCH_BUTTON +#endif // ! MODE_SWITCH_BUTTON_H + +#endif // ! TOOLS_ENABLED diff --git a/editor/task_palette.cpp b/editor/task_palette.cpp index 346d019..09e6456 100644 --- a/editor/task_palette.cpp +++ b/editor/task_palette.cpp @@ -9,6 +9,8 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #include "task_palette.h" #include "../util/limbo_compat.h" @@ -750,3 +752,5 @@ TaskPalette::TaskPalette() { TaskPalette::~TaskPalette() { } + +#endif // ! TOOLS_ENABLED diff --git a/editor/task_palette.h b/editor/task_palette.h index 6cb0ba1..29e82d7 100644 --- a/editor/task_palette.h +++ b/editor/task_palette.h @@ -8,6 +8,9 @@ * https://opensource.org/licenses/MIT. * ============================================================================= */ + +#ifdef TOOLS_ENABLED + #ifndef TASK_PALETTE_H #define TASK_PALETTE_H @@ -189,4 +192,6 @@ public: ~TaskPalette(); }; -#endif // TASK_PALETTE \ No newline at end of file +#endif // ! TASK_PALETTE_H + +#endif // ! TOOLS_ENABLED diff --git a/editor/task_tree.cpp b/editor/task_tree.cpp index f02eb1f..034d176 100644 --- a/editor/task_tree.cpp +++ b/editor/task_tree.cpp @@ -9,6 +9,8 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #include "task_tree.h" #include "../bt/tasks/bt_comment.h" @@ -418,3 +420,5 @@ TaskTree::~TaskTree() { last_selected->disconnect(LW_NAME(changed), on_task_changed); } } + +#endif // ! TOOLS_ENABLED diff --git a/editor/task_tree.h b/editor/task_tree.h index 0abd27e..5515fb6 100644 --- a/editor/task_tree.h +++ b/editor/task_tree.h @@ -9,6 +9,8 @@ * ============================================================================= */ +#ifdef TOOLS_ENABLED + #include "../bt/behavior_tree.h" #ifdef LIMBOAI_MODULE @@ -98,4 +100,6 @@ public: TaskTree(); ~TaskTree(); -}; \ No newline at end of file +}; + +#endif // ! TOOLS_ENABLED