Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions addons/beehave/debug/debugger_tab.gd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func _build_ui() -> void:
blackboard_vbox.hide()
graph_container.add_child(blackboard_vbox)

# Run Project for debugging overlay
# "Run Project for debugging" overlay
message = Label.new()
message.text = "Run Project for debugging"
message.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
Expand All @@ -81,7 +81,7 @@ func _init_graph() -> void:
graph_container.add_child(graph)
graph_container.move_child(graph, 0)

# Make Floating button
# "Make Floating" button
var float_btn = Button.new()
float_btn.name = "MakeFloatingButton"
float_btn.flat = true
Expand All @@ -92,7 +92,7 @@ func _init_graph() -> void:
)
graph.get_menu_container().add_child(float_btn)

# Toggle Panel button
# "Toggle Panel" button
var toggle_btn = Button.new()
toggle_btn.name = "TogglePanelButton"
toggle_btn.flat = true
Expand All @@ -117,6 +117,10 @@ func start() -> void:
get_tree().create_timer(delay).timeout.connect(_notify_state)
else:
_notify_state()

# Auto-detach if enabled in project settings - check every time
if ProjectSettings.get_setting("beehave/debugger/start_detached", false):
emit_signal("make_floating")


func _notify_state() -> void:
Expand Down
14 changes: 14 additions & 0 deletions addons/beehave/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ func _init():
name = "BeehavePlugin"
add_autoload_singleton("BeehaveGlobalMetrics", "metrics/beehave_global_metrics.gd")
add_autoload_singleton("BeehaveGlobalDebugger", "debug/global_debugger.gd")

# Add project settings
if not ProjectSettings.has_setting("beehave/debugger/start_detached"):
ProjectSettings.set_setting("beehave/debugger/start_detached", false)
ProjectSettings.set_initial_value("beehave/debugger/start_detached", false)
ProjectSettings.add_property_info({
"name": "beehave/debugger/start_detached",
"type": TYPE_BOOL,
"hint": PROPERTY_HINT_NONE,
"hint_string": "If enabled, the debugger will start in a separate window",
"usage": PROPERTY_USAGE_DEFAULT
})
ProjectSettings.save()

print("Beehave initialized!")


Expand Down
4 changes: 4 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ config/icon="res://icon.png"
BeehaveGlobalMetrics="*res://addons/beehave/metrics/beehave_global_metrics.gd"
BeehaveGlobalDebugger="*res://addons/beehave/debug/global_debugger.gd"

[beehave]

debugger/start_detached=false

[dotnet]

project/assembly_name="Beehave"
Expand Down