diff --git a/blackboard/bb_param/bb_node.cpp b/blackboard/bb_param/bb_node.cpp index 088788b..8e45004 100644 --- a/blackboard/bb_param/bb_node.cpp +++ b/blackboard/bb_param/bb_node.cpp @@ -15,6 +15,7 @@ #include "core/error/error_macros.h" #include "scene/main/node.h" #endif // LIMBOAI_MODULE + #ifdef LIMBOAI_GDEXTENSION #include #endif // LIMBOAI_GDEXTENSION diff --git a/blackboard/bb_param/bb_param.cpp b/blackboard/bb_param/bb_param.cpp index 5a2310d..465e374 100644 --- a/blackboard/bb_param/bb_param.cpp +++ b/blackboard/bb_param/bb_param.cpp @@ -11,9 +11,9 @@ #include "bb_param.h" -#ifdef LIMBOAI_MODULE -#include "modules/limboai/util/limbo_utility.h" +#include "../../util/limbo_utility.h" +#ifdef LIMBOAI_MODULE #include "core/core_bind.h" #include "core/error/error_macros.h" #include "core/object/class_db.h" @@ -23,8 +23,6 @@ #endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION -#include "util/limbo_utility.h" - using namespace godot; #endif // LIMBOAI_GDEXTENSION @@ -59,9 +57,9 @@ void BBParam::set_variable(const String &p_value) { #ifdef LIMBOAI_MODULE String BBParam::to_string() { -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION String BBParam::_to_string() { -#endif // LIMBOAI_MODULE +#endif if (value_source == SAVED_VALUE) { String s = saved_value.stringify(); switch (get_type()) { diff --git a/blackboard/bb_param/bb_param.h b/blackboard/bb_param/bb_param.h index 066bb00..96044c5 100644 --- a/blackboard/bb_param/bb_param.h +++ b/blackboard/bb_param/bb_param.h @@ -27,7 +27,7 @@ #include #include #include -#endif +#endif // LIMBOAI_GDEXTENSION class BBParam : public Resource { GDCLASS(BBParam, Resource); @@ -54,8 +54,7 @@ protected: #ifdef LIMBOAI_MODULE Callable::CallError err; Variant::construct(get_type(), saved_value, nullptr, 0, err); -#endif -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION saved_value.clear(); #endif } @@ -76,7 +75,7 @@ public: #ifdef LIMBOAI_MODULE virtual String to_string() override; -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION virtual String _to_string(); #endif diff --git a/blackboard/blackboard.cpp b/blackboard/blackboard.cpp index 09d1209..cfd6973 100644 --- a/blackboard/blackboard.cpp +++ b/blackboard/blackboard.cpp @@ -68,7 +68,7 @@ void Blackboard::prefetch_nodepath_vars(Node *p_node) { } } } -}; +} void Blackboard::_bind_methods() { ClassDB::bind_method(D_METHOD("get_data"), &Blackboard::get_data); @@ -81,4 +81,4 @@ void Blackboard::_bind_methods() { ClassDB::bind_method(D_METHOD("erase_var", "p_key"), &Blackboard::erase_var); ClassDB::bind_method(D_METHOD("prefetch_nodepath_vars", "p_node"), &Blackboard::prefetch_nodepath_vars); ClassDB::bind_method(D_METHOD("top"), &Blackboard::top); -} \ No newline at end of file +} diff --git a/blackboard/blackboard.h b/blackboard/blackboard.h index e22c8d7..893bd89 100644 --- a/blackboard/blackboard.h +++ b/blackboard/blackboard.h @@ -21,15 +21,12 @@ #endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION - #include #include #include #include #include - using namespace godot; - #endif // LIMBOAI_GDEXTENSION class Blackboard : public RefCounted { diff --git a/bt/behavior_tree.cpp b/bt/behavior_tree.cpp index b3300b5..b6fc0d9 100644 --- a/bt/behavior_tree.cpp +++ b/bt/behavior_tree.cpp @@ -55,4 +55,4 @@ void BehaviorTree::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "description", PROPERTY_HINT_MULTILINE_TEXT), "set_description", "get_description"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "root_task", PROPERTY_HINT_RESOURCE_TYPE, "BTTask", PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL), "set_root_task", "get_root_task"); -} \ No newline at end of file +} diff --git a/bt/behavior_tree.h b/bt/behavior_tree.h index ab1d57f..ffd6f53 100644 --- a/bt/behavior_tree.h +++ b/bt/behavior_tree.h @@ -56,4 +56,4 @@ public: Ref instantiate(Node *p_agent, const Ref &p_blackboard) const; }; -#endif // BEHAVIOR_TREE_H \ No newline at end of file +#endif // BEHAVIOR_TREE_H diff --git a/bt/bt_player.cpp b/bt/bt_player.cpp index 80a7e6d..25d8004 100644 --- a/bt/bt_player.cpp +++ b/bt/bt_player.cpp @@ -16,7 +16,6 @@ #include "../util/limbo_string_names.h" #ifdef LIMBOAI_MODULE - #include "core/config/engine.h" #include "core/debugger/engine_debugger.h" #include "core/error/error_macros.h" @@ -30,10 +29,9 @@ #define IS_DEBUGGER_ACTIVE() (EngineDebugger::is_active()) #define GET_TICKS_USEC() (OS::get_singleton()->get_ticks_usec()) -#endif // LIMBO_MODULE +#endif // ! LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION - #include #include #include @@ -41,7 +39,7 @@ #define IS_DEBUGGER_ACTIVE() (EngineDebugger::get_singleton()->is_active()) #define GET_TICKS_USEC() (Time::get_singleton()->get_ticks_usec()) -#endif // LIMBOAI_GDEXTENSION +#endif // ! LIMBOAI_GDEXTENSION VARIANT_ENUM_CAST(BTPlayer::UpdateMode); @@ -148,7 +146,7 @@ double BTPlayer::_get_mean_update_time_msec() { return 0.0; } -#endif // DEBUG_ENABLED +#endif // ! DEBUG_ENABLED void BTPlayer::_notification(int p_notification) { switch (p_notification) { @@ -182,7 +180,7 @@ void BTPlayer::_notification(int p_notification) { LimboDebugger::get_singleton()->unregister_bt_instance(tree_instance, get_path()); } } break; -#endif +#endif // DEBUG_ENABLED } } @@ -223,7 +221,6 @@ void BTPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_monitor_performance", "p_value"), &BTPlayer::_set_monitor_performance); ClassDB::bind_method(D_METHOD("_get_monitor_performance"), &BTPlayer::_get_monitor_performance); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitor_performance"), "_set_monitor_performance", "_get_monitor_performance"); - // ADD_PROPERTY_DEFAULT("monitor_performance", false); #endif // DEBUG_ENABLED } diff --git a/bt/bt_player.h b/bt/bt_player.h index 4c45438..175fafc 100644 --- a/bt/bt_player.h +++ b/bt/bt_player.h @@ -12,6 +12,10 @@ #ifndef BT_PLAYER_H #define BT_PLAYER_H +#include "../blackboard/blackboard.h" +#include "behavior_tree.h" +#include "tasks/bt_task.h" + #ifdef LIMBOAI_MODULE #include "scene/main/node.h" #endif @@ -20,17 +24,13 @@ #include #endif -#include "../blackboard/blackboard.h" -#include "behavior_tree.h" -#include "tasks/bt_task.h" - class BTPlayer : public Node { GDCLASS(BTPlayer, Node); public: enum UpdateMode : unsigned int { IDLE, // automatically call update() during NOTIFICATION_PROCESS - PHYSICS, //# automatically call update() during NOTIFICATION_PHYSICS + PHYSICS, // automatically call update() during NOTIFICATION_PHYSICS MANUAL, // manually update state machine, user must call update(delta) }; @@ -77,8 +77,8 @@ public: BTPlayer(); ~BTPlayer(); -#ifdef DEBUG_ENABLED - // Performace monitoring. +#ifdef DEBUG_ENABLED // Performance monitoring + private: bool monitor_performance = false; StringName monitor_id; @@ -92,4 +92,4 @@ private: #endif // DEBUG_ENABLED }; -#endif // BT_PLAYER_H \ No newline at end of file +#endif // BT_PLAYER_H diff --git a/bt/bt_state.h b/bt/bt_state.h index 4d367d6..b3baa74 100644 --- a/bt/bt_state.h +++ b/bt/bt_state.h @@ -30,7 +30,6 @@ protected: static void _bind_methods(); virtual void _setup() override; - // virtual void _enter() override {} virtual void _exit() override; virtual void _update(double p_delta) override; @@ -53,4 +52,4 @@ protected: #endif }; -#endif // BT_STATE_H \ No newline at end of file +#endif // BT_STATE_H diff --git a/bt/tasks/bt_action.h b/bt/tasks/bt_action.h index 49c4b6f..a685d25 100644 --- a/bt/tasks/bt_action.h +++ b/bt/tasks/bt_action.h @@ -21,4 +21,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_ACTION_H \ No newline at end of file +#endif // BT_ACTION_H diff --git a/bt/tasks/bt_comment.h b/bt/tasks/bt_comment.h index cfe6173..78cc0e0 100644 --- a/bt/tasks/bt_comment.h +++ b/bt/tasks/bt_comment.h @@ -23,4 +23,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_COMMENT \ No newline at end of file +#endif // BT_COMMENT_H diff --git a/bt/tasks/bt_composite.h b/bt/tasks/bt_composite.h index e8b8205..d747fca 100644 --- a/bt/tasks/bt_composite.h +++ b/bt/tasks/bt_composite.h @@ -21,4 +21,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_COMPOSITE_H \ No newline at end of file +#endif // BT_COMPOSITE_H diff --git a/bt/tasks/bt_condition.h b/bt/tasks/bt_condition.h index ac01df5..f1ab6a3 100644 --- a/bt/tasks/bt_condition.h +++ b/bt/tasks/bt_condition.h @@ -21,4 +21,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_CONDITION_H \ No newline at end of file +#endif // BT_CONDITION_H diff --git a/bt/tasks/bt_decorator.h b/bt/tasks/bt_decorator.h index ae5177e..f3a2cbc 100644 --- a/bt/tasks/bt_decorator.h +++ b/bt/tasks/bt_decorator.h @@ -21,4 +21,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_DECORATOR_H \ No newline at end of file +#endif // BT_DECORATOR_H diff --git a/bt/tasks/bt_task.cpp b/bt/tasks/bt_task.cpp index d65bac3..e563ba9 100644 --- a/bt/tasks/bt_task.cpp +++ b/bt/tasks/bt_task.cpp @@ -11,12 +11,12 @@ #include "bt_task.h" -#ifdef LIMBOAI_MODULE +#include "../../blackboard/blackboard.h" +#include "../../util/limbo_string_names.h" +#include "../../util/limbo_utility.h" #include "bt_comment.h" -#include "modules/limboai/blackboard/blackboard.h" -#include "modules/limboai/util/limbo_string_names.h" -#include "modules/limboai/util/limbo_utility.h" +#ifdef LIMBOAI_MODULE #include "core/error/error_macros.h" #include "core/io/resource.h" #include "core/object/class_db.h" @@ -29,10 +29,6 @@ #endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION -#include "blackboard/blackboard.h" -#include "bt/tasks/bt_comment.h" -#include "util/limbo_string_names.h" - #include "godot_cpp/classes/global_constants.hpp" #include "godot_cpp/core/class_db.hpp" #include "godot_cpp/variant/dictionary.hpp" @@ -41,6 +37,7 @@ #include "godot_cpp/variant/utility_functions.hpp" #include "godot_cpp/variant/variant.hpp" #include +#include #endif // LIMBOAI_GDEXTENSION void BT::_bind_methods() { @@ -102,7 +99,7 @@ String BTTask::get_task_name() { } } return _generate_name(); -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION return call(LimboStringNames::get_singleton()->_generate_name); #endif } @@ -133,15 +130,7 @@ void BTTask::initialize(Node *p_agent, const Ref &p_blackboard) { get_child(i)->initialize(p_agent, p_blackboard); } -#ifdef LIMBOAI_MODULE - if (!GDVIRTUAL_CALL(_setup)) { - _setup(); - } -#endif - -#ifdef LIMBOAI_GDEXTENSION - call(LimboStringNames::get_singleton()->_setup); -#endif + VCALL_OR_NATIVE(_setup); } Ref BTTask::clone() const { @@ -191,9 +180,7 @@ Ref BTTask::clone() const { } } } -#endif // LIMBOAI_MODULE - -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION // Make BBParam properties unique. TypedArray props = inst->get_property_list(); HashMap, Ref> duplicates; @@ -220,8 +207,7 @@ Ref BTTask::clone() const { } } } - -#endif // LIMBOAI_GDEXTENSION +#endif // LIMBOAI_MODULE & LIMBOAI_GDEXTENSION return inst; } @@ -235,15 +221,7 @@ BT::Status BTTask::execute(double p_delta) { } } -#ifdef LIMBOAI_MODULE - if (!GDVIRTUAL_CALL(_enter)) { - _enter(); - } -#endif -#ifdef LIMBOAI_GDEXTENSION - call(LimboStringNames::get_singleton()->_enter); -#endif - + VCALL_OR_NATIVE(_enter); } else { data.elapsed += p_delta; } @@ -252,20 +230,12 @@ BT::Status BTTask::execute(double p_delta) { if (!GDVIRTUAL_CALL(_tick, p_delta, data.status)) { data.status = _tick(p_delta); } -#endif -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION data.status = (Status)(int)call(LimboStringNames::get_singleton()->_tick, p_delta); #endif if (data.status != RUNNING) { -#ifdef LIMBOAI_MODULE - if (!GDVIRTUAL_CALL(_exit)) { - _exit(); - } -#endif -#ifdef LIMBOAI_GDEXTENSION - call(LimboStringNames::get_singleton()->_exit); -#endif + VCALL_OR_NATIVE(_exit); data.elapsed = 0.0; } return data.status; @@ -276,14 +246,7 @@ void BTTask::abort() { get_child(i)->abort(); } if (data.status == RUNNING) { -#ifdef LIMBOAI_MODULE - if (!GDVIRTUAL_CALL(_exit)) { - _exit(); - } -#endif -#ifdef LIMBOAI_GDEXTENSION - call(LimboStringNames::get_singleton()->_exit); -#endif + VCALL_OR_NATIVE(_exit); } data.status = FRESH; data.elapsed = 0.0; @@ -364,19 +327,16 @@ Ref BTTask::next_sibling() const { return Ref(); } +PackedStringArray BTTask::_get_configuration_warnings() { + return PackedStringArray(); +} + PackedStringArray BTTask::get_configuration_warnings() { PackedStringArray ret; PackedStringArray warnings; -#ifdef LIMBOAI_MODULE - if (GDVIRTUAL_CALL(_get_configuration_warning, warnings)) { - ret.append_array(warnings); - } -#endif -#ifdef LIMBOAI_GDEXTENSION - warnings = call(LimboStringNames::get_singleton()->_get_configuration_warning); + VCALL_V(_get_configuration_warnings, warnings); // Get script warnings. ret.append_array(warnings); -#endif return ret; } @@ -431,7 +391,6 @@ void BTTask::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "custom_name"), "set_custom_name", "get_custom_name"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "agent", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "set_agent", "get_agent"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "blackboard", PROPERTY_HINT_RESOURCE_TYPE, "Blackboard", PROPERTY_USAGE_NONE), "", "get_blackboard"); - // ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "parent", PROPERTY_HINT_RESOURCE_TYPE, "BTTask", 0), "", "get_parent"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "children", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL), "_set_children", "_get_children"); ADD_PROPERTY(PropertyInfo(Variant::INT, "status", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_status"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "elapsed_time", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "", "get_elapsed_time"); @@ -442,22 +401,15 @@ void BTTask::_bind_methods() { GDVIRTUAL_BIND(_exit); GDVIRTUAL_BIND(_tick, "p_delta"); GDVIRTUAL_BIND(_generate_name); - GDVIRTUAL_BIND(_get_configuration_warning); -#endif // LIMBOAI_MODULE -#ifdef LIMBOAI_GDEXTENSION + GDVIRTUAL_BIND(_get_configuration_warnings); +#elif LIMBOAI_GDEXTENSION // TODO: Until virtual functions are implemented in godot-cpp, we do this. Replace this code when possible. ClassDB::bind_method(D_METHOD("_setup"), &BTTask::_setup); ClassDB::bind_method(D_METHOD("_enter"), &BTTask::_enter); ClassDB::bind_method(D_METHOD("_exit"), &BTTask::_exit); ClassDB::bind_method(D_METHOD("_tick", "p_delta"), &BTTask::_tick); ClassDB::bind_method(D_METHOD("_generate_name"), &BTTask::_generate_name); - ClassDB::bind_method(D_METHOD("_get_configuration_warnings"), &BTTask::get_configuration_warnings); - // BIND_VIRTUAL_METHOD(BTTask, _setup); - // BIND_VIRTUAL_METHOD(BTTask, _enter); - // BIND_VIRTUAL_METHOD(BTTask, _exit); - // BIND_VIRTUAL_METHOD(BTTask, _tick); - // BIND_VIRTUAL_METHOD(BTTask, _generate_name); - // BIND_VIRTUAL_METHOD(BTTask, get_configuration_warnings); + ClassDB::bind_method(D_METHOD("_get_configuration_warnings"), &BTTask::_get_configuration_warnings); #endif } diff --git a/bt/tasks/bt_task.h b/bt/tasks/bt_task.h index 8950686..95c5593 100644 --- a/bt/tasks/bt_task.h +++ b/bt/tasks/bt_task.h @@ -9,8 +9,8 @@ * ============================================================================= */ -#ifndef BTTASK_H -#define BTTASK_H +#ifndef BT_TASK_H +#define BT_TASK_H #include "../../blackboard/blackboard.h" #include "../../util/limbo_compat.h" @@ -32,16 +32,15 @@ #include "core/variant/binder_common.h" #include "core/variant/dictionary.h" #include "scene/resources/texture.h" -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION #include #include #include #include - using namespace godot; -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION /** * Base class for BTTask. @@ -71,7 +70,7 @@ class BTTask : public BT { private: friend class BehaviorTree; - // Avoid namespace pollution in derived classes. + // Avoid namespace pollution in the derived classes. struct Data { int index = -1; String custom_name; @@ -86,6 +85,8 @@ private: Array _get_children() const; void _set_children(Array children); + PackedStringArray _get_configuration_warnings(); // ! Scripts only. + protected: static void _bind_methods(); @@ -101,7 +102,7 @@ protected: GDVIRTUAL0(_enter); GDVIRTUAL0(_exit); GDVIRTUAL1R(Status, _tick, double); - GDVIRTUAL0RC(PackedStringArray, _get_configuration_warning); + GDVIRTUAL0RC(PackedStringArray, _get_configuration_warnings); #endif // LIMBOAI_MODULE public: @@ -122,7 +123,7 @@ public: virtual Ref clone() const; virtual void initialize(Node *p_agent, const Ref &p_blackboard); - virtual PackedStringArray get_configuration_warnings(); + virtual PackedStringArray get_configuration_warnings(); // ! Native version. Status execute(double p_delta); void abort(); @@ -158,4 +159,4 @@ public: ~BTTask(); }; -#endif // BTTASK_H \ No newline at end of file +#endif // BT_TASK_H diff --git a/bt/tasks/composites/bt_dynamic_sequence.cpp b/bt/tasks/composites/bt_dynamic_sequence.cpp index 5c6fab5..dc676c3 100644 --- a/bt/tasks/composites/bt_dynamic_sequence.cpp +++ b/bt/tasks/composites/bt_dynamic_sequence.cpp @@ -31,4 +31,4 @@ BT::Status BTDynamicSequence::_tick(double p_delta) { } last_running_idx = i; return status; -} \ No newline at end of file +} diff --git a/bt/tasks/composites/bt_dynamic_sequence.h b/bt/tasks/composites/bt_dynamic_sequence.h index f4ac6ee..4663a55 100644 --- a/bt/tasks/composites/bt_dynamic_sequence.h +++ b/bt/tasks/composites/bt_dynamic_sequence.h @@ -26,4 +26,4 @@ protected: virtual Status _tick(double p_delta) override; }; -#endif // BT_DYNAMIC_SEQUENCE_H \ No newline at end of file +#endif // BT_DYNAMIC_SEQUENCE_H diff --git a/bt/tasks/composites/bt_parallel.h b/bt/tasks/composites/bt_parallel.h index 634cbca..9e5624c 100644 --- a/bt/tasks/composites/bt_parallel.h +++ b/bt/tasks/composites/bt_parallel.h @@ -47,4 +47,4 @@ public: } }; -#endif // BT_PARALLEL_H \ No newline at end of file +#endif // BT_PARALLEL_H diff --git a/bt/tasks/composites/bt_probability_selector.h b/bt/tasks/composites/bt_probability_selector.h index c20507b..2cf3272 100644 --- a/bt/tasks/composites/bt_probability_selector.h +++ b/bt/tasks/composites/bt_probability_selector.h @@ -20,6 +20,7 @@ #include "core/core_string_names.h" #include "core/typedefs.h" #endif // LIMBOAI_MODULE + #ifdef LIMBOAI_GDEXTENSION #include #endif // LIMBOAI_GDEXTENSION diff --git a/bt/tasks/composites/bt_random_selector.cpp b/bt/tasks/composites/bt_random_selector.cpp index 5ac2c6a..b617829 100644 --- a/bt/tasks/composites/bt_random_selector.cpp +++ b/bt/tasks/composites/bt_random_selector.cpp @@ -32,4 +32,4 @@ BT::Status BTRandomSelector::_tick(double p_delta) { } } return status; -} \ No newline at end of file +} diff --git a/bt/tasks/composites/bt_random_selector.h b/bt/tasks/composites/bt_random_selector.h index 627f93a..eff5d1f 100644 --- a/bt/tasks/composites/bt_random_selector.h +++ b/bt/tasks/composites/bt_random_selector.h @@ -26,4 +26,5 @@ protected: virtual void _enter() override; virtual Status _tick(double p_delta) override; }; -#endif // BT_RANDOM_SELECTOR_H \ No newline at end of file + +#endif // BT_RANDOM_SELECTOR_H diff --git a/bt/tasks/composites/bt_random_sequence.cpp b/bt/tasks/composites/bt_random_sequence.cpp index 2b19674..5b2369a 100644 --- a/bt/tasks/composites/bt_random_sequence.cpp +++ b/bt/tasks/composites/bt_random_sequence.cpp @@ -32,4 +32,4 @@ BT::Status BTRandomSequence::_tick(double p_delta) { } } return status; -} \ No newline at end of file +} diff --git a/bt/tasks/composites/bt_random_sequence.h b/bt/tasks/composites/bt_random_sequence.h index 0e1c244..2d2c590 100644 --- a/bt/tasks/composites/bt_random_sequence.h +++ b/bt/tasks/composites/bt_random_sequence.h @@ -26,4 +26,5 @@ protected: virtual void _enter() override; virtual Status _tick(double p_delta) override; }; -#endif // BT_RANDOM_SEQUENCE_H \ No newline at end of file + +#endif // BT_RANDOM_SEQUENCE_H diff --git a/bt/tasks/composites/bt_selector.cpp b/bt/tasks/composites/bt_selector.cpp index 82fb7bb..e06a967 100644 --- a/bt/tasks/composites/bt_selector.cpp +++ b/bt/tasks/composites/bt_selector.cpp @@ -25,4 +25,4 @@ BT::Status BTSelector::_tick(double p_delta) { } } return status; -} \ No newline at end of file +} diff --git a/bt/tasks/decorators/bt_always_fail.h b/bt/tasks/decorators/bt_always_fail.h index 4bc1bb6..405fe65 100644 --- a/bt/tasks/decorators/bt_always_fail.h +++ b/bt/tasks/decorators/bt_always_fail.h @@ -22,4 +22,4 @@ protected: virtual Status _tick(double p_delta) override; }; -#endif // BT_ALWAYS_FAIL_H \ No newline at end of file +#endif // BT_ALWAYS_FAIL_H diff --git a/bt/tasks/decorators/bt_always_succeed.h b/bt/tasks/decorators/bt_always_succeed.h index 1ccd8ec..fe34e4f 100644 --- a/bt/tasks/decorators/bt_always_succeed.h +++ b/bt/tasks/decorators/bt_always_succeed.h @@ -22,4 +22,4 @@ protected: virtual Status _tick(double p_delta) override; }; -#endif // BT_ALWAYS_SUCCEED_H \ No newline at end of file +#endif // BT_ALWAYS_SUCCEED_H diff --git a/bt/tasks/decorators/bt_cooldown.cpp b/bt/tasks/decorators/bt_cooldown.cpp index 157378c..2f74298 100644 --- a/bt/tasks/decorators/bt_cooldown.cpp +++ b/bt/tasks/decorators/bt_cooldown.cpp @@ -14,6 +14,7 @@ #ifdef LIMBOAI_MODULE #include "scene/main/scene_tree.h" #endif + #ifdef LIMBOAI_GDEXTENSION #include #endif @@ -78,13 +79,8 @@ void BTCooldown::_chill() { if (timer.is_valid()) { timer->set_time_left(duration); } else { -#ifdef LIMBOAI_MODULE - timer = SceneTree::get_singleton()->create_timer(duration, process_pause); -#endif -#ifdef LIMBOAI_GDEXTENSION - SceneTree *st = (SceneTree *)Engine::get_singleton()->get_main_loop(); - timer = st->create_timer(duration, process_pause); -#endif + timer = SCENE_TREE()->create_timer(duration, process_pause); + ERR_FAIL_NULL(timer); timer->connect(LW_NAME(timeout), callable_mp(this, &BTCooldown::_on_timeout), CONNECT_ONE_SHOT); } } diff --git a/bt/tasks/decorators/bt_cooldown.h b/bt/tasks/decorators/bt_cooldown.h index be52b6b..06b4d77 100644 --- a/bt/tasks/decorators/bt_cooldown.h +++ b/bt/tasks/decorators/bt_cooldown.h @@ -17,6 +17,7 @@ #ifdef LIMBOAI_MODULE #include "scene/main/scene_tree.h" #endif + #ifdef LIMBOAI_GDEXTENSION #include #endif @@ -61,4 +62,4 @@ public: String get_cooldown_state_var() const { return cooldown_state_var; } }; -#endif // BT_COOLDOWN_H \ No newline at end of file +#endif // BT_COOLDOWN_H diff --git a/bt/tasks/decorators/bt_delay.h b/bt/tasks/decorators/bt_delay.h index a3dccab..10c02ff 100644 --- a/bt/tasks/decorators/bt_delay.h +++ b/bt/tasks/decorators/bt_delay.h @@ -32,4 +32,4 @@ public: double get_seconds() const { return seconds; } }; -#endif // BT_DELAY_H \ No newline at end of file +#endif // BT_DELAY_H diff --git a/bt/tasks/decorators/bt_for_each.h b/bt/tasks/decorators/bt_for_each.h index b9abf99..b9da49f 100644 --- a/bt/tasks/decorators/bt_for_each.h +++ b/bt/tasks/decorators/bt_for_each.h @@ -39,4 +39,4 @@ public: String get_save_var() const { return save_var; } }; -#endif // BT_FOR_EACH_H \ No newline at end of file +#endif // BT_FOR_EACH_H diff --git a/bt/tasks/decorators/bt_invert.cpp b/bt/tasks/decorators/bt_invert.cpp index 154c174..e92b925 100644 --- a/bt/tasks/decorators/bt_invert.cpp +++ b/bt/tasks/decorators/bt_invert.cpp @@ -20,4 +20,4 @@ BT::Status BTInvert::_tick(double p_delta) { status = SUCCESS; } return status; -} \ No newline at end of file +} diff --git a/bt/tasks/decorators/bt_invert.h b/bt/tasks/decorators/bt_invert.h index f39018c..63025db 100644 --- a/bt/tasks/decorators/bt_invert.h +++ b/bt/tasks/decorators/bt_invert.h @@ -22,4 +22,4 @@ protected: virtual Status _tick(double p_delta) override; }; -#endif // BT_INVERT_H \ No newline at end of file +#endif // BT_INVERT_H diff --git a/bt/tasks/decorators/bt_new_scope.cpp b/bt/tasks/decorators/bt_new_scope.cpp index 4f12b21..7bca1b3 100644 --- a/bt/tasks/decorators/bt_new_scope.cpp +++ b/bt/tasks/decorators/bt_new_scope.cpp @@ -33,4 +33,4 @@ void BTNewScope::_bind_methods() { ClassDB::bind_method(D_METHOD("_get_blackboard_data"), &BTNewScope::_get_blackboard_data); ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "_blackboard_data"), "_set_blackboard_data", "_get_blackboard_data"); -} \ No newline at end of file +} diff --git a/bt/tasks/decorators/bt_new_scope.h b/bt/tasks/decorators/bt_new_scope.h index 7fcf12e..919ac89 100644 --- a/bt/tasks/decorators/bt_new_scope.h +++ b/bt/tasks/decorators/bt_new_scope.h @@ -33,4 +33,4 @@ public: virtual void initialize(Node *p_agent, const Ref &p_blackboard) override; }; -#endif // BT_NEW_SCOPE_H \ No newline at end of file +#endif // BT_NEW_SCOPE_H diff --git a/bt/tasks/decorators/bt_probability.h b/bt/tasks/decorators/bt_probability.h index 94ccb72..1f1d2af 100644 --- a/bt/tasks/decorators/bt_probability.h +++ b/bt/tasks/decorators/bt_probability.h @@ -32,4 +32,4 @@ public: float get_run_chance() const { return run_chance; } }; -#endif // BT_PROBABILITY_H \ No newline at end of file +#endif // BT_PROBABILITY_H diff --git a/bt/tasks/decorators/bt_repeat.cpp b/bt/tasks/decorators/bt_repeat.cpp index 202d07f..8872e8a 100644 --- a/bt/tasks/decorators/bt_repeat.cpp +++ b/bt/tasks/decorators/bt_repeat.cpp @@ -11,8 +11,6 @@ #include "bt_repeat.h" -#include "../../../util/limbo_string_names.h" - String BTRepeat::_generate_name() { if (forever) { return LW_NAME(repeat_forever); diff --git a/bt/tasks/decorators/bt_repeat.h b/bt/tasks/decorators/bt_repeat.h index 1cfd112..2680432 100644 --- a/bt/tasks/decorators/bt_repeat.h +++ b/bt/tasks/decorators/bt_repeat.h @@ -46,4 +46,4 @@ public: BTRepeat(); }; -#endif // BT_REPEAT_H \ No newline at end of file +#endif // BT_REPEAT_H diff --git a/bt/tasks/decorators/bt_repeat_until_failure.h b/bt/tasks/decorators/bt_repeat_until_failure.h index ec6463e..2b9cb5a 100644 --- a/bt/tasks/decorators/bt_repeat_until_failure.h +++ b/bt/tasks/decorators/bt_repeat_until_failure.h @@ -22,4 +22,4 @@ protected: virtual Status _tick(double p_delta) override; }; -#endif // BT_REPEAT_UNTIL_FAILURE_H \ No newline at end of file +#endif // BT_REPEAT_UNTIL_FAILURE_H diff --git a/bt/tasks/decorators/bt_repeat_until_success.h b/bt/tasks/decorators/bt_repeat_until_success.h index 423b1fa..b125bc2 100644 --- a/bt/tasks/decorators/bt_repeat_until_success.h +++ b/bt/tasks/decorators/bt_repeat_until_success.h @@ -22,4 +22,4 @@ protected: virtual Status _tick(double p_delta) override; }; -#endif // BT_REPEAT_UNTIL_SUCCESS_H \ No newline at end of file +#endif // BT_REPEAT_UNTIL_SUCCESS_H diff --git a/bt/tasks/decorators/bt_run_limit.h b/bt/tasks/decorators/bt_run_limit.h index 40f9126..48e1772 100644 --- a/bt/tasks/decorators/bt_run_limit.h +++ b/bt/tasks/decorators/bt_run_limit.h @@ -33,4 +33,4 @@ public: int get_run_limit() const { return run_limit; } }; -#endif // BT_RUN_LIMIT_H \ No newline at end of file +#endif // BT_RUN_LIMIT_H diff --git a/bt/tasks/decorators/bt_subtree.h b/bt/tasks/decorators/bt_subtree.h index 3cd7c65..516a5f9 100644 --- a/bt/tasks/decorators/bt_subtree.h +++ b/bt/tasks/decorators/bt_subtree.h @@ -37,4 +37,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_SUBTREE_H \ No newline at end of file +#endif // BT_SUBTREE_H diff --git a/bt/tasks/decorators/bt_time_limit.h b/bt/tasks/decorators/bt_time_limit.h index dea420a..f89383e 100644 --- a/bt/tasks/decorators/bt_time_limit.h +++ b/bt/tasks/decorators/bt_time_limit.h @@ -32,4 +32,4 @@ public: double get_time_limit() const { return time_limit; } }; -#endif // BT_TIME_LIMIT_H \ No newline at end of file +#endif // BT_TIME_LIMIT_H diff --git a/bt/tasks/scene/bt_await_animation.h b/bt/tasks/scene/bt_await_animation.h index 923d542..db1d274 100644 --- a/bt/tasks/scene/bt_await_animation.h +++ b/bt/tasks/scene/bt_await_animation.h @@ -56,4 +56,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_AWAIT_ANIMATION \ No newline at end of file +#endif // BT_AWAIT_ANIMATION_H diff --git a/bt/tasks/scene/bt_check_agent_property.cpp b/bt/tasks/scene/bt_check_agent_property.cpp index 1528d25..67b3542 100644 --- a/bt/tasks/scene/bt_check_agent_property.cpp +++ b/bt/tasks/scene/bt_check_agent_property.cpp @@ -58,8 +58,7 @@ BT::Status BTCheckAgentProperty::_tick(double p_delta) { bool r_valid; Variant left_value = get_agent()->get(property, &r_valid); ERR_FAIL_COND_V_MSG(r_valid == false, FAILURE, vformat("BTCheckAgentProperty: Agent has no property named \"%s\"", property)); -#endif -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION Variant left_value = get_agent()->get(property); #endif diff --git a/bt/tasks/scene/bt_check_agent_property.h b/bt/tasks/scene/bt_check_agent_property.h index 76065a3..16d2c73 100644 --- a/bt/tasks/scene/bt_check_agent_property.h +++ b/bt/tasks/scene/bt_check_agent_property.h @@ -45,4 +45,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_CHECK_AGENT_PROPERTY \ No newline at end of file +#endif // BT_CHECK_AGENT_PROPERTY_H diff --git a/bt/tasks/scene/bt_play_animation.h b/bt/tasks/scene/bt_play_animation.h index 10042fa..bef4d95 100644 --- a/bt/tasks/scene/bt_play_animation.h +++ b/bt/tasks/scene/bt_play_animation.h @@ -69,4 +69,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_PLAY_ANIMATION \ No newline at end of file +#endif // BT_PLAY_ANIMATION_H diff --git a/bt/tasks/scene/bt_set_agent_property.cpp b/bt/tasks/scene/bt_set_agent_property.cpp index aa603f8..e6475ad 100644 --- a/bt/tasks/scene/bt_set_agent_property.cpp +++ b/bt/tasks/scene/bt_set_agent_property.cpp @@ -64,8 +64,7 @@ BT::Status BTSetAgentProperty::_tick(double p_delta) { #ifdef LIMBOAI_MODULE Variant left_value = get_agent()->get(property, &r_valid); ERR_FAIL_COND_V_MSG(!r_valid, FAILURE, vformat("BTSetAgentProperty: Failed to get agent's \"%s\" property. Returning FAILURE.", property)); -#endif -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION Variant left_value = get_agent()->get(property); #endif result = LimboUtility::get_singleton()->perform_operation(operation, left_value, right_value); @@ -75,8 +74,7 @@ BT::Status BTSetAgentProperty::_tick(double p_delta) { #ifdef LIMBOAI_MODULE get_agent()->set(property, result, &r_valid); ERR_FAIL_COND_V_MSG(!r_valid, FAILURE, vformat("BTSetAgentProperty: Couldn't set property \"%s\" with value \"%s\"", property, result)); -#endif -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION get_agent()->set(property, result); #endif return SUCCESS; diff --git a/bt/tasks/scene/bt_set_agent_property.h b/bt/tasks/scene/bt_set_agent_property.h index e3e936e..1e52230 100644 --- a/bt/tasks/scene/bt_set_agent_property.h +++ b/bt/tasks/scene/bt_set_agent_property.h @@ -45,4 +45,4 @@ public: LimboUtility::Operation get_operation() const { return operation; } }; -#endif // BT_SET_AGENT_PROPERTY \ No newline at end of file +#endif // BT_SET_AGENT_PROPERTY_H diff --git a/bt/tasks/scene/bt_stop_animation.h b/bt/tasks/scene/bt_stop_animation.h index 6432ada..4bc66a5 100644 --- a/bt/tasks/scene/bt_stop_animation.h +++ b/bt/tasks/scene/bt_stop_animation.h @@ -56,4 +56,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_STOP_ANIMATION \ No newline at end of file +#endif // BT_STOP_ANIMATION_H diff --git a/bt/tasks/utility/bt_call_method.cpp b/bt/tasks/utility/bt_call_method.cpp index 7c3bb22..b61c46b 100644 --- a/bt/tasks/utility/bt_call_method.cpp +++ b/bt/tasks/utility/bt_call_method.cpp @@ -95,8 +95,7 @@ BT::Status BTCallMethod::_tick(double p_delta) { if (ce.error != Callable::CallError::CALL_OK) { ERR_FAIL_V_MSG(FAILURE, "BTCallMethod: Error calling method: " + Variant::get_call_error_text(obj, method, argptrs, argument_count, ce) + "."); } -#endif // LIMBOAI_MODULE -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION Array call_args; if (include_delta) { call_args.push_back(Variant(p_delta)); @@ -107,7 +106,7 @@ BT::Status BTCallMethod::_tick(double p_delta) { // TODO: Unsure how to detect call error, so we return SUCCESS for now... obj->callv(method, call_args); -#endif // LIMBOAI_GDEXTENSION +#endif // LIMBOAI_MODULE & LIMBOAI_GDEXTENSION return SUCCESS; } diff --git a/bt/tasks/utility/bt_call_method.h b/bt/tasks/utility/bt_call_method.h index 3994ef0..093cf78 100644 --- a/bt/tasks/utility/bt_call_method.h +++ b/bt/tasks/utility/bt_call_method.h @@ -50,4 +50,4 @@ public: BTCallMethod(); }; -#endif // BT_CALL_METHOD +#endif // BT_CALL_METHOD_H diff --git a/bt/tasks/utility/bt_console_print.cpp b/bt/tasks/utility/bt_console_print.cpp index ae866b0..7b3227d 100644 --- a/bt/tasks/utility/bt_console_print.cpp +++ b/bt/tasks/utility/bt_console_print.cpp @@ -79,4 +79,4 @@ void BTConsolePrint::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "bb_format_parameters"), "set_bb_format_parameters", "get_bb_format_parameters"); -} \ No newline at end of file +} diff --git a/bt/tasks/utility/bt_console_print.h b/bt/tasks/utility/bt_console_print.h index bbde225..40cfe06 100644 --- a/bt/tasks/utility/bt_console_print.h +++ b/bt/tasks/utility/bt_console_print.h @@ -44,4 +44,4 @@ public: virtual PackedStringArray get_configuration_warnings() override; }; -#endif // BT_CONSOLE_PRINT_H \ No newline at end of file +#endif // BT_CONSOLE_PRINT_H diff --git a/bt/tasks/utility/bt_fail.h b/bt/tasks/utility/bt_fail.h index 48c98f0..b54fd8d 100644 --- a/bt/tasks/utility/bt_fail.h +++ b/bt/tasks/utility/bt_fail.h @@ -22,4 +22,4 @@ protected: virtual Status _tick(double p_delta) override; }; -#endif // BT_FAIL_H \ No newline at end of file +#endif // BT_FAIL_H diff --git a/bt/tasks/utility/bt_random_wait.h b/bt/tasks/utility/bt_random_wait.h index c6ddca5..4e041e0 100644 --- a/bt/tasks/utility/bt_random_wait.h +++ b/bt/tasks/utility/bt_random_wait.h @@ -39,4 +39,4 @@ public: double get_max_duration() const { return max_duration; } }; -#endif // BT_RANDOM_WAIT_H \ No newline at end of file +#endif // BT_RANDOM_WAIT_H diff --git a/bt/tasks/utility/bt_wait.h b/bt/tasks/utility/bt_wait.h index e749518..216e4c4 100644 --- a/bt/tasks/utility/bt_wait.h +++ b/bt/tasks/utility/bt_wait.h @@ -35,4 +35,4 @@ public: double get_duration() const { return duration; } }; -#endif // BT_WAIT_H \ No newline at end of file +#endif // BT_WAIT_H diff --git a/bt/tasks/utility/bt_wait_ticks.h b/bt/tasks/utility/bt_wait_ticks.h index 92ec093..376ed84 100644 --- a/bt/tasks/utility/bt_wait_ticks.h +++ b/bt/tasks/utility/bt_wait_ticks.h @@ -38,4 +38,4 @@ public: int get_num_ticks() const { return num_ticks; } }; -#endif // BT_WAIT_TICKS_H \ No newline at end of file +#endif // BT_WAIT_TICKS_H diff --git a/editor/action_banner.cpp b/editor/action_banner.cpp index bd203f0..bdc8a77 100644 --- a/editor/action_banner.cpp +++ b/editor/action_banner.cpp @@ -22,7 +22,7 @@ #ifdef LIMBOAI_GDEXTENSION #include -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION void ActionBanner::set_text(const String &p_text) { message->set_text(p_text); @@ -48,11 +48,9 @@ void ActionBanner::_execute_action(const Callable &p_action, bool p_auto_close) Callable::CallError ce; Variant ret; p_action.callp(nullptr, 0, ret, ce); -#endif // LIMBOAI_MODULE - -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION p_action.call(); -#endif // LIMBOAI_GDEXTENSION +#endif if (p_auto_close) { queue_free(); @@ -96,4 +94,4 @@ ActionBanner::ActionBanner() { hbox->add_child(spacer); } -#endif // ! TOOLS_ENABLED +#endif // TOOLS_ENABLED diff --git a/editor/action_banner.h b/editor/action_banner.h index cbc186a..4b91ea3 100644 --- a/editor/action_banner.h +++ b/editor/action_banner.h @@ -20,16 +20,15 @@ #include "scene/gui/label.h" #include "scene/gui/margin_container.h" #include "scene/gui/texture_rect.h" -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION #include #include #include #include - using namespace godot; -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION class ActionBanner : public MarginContainer { GDCLASS(ActionBanner, MarginContainer); @@ -57,6 +56,6 @@ public: ActionBanner(); }; -#endif // ! ACTION_BANNER +#endif // ACTION_BANNER_H -#endif // ! TOOLS_ENABLED +#endif // TOOLS_ENABLED diff --git a/editor/debugger/behavior_tree_data.cpp b/editor/debugger/behavior_tree_data.cpp index 932bcec..ad978e8 100644 --- a/editor/debugger/behavior_tree_data.cpp +++ b/editor/debugger/behavior_tree_data.cpp @@ -15,7 +15,7 @@ #include "core/templates/list.h" #endif -//// BehaviorTreeData +//**** BehaviorTreeData void BehaviorTreeData::serialize(Array &p_arr) { p_arr.push_back(bt_player_path); diff --git a/editor/debugger/behavior_tree_data.h b/editor/debugger/behavior_tree_data.h index 2e46ab9..3628440 100644 --- a/editor/debugger/behavior_tree_data.h +++ b/editor/debugger/behavior_tree_data.h @@ -51,4 +51,4 @@ public: BehaviorTreeData() {} }; -#endif // BEHAVIOR_TREE_DATA \ No newline at end of file +#endif // BEHAVIOR_TREE_DATA_H diff --git a/editor/debugger/behavior_tree_view.cpp b/editor/debugger/behavior_tree_view.cpp index 449fc13..6e12a12 100644 --- a/editor/debugger/behavior_tree_view.cpp +++ b/editor/debugger/behavior_tree_view.cpp @@ -30,7 +30,6 @@ #ifdef LIMBOAI_GDEXTENSION #include - #endif // LIMBOAI_GDEXTENSION void BehaviorTreeView::_draw_running_status(Object *p_obj, Rect2 p_rect) { @@ -203,4 +202,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 3fdc7a3..ae9c3be 100644 --- a/editor/debugger/behavior_tree_view.h +++ b/editor/debugger/behavior_tree_view.h @@ -28,7 +28,7 @@ #include #include #include -#endif +#endif // LIMBOAI_GDEXTENSION class BehaviorTreeView : public Control { GDCLASS(BehaviorTreeView, Control); diff --git a/editor/debugger/limbo_debugger.cpp b/editor/debugger/limbo_debugger.cpp index 8a3a7f9..c5593b1 100644 --- a/editor/debugger/limbo_debugger.cpp +++ b/editor/debugger/limbo_debugger.cpp @@ -30,7 +30,7 @@ #include #endif // LIMBOAI_GDEXTENSION -//// LimboDebugger +//**** LimboDebugger LimboDebugger *LimboDebugger::singleton = nullptr; LimboDebugger *LimboDebugger::get_singleton() { @@ -41,8 +41,7 @@ LimboDebugger::LimboDebugger() { singleton = this; #if defined(DEBUG_ENABLED) && defined(LIMBOAI_MODULE) EngineDebugger::register_message_capture("limboai", EngineDebugger::Capture(nullptr, LimboDebugger::parse_message)); -#endif -#if defined(DEBUG_ENABLED) && defined(LIMBOAI_GDEXTENSION) +#elif defined(DEBUG_ENABLED) && defined(LIMBOAI_GDEXTENSION) EngineDebugger::get_singleton()->register_message_capture("limboai", callable_mp(this, &LimboDebugger::parse_message_gdext)); #endif } @@ -98,7 +97,7 @@ bool LimboDebugger::parse_message_gdext(const String &p_msg, const Array &p_args LimboDebugger::parse_message(nullptr, p_msg, p_args, r_captured); return r_captured; } -#endif // LIMBOAI_MODULE +#endif // LIMBOAI_GDEXTENSION void LimboDebugger::register_bt_instance(Ref p_instance, NodePath p_player_path) { ERR_FAIL_COND(p_instance.is_null()); diff --git a/editor/debugger/limbo_debugger.h b/editor/debugger/limbo_debugger.h index 72c4c22..e739e20 100644 --- a/editor/debugger/limbo_debugger.h +++ b/editor/debugger/limbo_debugger.h @@ -69,4 +69,4 @@ public: #endif // ! DEBUG_ENABLED }; -#endif // ! LIMBO_DEBUGGER_H +#endif // LIMBO_DEBUGGER_H diff --git a/editor/debugger/limbo_debugger_plugin.cpp b/editor/debugger/limbo_debugger_plugin.cpp index 9eabbc1..2a04380 100644 --- a/editor/debugger/limbo_debugger_plugin.cpp +++ b/editor/debugger/limbo_debugger_plugin.cpp @@ -40,15 +40,14 @@ #include "scene/gui/split_container.h" #include "scene/gui/tab_container.h" #include "scene/gui/texture_rect.h" -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION #include #include #include #include - -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION //**** LimboDebuggerTab @@ -279,7 +278,7 @@ void LimboDebuggerPlugin::_window_visibility_changed(bool p_visible) { #ifdef LIMBOAI_MODULE void LimboDebuggerPlugin::setup_session(int p_idx) { -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION void LimboDebuggerPlugin::_setup_session(int32_t p_idx) { #endif Ref session = get_session(p_idx); @@ -309,7 +308,7 @@ void LimboDebuggerPlugin::_setup_session(int32_t p_idx) { #ifdef LIMBOAI_MODULE bool LimboDebuggerPlugin::capture(const String &p_message, const Array &p_data, int p_session) { -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION bool LimboDebuggerPlugin::_capture(const String &p_message, const Array &p_data, int32_t p_session) { #endif bool captured = true; @@ -329,7 +328,7 @@ bool LimboDebuggerPlugin::_capture(const String &p_message, const Array &p_data, #ifdef LIMBOAI_MODULE bool LimboDebuggerPlugin::has_capture(const String &p_capture) const { -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION bool LimboDebuggerPlugin::_has_capture(const String &p_capture) const { #endif return p_capture == "limboai"; diff --git a/editor/debugger/limbo_debugger_plugin.h b/editor/debugger/limbo_debugger_plugin.h index c83e501..e9341ca 100644 --- a/editor/debugger/limbo_debugger_plugin.h +++ b/editor/debugger/limbo_debugger_plugin.h @@ -29,10 +29,9 @@ #include "scene/gui/panel_container.h" #include "scene/gui/split_container.h" #include "scene/gui/texture_rect.h" -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION - #include #include #include @@ -44,8 +43,7 @@ #include #include #include - -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION class LimboDebuggerTab : public PanelContainer { GDCLASS(LimboDebuggerTab, PanelContainer); @@ -114,13 +112,11 @@ public: void setup_session(int p_idx) override; bool has_capture(const String &p_capture) const override; bool capture(const String &p_message, const Array &p_data, int p_session) override; -#endif // LIMBOAI_MODULE - -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION void _setup_session(int32_t p_idx) override; bool _has_capture(const String &p_capture) const override; bool _capture(const String &p_message, const Array &p_data, int32_t p_session) override; -#endif // LIMBOAI_GDEXTENSION +#endif CompatWindowWrapper *get_session_tab() const; int get_session_tab_index() const; @@ -129,6 +125,6 @@ public: ~LimboDebuggerPlugin(); }; -#endif // ! LIMBO_DEBUGGER_PLUGIN_H +#endif // LIMBO_DEBUGGER_PLUGIN_H #endif // ! TOOLS_ENABLED diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 4ae0224..af3ed12 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -41,7 +41,7 @@ #include "editor/project_settings_editor.h" #include "scene/gui/panel_container.h" #include "scene/gui/separator.h" -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION #include @@ -66,7 +66,7 @@ #include #include #include -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION //**** LimboAIEditor @@ -193,9 +193,9 @@ void LimboAIEditor::_save_bt(String p_path) { ERR_FAIL_COND_MSG(task_tree->get_bt().is_null(), "Behavior Tree is null."); #ifdef LIMBOAI_MODULE task_tree->get_bt()->set_path(p_path, true); -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION task_tree->get_bt()->take_over_path(p_path); -#endif // LIMBOAI_MODULE +#endif RESOURCE_SAVE(task_tree->get_bt(), p_path, ResourceSaver::FLAG_CHANGE_PATH); _update_header(); _mark_as_dirty(false); @@ -259,7 +259,7 @@ void LimboAIEditor::_create_user_task_dir() { #ifdef LIMBOAI_MODULE EditorFileSystem::get_singleton()->scan_changes(); -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION EditorInterface::get_singleton()->get_resource_filesystem()->scan_sources(); #endif _update_banners(); @@ -270,7 +270,7 @@ void LimboAIEditor::_edit_project_settings() { ProjectSettingsEditor::get_singleton()->set_general_page("limbo_ai/behavior_tree"); ProjectSettingsEditor::get_singleton()->popup_project_settings(); ProjectSettingsEditor::get_singleton()->connect(LW_NAME(visibility_changed), callable_mp(this, &LimboAIEditor::_update_banners), CONNECT_ONE_SHOT); -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION // TODO: Find a way to show project setting in GDExtension. // TODO: Maybe show a popup dialog instead. ERR_PRINT("Can't do in GDExtension. To edit project settings, navigate to \"Project->Project Settings\", enable \"Advanced settings\", and scroll down to the \"LimboAI\" section."); @@ -601,9 +601,9 @@ void LimboAIEditor::_misc_option_selected(int p_id) { EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorDebuggerNode::get_singleton()); EditorDebuggerNode::get_singleton()->get_default_debugger()->switch_to_debugger( LimboDebuggerPlugin::get_singleton()->get_session_tab_index()); -#else // LIMBOAI_GDEXTENSION - // TODO: Unsure how to switch to debugger pane with GDExtension. -#endif // LIMBOAI_MODULE +#elif LIMBOAI_GDEXTENSION + // TODO: Unsure how to switch to debugger pane with GDExtension. +#endif } } break; case MISC_PROJECT_SETTINGS: { @@ -787,9 +787,9 @@ void LimboAIEditor::_on_resources_reload(const PackedStringArray &p_resources) { } disk_changed->call_deferred("popup_centered_ratio", 0.5); } -#else //LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION task_tree->update_tree(); -#endif // LIMBOAI_MODULE +#endif } void LimboAIEditor::_task_type_selected(const String &p_class_or_path) { @@ -942,7 +942,7 @@ void LimboAIEditor::_update_misc_menu() { misc_menu->add_separator(); #ifdef LIMBOAI_MODULE - // * Not sure how to switch to debugger pane with GDExtension. + // * Disabled in GDExtension: Not sure how to switch to debugger pane. misc_menu->add_icon_shortcut(theme_cache.open_debugger_icon, LW_GET_SHORTCUT("limbo_ai/open_debugger"), MISC_OPEN_DEBUGGER); #endif // LIMBOAI_MODULE misc_menu->add_item(TTR("Project Settings..."), MISC_PROJECT_SETTINGS); @@ -1355,7 +1355,7 @@ LimboAIEditor::~LimboAIEditor() { #ifdef LIMBOAI_MODULE void LimboAIEditorPlugin::apply_changes() { -#else // LIMBOAI_MODULE +#elif LIMBOAI_GDEXTENSION void LimboAIEditorPlugin::_apply_changes() { #endif limbo_ai_editor->apply_changes(); @@ -1382,7 +1382,7 @@ void LimboAIEditorPlugin::_notification(int p_notification) { #ifdef LIMBOAI_MODULE void LimboAIEditorPlugin::make_visible(bool p_visible) { -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION void LimboAIEditorPlugin::_make_visible(bool p_visible) { #endif limbo_ai_editor->set_visible(p_visible); @@ -1390,7 +1390,7 @@ void LimboAIEditorPlugin::_make_visible(bool p_visible) { #ifdef LIMBOAI_MODULE void LimboAIEditorPlugin::edit(Object *p_object) { -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION void LimboAIEditorPlugin::_edit(Object *p_object) { #endif if (Object::cast_to(p_object)) { @@ -1400,7 +1400,7 @@ void LimboAIEditorPlugin::_edit(Object *p_object) { #ifdef LIMBOAI_MODULE bool LimboAIEditorPlugin::handles(Object *p_object) const { -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION bool LimboAIEditorPlugin::_handles(Object *p_object) const { #endif if (Object::cast_to(p_object)) { diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index e31a4b8..142dfa1 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -41,7 +41,7 @@ #define GET_UNDO_REDO() EditorUndoRedoManager::get_singleton() -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION #include @@ -62,7 +62,7 @@ using namespace godot; #define GET_UNDO_REDO() plugin->get_undo_redo() -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION class LimboAIEditor : public Control { GDCLASS(LimboAIEditor, Control); @@ -208,7 +208,7 @@ public: #ifdef LIMBOAI_GDEXTENSION virtual void _shortcut_input(const Ref &p_event) override { _process_shortcut_input(p_event); } -#endif // LIMBOAI_GDEXTENSION +#endif LimboAIEditor(); ~LimboAIEditor(); @@ -233,9 +233,8 @@ public: virtual void apply_changes() override; virtual void edit(Object *p_object) override; virtual bool handles(Object *p_object) const override; -#endif // LIMBOAI_MODULE -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION bool _has_main_screen() const override { return true; } virtual String _get_plugin_name() const override { return "LimboAI"; } @@ -244,12 +243,12 @@ public: virtual void _edit(Object *p_object) override; virtual bool _handles(Object *p_object) const override; virtual Ref _get_plugin_icon() const override; -#endif // LIMBOAI_GDEXTENSION +#endif // LIMBOAI_MODULE & LIMBOAI_GDEXTENSION LimboAIEditorPlugin(); ~LimboAIEditorPlugin(); }; -#endif // ! LIMBO_AI_EDITOR_PLUGIN_H +#endif // LIMBO_AI_EDITOR_PLUGIN_H #endif // ! TOOLS_ENABLED diff --git a/editor/mode_switch_button.h b/editor/mode_switch_button.h index b2ab845..bedb05e 100644 --- a/editor/mode_switch_button.h +++ b/editor/mode_switch_button.h @@ -20,18 +20,14 @@ #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 #include #include - using namespace godot; -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION class ModeSwitchButton : public Button { GDCLASS(ModeSwitchButton, Button); @@ -69,6 +65,6 @@ public: ModeSwitchButton(); }; -#endif // ! MODE_SWITCH_BUTTON_H +#endif // MODE_SWITCH_BUTTON_H #endif // ! TOOLS_ENABLED diff --git a/editor/task_palette.cpp b/editor/task_palette.cpp index 09e6456..fe6e4c2 100644 --- a/editor/task_palette.cpp +++ b/editor/task_palette.cpp @@ -27,7 +27,6 @@ #include "editor/editor_scale.h" #include "editor/plugins/script_editor_plugin.h" #include "scene/gui/check_box.h" - #endif // LIMBO_MODULE #ifdef LIMBOAI_GDEXTENSION @@ -50,7 +49,6 @@ #include #include #include - using namespace godot; #endif // LIMBOAI_GDEXTENSION diff --git a/editor/task_palette.h b/editor/task_palette.h index 29e82d7..52979b7 100644 --- a/editor/task_palette.h +++ b/editor/task_palette.h @@ -15,15 +15,14 @@ #define TASK_PALETTE_H #ifdef LIMBOAI_MODULE -#include "scene/gui/panel_container.h" - #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/check_box.h" #include "scene/gui/flow_container.h" #include "scene/gui/line_edit.h" +#include "scene/gui/panel_container.h" #include "scene/gui/popup.h" -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION #include @@ -36,9 +35,8 @@ #include #include #include - using namespace godot; -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION class TaskButton : public Button { GDCLASS(TaskButton, Button); @@ -52,10 +50,9 @@ protected: public: #ifdef LIMBOAI_MODULE virtual Control *make_custom_tooltip(const String &p_text) const override { return _do_make_tooltip(p_text); } -#endif // LIMBOAI_MODULE -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION virtual Object *_make_custom_tooltip(const String &p_text) const override { return _do_make_tooltip(p_text); } -#endif // LIMBOAI_GDEXTENSION +#endif TaskButton(); }; @@ -192,6 +189,6 @@ public: ~TaskPalette(); }; -#endif // ! TASK_PALETTE_H +#endif // TASK_PALETTE_H #endif // ! TOOLS_ENABLED diff --git a/editor/task_tree.cpp b/editor/task_tree.cpp index 034d176..b258417 100644 --- a/editor/task_tree.cpp +++ b/editor/task_tree.cpp @@ -26,7 +26,6 @@ #ifdef LIMBOAI_GDEXTENSION #include #include - using namespace godot; #endif // LIMBOAI_GDEXTENSION diff --git a/hsm/limbo_hsm.cpp b/hsm/limbo_hsm.cpp index cb8badb..dac970d 100644 --- a/hsm/limbo_hsm.cpp +++ b/hsm/limbo_hsm.cpp @@ -98,7 +98,6 @@ void LimboHSM::update(double p_delta) { } void LimboHSM::add_transition(Node *p_from_state, Node *p_to_state, const String &p_event) { - // ERR_FAIL_COND(p_from_state == nullptr); ERR_FAIL_COND(p_from_state != nullptr && p_from_state->get_parent() != this); ERR_FAIL_COND(p_from_state != nullptr && !p_from_state->is_class("LimboState")); ERR_FAIL_COND(p_to_state == nullptr); @@ -164,11 +163,9 @@ bool LimboHSM::dispatch(const String &p_event, const Variant &p_cargo) { if (unlikely(ce.error != Callable::CallError::CALL_OK)) { ERR_PRINT_ONCE("LimboHSM: Error calling substate's guard callable: " + Variant::get_callable_error_text(to_state->guard_callable, nullptr, 0, ce)); } -#endif // LIMBOAI_MODULE - -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION ret = to_state->guard_callable.call(); -#endif // LIMBOAI_GDEXTENSION +#endif if (unlikely(ret.get_type() != Variant::BOOL)) { ERR_PRINT_ONCE(vformat("State guard callable %s returned non-boolean value (%s).", to_state->guard_callable, to_state)); diff --git a/hsm/limbo_hsm.h b/hsm/limbo_hsm.h index 0e3e461..1c163d9 100644 --- a/hsm/limbo_hsm.h +++ b/hsm/limbo_hsm.h @@ -72,4 +72,4 @@ public: LimboHSM(); }; -#endif // LIMBO_HSM_H \ No newline at end of file +#endif // LIMBO_HSM_H diff --git a/hsm/limbo_state.cpp b/hsm/limbo_state.cpp index a2b9bef..83d2428 100644 --- a/hsm/limbo_state.cpp +++ b/hsm/limbo_state.cpp @@ -100,9 +100,8 @@ bool LimboState::dispatch(const String &p_event, const Variant &p_cargo) { ERR_PRINT("Error calling event handler " + Variant::get_callable_error_text(handlers[p_event], argptrs, 1, ce)); } } -#endif // LIMBOAI_MODULE -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION if (p_cargo.get_type() == Variant::NIL) { ret = handlers[p_event].call(); } else { @@ -189,8 +188,7 @@ void LimboState::_bind_methods() { GDVIRTUAL_BIND(_enter); GDVIRTUAL_BIND(_exit); GDVIRTUAL_BIND(_update, "p_delta"); -#endif -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION ClassDB::bind_method(D_METHOD("_setup"), &LimboState::_setup); ClassDB::bind_method(D_METHOD("_enter"), &LimboState::_enter); ClassDB::bind_method(D_METHOD("_exit"), &LimboState::_exit); diff --git a/hsm/limbo_state.h b/hsm/limbo_state.h index d0d4310..2c2f46a 100644 --- a/hsm/limbo_state.h +++ b/hsm/limbo_state.h @@ -100,4 +100,4 @@ public: LimboState(); }; -#endif // LIMBO_STATE_H \ No newline at end of file +#endif // LIMBO_STATE_H diff --git a/register_types.cpp b/register_types.cpp index 421beff..e3f78be 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -104,25 +104,20 @@ #ifdef TOOLS_ENABLED #include "editor/debugger/behavior_tree_view.h" #include "editor/limbo_ai_editor_plugin.h" -#endif // ! TOOLS_ENABLED +#endif // TOOLS_ENABLED #ifdef LIMBOAI_MODULE - #include "core/object/class_db.h" #include "core/os/memory.h" #include "core/string/print_string.h" - -#endif // ! LIMBOAI_MODULE +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION - #include #include #include - using namespace godot; - -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION static LimboUtility *_limbo_utility = nullptr; @@ -228,7 +223,7 @@ void initialize_limboai_module(ModuleInitializationLevel p_level) { #ifdef LIMBOAI_MODULE Engine::get_singleton()->add_singleton(Engine::Singleton("LimboUtility", LimboUtility::get_singleton())); -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION Engine::get_singleton()->register_singleton("LimboUtility", LimboUtility::get_singleton()); #endif @@ -252,7 +247,7 @@ void initialize_limboai_module(ModuleInitializationLevel p_level) { GDREGISTER_CLASS(LimboDebuggerPlugin); GDREGISTER_CLASS(LimboAIEditor); GDREGISTER_CLASS(LimboAIEditorPlugin); -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION EditorPlugins::add_by_type(); } @@ -280,4 +275,4 @@ GDExtensionBool GDE_EXPORT limboai_init(GDExtensionInterfaceGetProcAddress p_get return init_obj.init(); } } -#endif // ! LIMBOAI_GDEXTENSION +#endif // LIMBOAI_GDEXTENSION diff --git a/register_types.h b/register_types.h index de5c6ac..e18a5a6 100644 --- a/register_types.h +++ b/register_types.h @@ -13,17 +13,12 @@ #define LIMBOAI_REGISTER_TYPES_H #ifdef LIMBOAI_MODULE - #include "modules/register_module_types.h" - #endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION - #include - using namespace godot; - #endif // LIMBOAI_GDEXTENSION void initialize_limboai_module(ModuleInitializationLevel p_level); diff --git a/util/compat_window_wrapper.cpp b/util/compat_window_wrapper.cpp index c596a46..fa540f6 100644 --- a/util/compat_window_wrapper.cpp +++ b/util/compat_window_wrapper.cpp @@ -52,9 +52,6 @@ #include using namespace godot; -// #include "editor/editor_node.h" -// #include "editor/editor_scale.h" -// #include "editor/progress_dialog.h" // WindowWrapper @@ -508,4 +505,4 @@ CompatScreenSelect::CompatScreenSelect() { popup_root->set_anchors_and_offsets_preset(PRESET_FULL_RECT); } -#endif // ! LIMBOAI_GDEXTENSION \ No newline at end of file +#endif // ! LIMBOAI_GDEXTENSION diff --git a/util/compat_window_wrapper.h b/util/compat_window_wrapper.h index dc0140e..9b3691a 100644 --- a/util/compat_window_wrapper.h +++ b/util/compat_window_wrapper.h @@ -40,12 +40,9 @@ #define CompatShortcutBin ShortcutBin #define CompatScreenSelect ScreenSelect -#endif // ! LIMBOAI_MODULE - -// TODO: Need to compile this as module too!!! +#endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION - #include #include #include @@ -144,4 +141,4 @@ public: #endif // ! LIMBOAI_GDEXTENSION -#endif // ! COMPAT_WINDOW_WRAPPER_H +#endif // COMPAT_WINDOW_WRAPPER_H diff --git a/util/limbo_compat.cpp b/util/limbo_compat.cpp index 42a95f5..a02f34a 100644 --- a/util/limbo_compat.cpp +++ b/util/limbo_compat.cpp @@ -17,7 +17,7 @@ #include "core/io/resource.h" #include "editor/editor_node.h" #include "editor/plugins/script_editor_plugin.h" -#endif // ! TOOLS_ENABLED +#endif // TOOLS_ENABLED #endif // ! LIMBOAI_MODULE @@ -91,13 +91,13 @@ void SHOW_DOC(const String &p_topic) { #ifdef LIMBOAI_MODULE ScriptEditor::get_singleton()->goto_help(p_topic); EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT); -#else // LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION TypedArray open_editors = EditorInterface::get_singleton()->get_script_editor()->get_open_script_editors(); ERR_FAIL_COND_MSG(open_editors.size() == 0, "Can't open help page. Need at least one script open in the script editor."); ScriptEditorBase *seb = Object::cast_to(open_editors.front()); ERR_FAIL_NULL(seb); seb->emit_signal("go_to_help", p_topic); -#endif // ! LIMBOAI_GDEXTENSION +#endif } void EDIT_SCRIPT(const String &p_path) { @@ -105,14 +105,12 @@ void EDIT_SCRIPT(const String &p_path) { Ref res = ScriptEditor::get_singleton()->open_file(p_path); ERR_FAIL_COND_MSG(res.is_null(), "Failed to load script: " + p_path); EditorNode::get_singleton()->edit_resource(res); -#endif // LIMBOAI_MODULE - -#ifdef LIMBOAI_GDEXTENSION +#elif LIMBOAI_GDEXTENSION Ref