diff --git a/src/dev-util/ingest connection.tscn b/src/dev-util/ingest connection.tscn index 40b1067..92f682e 100644 --- a/src/dev-util/ingest connection.tscn +++ b/src/dev-util/ingest connection.tscn @@ -16,6 +16,14 @@ func _on_card_paster_pressed(): var tmp = get_tree().root.get_child(0).paste() if tmp != null: select(tmp) + +func save(): + return { + id = self.get_instance_id(), + weight1 = $first_weight.value, + weight2 = $second_weight.value, + postit = post_it.get_instance_id() + } " [node name="Ingest Connection" type="VBoxContainer"] @@ -25,7 +33,7 @@ margin_top = 1.0 margin_right = -1838.0 script = SubResource( 1 ) -[node name="first_weoght" type="HSlider" parent="."] +[node name="first_weight" type="HSlider" parent="."] margin_right = 120.0 margin_bottom = 16.0 rect_min_size = Vector2( 120, 0 ) diff --git a/src/dev-util/ingest post-it.tscn b/src/dev-util/ingest post-it.tscn index 249460d..6319922 100644 --- a/src/dev-util/ingest post-it.tscn +++ b/src/dev-util/ingest post-it.tscn @@ -8,6 +8,13 @@ func _on_audio_button_up(): func _on_copy_pressed(): get_tree().root.get_child(0).copy(self) + +func save(): + return { + id = self.get_instance_id(), + text = $LineEdit.text + # TODO: Save audio + } " [node name="Ingest Post-It" type="VBoxContainer"] diff --git a/src/dev-util/ingest_board.gd b/src/dev-util/ingest_board.gd index 6d4d4b6..813b562 100644 --- a/src/dev-util/ingest_board.gd +++ b/src/dev-util/ingest_board.gd @@ -44,7 +44,24 @@ func paste(): 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)) + var save_stories = File.new() + save_stories.open("res://dev-util/export.save", File.WRITE) + var stories = [] + for story in story_list.get_children(): + stories.append(story.save()) + var cards = [] + for card in all_cards: + cards.append(card.save()) + var postits = [] + for postit in all_post_its: + postits.append(postit.save()) + var connections = [] + for connection in connections_list.get_children(): + connections.append(connection.save()) + var save_dict = { + stories = stories, + cards = cards, + postits = postits, + connections = connections + } + save_stories.store_line(to_json(save_dict)) diff --git a/src/dev-util/ingest_card.tscn b/src/dev-util/ingest_card.tscn index c04f296..df623d0 100644 --- a/src/dev-util/ingest_card.tscn +++ b/src/dev-util/ingest_card.tscn @@ -35,6 +35,21 @@ func push_children(): func _on_choose_Audio_button_down(): $FileDialog.show() $FileDialog.rect_size = Vector2(250,250) + +func save(): + var postits_export = [] + for postit in post_its: + postits_export.append(postit.get_instance_id()) + var connections_export = [] + for conn in connections: + connections_export.append(conn.get_instance_id()) + return { + id = self.get_instance_id(), + text = $LineEdit.text, + postits = postits_export, + connections = connections_export + # TODO: save audio + } " [node name="Ingest Card" type="VBoxContainer"] @@ -76,7 +91,6 @@ margin_bottom = 20.0 text = "choose Audio" [node name="FileDialog" type="FileDialog" parent="."] -visible = true margin_top = 70.0 margin_right = 304.0 margin_bottom = 320.0 diff --git a/src/dev-util/ingest_story.tscn b/src/dev-util/ingest_story.tscn index 14a81e2..bdd135d 100644 --- a/src/dev-util/ingest_story.tscn +++ b/src/dev-util/ingest_story.tscn @@ -23,6 +23,18 @@ func _on_audio_select_pressed(): $FileDialog.show() $FileDialog.size.x = 250 $FileDialog.size.y = 250 + +func save(): + var cards_export = [] + for card in cards: + cards_export.append(card.get_instance_id()) + return { + id = self.get_instance_id(), + name = $LineEdit.text, + story = $TextEdit.text, + cards = cards_export + # TODO: save audio + } " [node name="Ingest Story" type="VBoxContainer"]