Compare commits

..

No commits in common. "1f6cc8e55c1e226593b1e406d731a623a1450ca5" and "85d5af180b3d816c1826d33880f4778f55afe820" have entirely different histories.

8 changed files with 40 additions and 44 deletions

View File

@ -125,7 +125,7 @@ jobs:
target: editor
arch: x86_64
dotnet: true
should-build: true
should-build: ${{ !inputs.test-build }}
- name: Template .NET (x86_64, release)
target: template_release

View File

@ -112,7 +112,7 @@ jobs:
target: editor
arch: x86_64
dotnet: true
should-build: ${{ !inputs.test-build }}
should-build: true
- name: Template .NET (x86_64, release)
target: template_release

View File

@ -157,16 +157,18 @@ void BTPlayer::restart() {
set_active(true);
}
void BTPlayer::set_monitor_performance(bool p_monitor_performance) {
#ifdef DEBUG_ENABLED
void BTPlayer::_set_monitor_performance(bool p_monitor_performance) {
monitor_performance = p_monitor_performance;
#ifdef DEBUG_ENABLED
if (bt_instance.is_valid()) {
bt_instance->set_monitor_performance(monitor_performance);
}
#endif
}
#endif // ! DEBUG_ENABLED
void BTPlayer::_notification(int p_notification) {
switch (p_notification) {
case NOTIFICATION_PROCESS: {
@ -233,9 +235,6 @@ void BTPlayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_blackboard_plan", "plan"), &BTPlayer::set_blackboard_plan);
ClassDB::bind_method(D_METHOD("get_blackboard_plan"), &BTPlayer::get_blackboard_plan);
ClassDB::bind_method(D_METHOD("set_monitor_performance", "enable"), &BTPlayer::set_monitor_performance);
ClassDB::bind_method(D_METHOD("get_monitor_performance"), &BTPlayer::get_monitor_performance);
ClassDB::bind_method(D_METHOD("update", "delta"), &BTPlayer::update);
ClassDB::bind_method(D_METHOD("restart"), &BTPlayer::restart);
@ -250,7 +249,6 @@ void BTPlayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "active"), "set_active", "get_active");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "blackboard", PROPERTY_HINT_NONE, "Blackboard", 0), "set_blackboard", "get_blackboard");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "blackboard_plan", PROPERTY_HINT_RESOURCE_TYPE, "BlackboardPlan", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT | PROPERTY_USAGE_ALWAYS_DUPLICATE), "set_blackboard_plan", "get_blackboard_plan");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitor_performance"), "set_monitor_performance", "get_monitor_performance");
BIND_ENUM_CONSTANT(IDLE);
BIND_ENUM_CONSTANT(PHYSICS);
@ -261,6 +259,12 @@ void BTPlayer::_bind_methods() {
#ifndef DISABLE_DEPRECATED
ADD_SIGNAL(MethodInfo("behavior_tree_finished", PropertyInfo(Variant::INT, "status")));
#endif
#ifdef DEBUG_ENABLED
ClassDB::bind_method(D_METHOD("_set_monitor_performance", "enable"), &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");
#endif // DEBUG_ENABLED
}
BTPlayer::BTPlayer() {

View File

@ -44,7 +44,6 @@ private:
bool active = true;
Ref<Blackboard> blackboard;
Node *scene_root_hint = nullptr;
bool monitor_performance = false;
Ref<BTInstance> bt_instance;
@ -75,9 +74,6 @@ public:
Ref<Blackboard> get_blackboard() const { return blackboard; }
void set_blackboard(const Ref<Blackboard> &p_blackboard) { blackboard = p_blackboard; }
void set_monitor_performance(bool p_monitor_performance);
bool get_monitor_performance() const { return monitor_performance; }
void update(double p_delta);
void restart();
@ -88,6 +84,16 @@ public:
BTPlayer();
~BTPlayer();
#ifdef DEBUG_ENABLED // Performance monitoring
private:
bool monitor_performance = false;
void _set_monitor_performance(bool p_monitor_performance);
bool _get_monitor_performance() const { return monitor_performance; }
#endif // * DEBUG_ENABLED
};
#endif // BT_PLAYER_H

View File

@ -44,15 +44,15 @@ void BTState::set_scene_root_hint(Node *p_scene_root) {
scene_root_hint = p_scene_root;
}
void BTState::set_monitor_performance(bool p_monitor) {
#ifdef DEBUG_ENABLED
void BTState::_set_monitor_performance(bool p_monitor) {
monitor_performance = p_monitor;
#ifdef DEBUG_ENABLED
if (bt_instance.is_valid()) {
bt_instance->set_monitor_performance(monitor_performance);
}
#endif
}
#endif // DEBUG_ENABLED
void BTState::_update_blackboard_plan() {
if (get_blackboard_plan().is_null()) {
@ -144,15 +144,17 @@ void BTState::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_failure_event", "event"), &BTState::set_failure_event);
ClassDB::bind_method(D_METHOD("get_failure_event"), &BTState::get_failure_event);
ClassDB::bind_method(D_METHOD("set_monitor_performance", "enable"), &BTState::set_monitor_performance);
ClassDB::bind_method(D_METHOD("get_monitor_performance"), &BTState::get_monitor_performance);
ClassDB::bind_method(D_METHOD("set_scene_root_hint", "scene_root"), &BTState::set_scene_root_hint);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "behavior_tree", PROPERTY_HINT_RESOURCE_TYPE, "BehaviorTree"), "set_behavior_tree", "get_behavior_tree");
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "success_event"), "set_success_event", "get_success_event");
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "failure_event"), "set_failure_event", "get_failure_event");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitor_performance"), "set_monitor_performance", "get_monitor_performance");
#ifdef DEBUG_ENABLED
ClassDB::bind_method(D_METHOD("_set_monitor_performance", "enable"), &BTState::_set_monitor_performance);
ClassDB::bind_method(D_METHOD("_get_monitor_performance"), &BTState::_get_monitor_performance);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitor_performance"), "_set_monitor_performance", "_get_monitor_performance");
#endif // DEBUG_ENABLED
}
BTState::BTState() {

View File

@ -26,7 +26,6 @@ private:
StringName success_event;
StringName failure_event;
Node *scene_root_hint = nullptr;
bool monitor_performance = false;
protected:
static void _bind_methods();
@ -52,12 +51,17 @@ public:
void set_failure_event(const StringName &p_failure_event) { failure_event = p_failure_event; }
StringName get_failure_event() const { return failure_event; }
void set_monitor_performance(bool p_monitor);
bool get_monitor_performance() const { return monitor_performance; }
void set_scene_root_hint(Node *p_node);
BTState();
#ifdef DEBUG_ENABLED
private:
bool monitor_performance = false;
void _set_monitor_performance(bool p_monitor);
bool _get_monitor_performance() const { return monitor_performance; }
#endif
};
#endif // BT_STATE_H

View File

@ -799,11 +799,6 @@ void LimboAIEditor::_on_visibility_changed() {
task_palette->refresh();
}
_update_favorite_tasks();
if (request_update_tabs && history.size() > 0) {
_update_tabs();
request_update_tabs = false;
}
}
void LimboAIEditor::_on_header_pressed() {
@ -919,18 +914,6 @@ void LimboAIEditor::_on_resources_reload(const PackedStringArray &p_resources) {
#endif
}
void LimboAIEditor::_on_filesystem_changed() {
if (history.size() == 0) {
return;
}
if (is_visible_in_tree()) {
_update_tabs();
} else {
request_update_tabs = true;
}
}
void LimboAIEditor::_on_new_script_pressed() {
SCRIPT_EDITOR()->open_script_create_dialog("BTAction", String(GLOBAL_GET("limbo_ai/behavior_tree/user_task_dir_1")).path_join("new_task"));
}
@ -1420,7 +1403,6 @@ void LimboAIEditor::_notification(int p_what) {
version_btn->connect(LW_NAME(pressed), callable_mp(this, &LimboAIEditor::_copy_version_info));
EDITOR_FILE_SYSTEM()->connect("resources_reload", callable_mp(this, &LimboAIEditor::_on_resources_reload));
EDITOR_FILE_SYSTEM()->connect("filesystem_changed", callable_mp(this, &LimboAIEditor::_on_filesystem_changed));
} break;
case NOTIFICATION_THEME_CHANGED: {

View File

@ -143,7 +143,6 @@ private:
Vector<Ref<BehaviorTree>> history;
int idx_history;
bool updating_tabs = false;
bool request_update_tabs = false;
HashSet<Ref<BehaviorTree>> dirty;
Ref<BTTask> clipboard_task;
@ -238,7 +237,6 @@ private:
void _on_history_forward();
void _on_task_dragged(Ref<BTTask> p_task, Ref<BTTask> p_to_task, int p_type);
void _on_resources_reload(const PackedStringArray &p_resources);
void _on_filesystem_changed();
void _on_new_script_pressed();
void _task_type_selected(const String &p_class_or_path);
void _copy_version_info();