From 48ba04b7e69a604a3b779a6aaa5b2babd294cabd Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 9 Dec 2022 23:58:04 +0100 Subject: [PATCH] prepare export functionality --- src/dev-util/ingest_board.gd | 7 +++++++ src/dev-util/ingest_board.tscn | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/dev-util/ingest_board.gd b/src/dev-util/ingest_board.gd index 67e7ad6..6d4d4b6 100644 --- a/src/dev-util/ingest_board.gd +++ b/src/dev-util/ingest_board.gd @@ -41,3 +41,10 @@ func copy(buffer): func paste(): return copybuffer + + +func _on_save_pressed(): + var save_story = File.new() + save_story.open("res://dev-util/export.save", File.WRITE) + var save_nodes = $board + save_story.store_line(to_json(save_nodes)) diff --git a/src/dev-util/ingest_board.tscn b/src/dev-util/ingest_board.tscn index cb292e1..618a3f3 100644 --- a/src/dev-util/ingest_board.tscn +++ b/src/dev-util/ingest_board.tscn @@ -66,4 +66,12 @@ margin_right = 87.0 margin_bottom = 37.0 text = "add Story" +[node name="save" type="Button" parent="."] +margin_left = 1833.0 +margin_top = 26.0 +margin_right = 1874.0 +margin_bottom = 46.0 +text = "Save" + [connection signal="pressed" from="add story" to="." method="_on_add_story_pressed"] +[connection signal="pressed" from="save" to="." method="_on_save_pressed"]