Skip to content

Commit

Permalink
Main panel: Print generated script through button
Browse files Browse the repository at this point in the history
Repurpose the test button to print the generated script, instead of
doing it each time the f key is pressed.
  • Loading branch information
manuq committed Jun 14, 2024
1 parent 8db625c commit 4db65bd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions addons/block_code/ui/main_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func _ready():


func _on_button_pressed():
pass
_print_generated_script()


func switch_script(block_code_node: BlockCode):
Expand Down Expand Up @@ -74,11 +74,10 @@ func _input(event):
else:
_drag_manager.drag_ended()

# HACK: play the topmost block
if event is InputEventKey:
if event.keycode == KEY_F and event.pressed:
if _current_bsd:
var script: String = _block_canvas.generate_script_from_current_window(_current_bsd.script_inherits)

print(script)
print("Debug script! (not saved)")
func _print_generated_script():
if _current_bsd == null:
return
var script: String = _block_canvas.generate_script_from_current_window(_current_bsd.script_inherits)
print(script)
print("Debug script! (not saved)")

0 comments on commit 4db65bd

Please sign in to comment.