Skip to content

Commit d41ec4e

Browse files
committed
Add editor property to start debugger in detached mode, closes #400
1 parent 2f6c7c0 commit d41ec4e

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

addons/beehave/debug/debugger_tab.gd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func _build_ui() -> void:
5858
blackboard_vbox.hide()
5959
graph_container.add_child(blackboard_vbox)
6060

61-
# Run Project for debugging overlay
61+
# "Run Project for debugging" overlay
6262
message = Label.new()
6363
message.text = "Run Project for debugging"
6464
message.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
@@ -81,7 +81,7 @@ func _init_graph() -> void:
8181
graph_container.add_child(graph)
8282
graph_container.move_child(graph, 0)
8383

84-
# Make Floating button
84+
# "Make Floating" button
8585
var float_btn = Button.new()
8686
float_btn.name = "MakeFloatingButton"
8787
float_btn.flat = true
@@ -92,7 +92,7 @@ func _init_graph() -> void:
9292
)
9393
graph.get_menu_container().add_child(float_btn)
9494

95-
# Toggle Panel button
95+
# "Toggle Panel" button
9696
var toggle_btn = Button.new()
9797
toggle_btn.name = "TogglePanelButton"
9898
toggle_btn.flat = true
@@ -117,6 +117,10 @@ func start() -> void:
117117
get_tree().create_timer(delay).timeout.connect(_notify_state)
118118
else:
119119
_notify_state()
120+
121+
# Auto-detach if enabled in project settings - check every time
122+
if ProjectSettings.get_setting("beehave/debugger/start_detached", false):
123+
emit_signal("make_floating")
120124

121125

122126
func _notify_state() -> void:

addons/beehave/plugin.gd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ func _init():
1010
name = "BeehavePlugin"
1111
add_autoload_singleton("BeehaveGlobalMetrics", "metrics/beehave_global_metrics.gd")
1212
add_autoload_singleton("BeehaveGlobalDebugger", "debug/global_debugger.gd")
13+
14+
# Add project settings
15+
if not ProjectSettings.has_setting("beehave/debugger/start_detached"):
16+
ProjectSettings.set_setting("beehave/debugger/start_detached", false)
17+
ProjectSettings.set_initial_value("beehave/debugger/start_detached", false)
18+
ProjectSettings.add_property_info({
19+
"name": "beehave/debugger/start_detached",
20+
"type": TYPE_BOOL,
21+
"hint": PROPERTY_HINT_NONE,
22+
"hint_string": "If enabled, the debugger will start in a separate window",
23+
"usage": PROPERTY_USAGE_DEFAULT
24+
})
25+
ProjectSettings.save()
26+
1327
print("Beehave initialized!")
1428

1529

project.godot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ config/icon="res://icon.png"
2222
BeehaveGlobalMetrics="*res://addons/beehave/metrics/beehave_global_metrics.gd"
2323
BeehaveGlobalDebugger="*res://addons/beehave/debug/global_debugger.gd"
2424

25+
[beehave]
26+
27+
debugger/start_detached=true
28+
2529
[dotnet]
2630

2731
project/assembly_name="Beehave"

0 commit comments

Comments
 (0)