Debugger refactoring and test project cleanup

This commit is contained in:
Serhii Snitsaruk 2023-04-14 10:28:33 +02:00
parent a6a11f56d9
commit 0e2f4930e8
7 changed files with 9 additions and 12 deletions

View File

@ -28,17 +28,14 @@ private:
TextureRect *info_icon; TextureRect *info_icon;
Label *info_message; Label *info_message;
_FORCE_INLINE_ void _set_info_message(const String &p_message); void _set_info_message(const String &p_message);
void _bt_selected(int p_idx); void _bt_selected(int p_idx);
protected:
// void _notification(int p_notification);
public: public:
void start_session(); void start_session();
void stop_session(); void stop_session();
void update_bt_list(const Array &p_items); void update_bt_list(const Array &p_items);
BehaviorTreeView *get_behavior_tree_view() { return bt_view; } BehaviorTreeView *get_behavior_tree_view() const { return bt_view; }
LimboDebuggerTab(Ref<EditorDebuggerSession> p_session); LimboDebuggerTab(Ref<EditorDebuggerSession> p_session);
}; };

View File

@ -17,7 +17,7 @@ func _tick(p_delta: float) -> int:
var target_pos: Vector2 = blackboard.get_var(target_position_var, Vector2.ZERO) var target_pos: Vector2 = blackboard.get_var(target_position_var, Vector2.ZERO)
if target_pos.distance_to(agent.global_position) < tolerance: if target_pos.distance_to(agent.global_position) < tolerance:
return SUCCESS return SUCCESS
var speed: float = blackboard.get_var(speed_var, 10.0) var speed: float = blackboard.get_var(speed_var, 10.0)
var dir: Vector2 = agent.global_position.direction_to(target_pos) var dir: Vector2 = agent.global_position.direction_to(target_pos)
agent.global_position += dir * speed * p_delta agent.global_position += dir * speed * p_delta

View File

@ -9,7 +9,7 @@ var _finished: bool
func _generate_name() -> String: func _generate_name() -> String:
return "PlayAnimation \"%s\"" % animation_name return "PlayAnimation \"%s\"" % animation_name
func _setup() -> void: func _setup() -> void:

View File

@ -8,7 +8,7 @@ var _player: AnimationPlayer
func _generate_name() -> String: func _generate_name() -> String:
return "StartAnimation \"%s\"" % animation_name return "StartAnimation \"%s\"" % animation_name
func _setup() -> void: func _setup() -> void:

View File

@ -12,7 +12,7 @@ config_version=5
config/name="LimboAI Test" config/name="LimboAI Test"
run/main_scene="res://tests/waypoints/test_waypoints.tscn" run/main_scene="res://tests/waypoints/test_waypoints.tscn"
config/features=PackedStringArray("4.0") config/features=PackedStringArray("4.1")
config/icon="res://icon.png" config/icon="res://icon.png"
[gui] [gui]

View File

@ -46,7 +46,7 @@ script = ExtResource("1_1l3ql")
[node name="BTPlayer" type="BTPlayer" parent="."] [node name="BTPlayer" type="BTPlayer" parent="."]
behavior_tree = ExtResource("2_ijwrx") behavior_tree = ExtResource("2_ijwrx")
_blackboard_data = { _blackboard_data = {
"speed": 500.0 "speed": 200.0
} }
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="Sprite2D" type="Sprite2D" parent="."]

View File

@ -6,10 +6,10 @@ extends Node2D
func _ready() -> void: func _ready() -> void:
var waypoints: Array[Node] = $Waypoints.get_children() var waypoints: Array[Node] = $Waypoints.get_children()
for wp in waypoints: for wp in waypoints:
agent.add_waypoint(wp.global_position) agent.add_waypoint(wp.global_position)
waypoints.reverse() waypoints.reverse()
for wp in waypoints: for wp in waypoints:
agent_2.add_waypoint(wp.global_position) agent_2.add_waypoint(wp.global_position)