Don't compile editor classes into template builds

This commit is contained in:
Serhii Snitsaruk 2024-01-11 11:22:02 +01:00
parent e6c87be723
commit 52f218e6b9
18 changed files with 65 additions and 25 deletions

View File

@ -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

View File

@ -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
#endif // ! ACTION_BANNER
#endif // ! TOOLS_ENABLED

View File

@ -203,4 +203,4 @@ BehaviorTreeView::BehaviorTreeView() {
tree->set_anchor(SIDE_BOTTOM, ANCHOR_END);
}
#endif // TOOLS_ENABLED
#endif // ! TOOLS_ENABLED

View File

@ -69,6 +69,6 @@ public:
BehaviorTreeView();
};
#endif // BEHAVIOR_TREE_VIEW
#endif // ! BEHAVIOR_TREE_VIEW_H
#endif // TOOLS_ENABLED
#endif // ! TOOLS_ENABLED

View File

@ -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

View File

@ -69,4 +69,4 @@ public:
#endif // ! DEBUG_ENABLED
};
#endif // ! LIMBO_DEBUGGER
#endif // ! LIMBO_DEBUGGER_H

View File

@ -358,4 +358,4 @@ LimboDebuggerPlugin::~LimboDebuggerPlugin() {
singleton = nullptr;
}
#endif // TOOLS_ENABLED
#endif // ! TOOLS_ENABLED

View File

@ -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

View File

@ -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

View File

@ -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<PropertyUsageFlags> 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

View File

@ -1431,4 +1431,4 @@ LimboAIEditorPlugin::LimboAIEditorPlugin() {
LimboAIEditorPlugin::~LimboAIEditorPlugin() {
}
#endif // TOOLS_ENABLED
#endif // ! TOOLS_ENABLED

View File

@ -250,6 +250,6 @@ public:
~LimboAIEditorPlugin();
};
#endif // LIMBO_AI_EDITOR_PLUGIN_H
#endif // ! LIMBO_AI_EDITOR_PLUGIN_H
#endif // ! TOOLS_ENABLED
#endif // ! TOOLS_ENABLED

View File

@ -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

View File

@ -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 <godot_cpp/classes/button.hpp>
@ -29,8 +31,7 @@
#include <godot_cpp/templates/vector.hpp>
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

View File

@ -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

View File

@ -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
#endif // ! TASK_PALETTE_H
#endif // ! TOOLS_ENABLED

View File

@ -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

View File

@ -9,6 +9,8 @@
* =============================================================================
*/
#ifdef TOOLS_ENABLED
#include "../bt/behavior_tree.h"
#ifdef LIMBOAI_MODULE
@ -98,4 +100,6 @@ public:
TaskTree();
~TaskTree();
};
};
#endif // ! TOOLS_ENABLED