From 32a53f856eeaacef1ebe8a60b41c22c2b5e6cd7e Mon Sep 17 00:00:00 2001 From: klingbolt Date: Fri, 17 Nov 2023 15:15:02 -0500 Subject: [PATCH 01/10] Call xml converter from Godot --- Icon.gd | 1 + Route.gd | 1 + Spatial.gd | 11 +++-- Spatial.tscn | 124 ++++++++++++++++++++++++++++++++++++++------------- 4 files changed, 101 insertions(+), 36 deletions(-) diff --git a/Icon.gd b/Icon.gd index 1cd9164c..cc171b55 100644 --- a/Icon.gd +++ b/Icon.gd @@ -4,6 +4,7 @@ const Waypoint = preload("res://waypoint.gd") var texture_path var waypoint: Waypoint.Icon +var category: TreeItem func set_icon_image(texture_path: String): self.texture_path = texture_path diff --git a/Route.gd b/Route.gd index 392b2ffd..24717e1e 100644 --- a/Route.gd +++ b/Route.gd @@ -5,6 +5,7 @@ const Waypoint = preload("res://waypoint.gd") var texture_path var color = Color(0.9, 0.1, 0.1) var waypoint: Waypoint.Trail +var category: TreeItem var point_list := PoolVector3Array() diff --git a/Spatial.gd b/Spatial.gd index 25350832..35f37c80 100644 --- a/Spatial.gd +++ b/Spatial.gd @@ -53,6 +53,7 @@ const path2d_scene = preload("res://Route2D.tscn") const gizmo_scene = preload("res://Gizmo/PointEdit.tscn") const CategoryData = preload("res://CategoryData.gd") const Waypoint = preload("res://waypoint.gd") +const PackDialog = preload("res://PackDialog.gd") ##########Node Connections########### onready var markers_ui := $Control/Dialogs/CategoriesDialog/MarkersUI as Tree @@ -83,6 +84,8 @@ func _ready(): if (Settings.burrito_link_auto_launch_enabled): launch_burrito_link() + + ################################################################################ @@ -634,7 +637,6 @@ func gen_new_icon(position: Vector3, texture_path: String, waypoint_icon, catego var category_data = category_item.get_metadata(0) category_data.category3d.add_icon(new_icon) - # This function take all of the currently rendered objects and converts it into # the data format that is saved/loaded from. func data_from_renderview(): @@ -744,9 +746,6 @@ func _on_main_menu_toggle_pressed(): $Control/Dialogs/MainMenu.show() set_maximal_mouse_block() -func _on_FileDialog_file_selected(path): - pass - func _on_Dialog_hide(): for dialog in $Control/Dialogs.get_children(): if dialog.visible: @@ -929,3 +928,7 @@ func _on_MarkersUI_item_edited(): var category_item = self.markers_ui.get_edited() apply_category_visibility_to_nodes(category_item) + +func _on_ImportPath_pressed(): + $Control/Dialogs/FileDialog.show() + diff --git a/Spatial.tscn b/Spatial.tscn index a661e21b..7913cb03 100644 --- a/Spatial.tscn +++ b/Spatial.tscn @@ -13,6 +13,7 @@ [ext_resource path="res://SettingsDialog.gd" type="Script" id=12] [ext_resource path="res://Category3D.gd" type="Script" id=13] [ext_resource path="res://Category2D.gd" type="Script" id=15] +[ext_resource path="res://PackDialog.gd" type="Script" id=14] [sub_resource type="Shader" id=1] code = "shader_type canvas_item; @@ -183,20 +184,48 @@ __meta__ = { } [node name="FileDialog" type="FileDialog" parent="Control/Dialogs"] -margin_left = 636.0 -margin_top = 174.0 -margin_right = 1307.0 -margin_bottom = 672.0 -window_title = "Open a File" -mode = 0 -access = 1 -current_dir = "user://" -current_path = "user://" +visible = true +margin_left = 312.0 +margin_top = 82.0 +margin_right = 983.0 +margin_bottom = 580.0 +window_title = "Open a Directory" +mode = 2 +access = 2 +current_dir = "/home/steph/Desktop/Packs" +current_path = "/home/steph/Desktop/Packs/" +script = ExtResource( 13 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="WindowDialog" type="WindowDialog" parent="Control/Dialogs/FileDialog"] +visible = true +margin_left = 108.0 +margin_top = 169.0 +margin_right = 708.0 +margin_bottom = 419.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ScrollContainer" type="ScrollContainer" parent="Control/Dialogs/FileDialog/WindowDialog"] +margin_right = 600.0 +margin_bottom = 250.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="Control/Dialogs/FileDialog/WindowDialog/ScrollContainer"] +margin_right = 100.0 +margin_bottom = 100.0 +rect_min_size = Vector2( 100, 100 ) __meta__ = { "_edit_use_anchors_": false } [node name="MainMenu" type="WindowDialog" parent="Control/Dialogs"] +visible = true margin_left = 48.0 margin_top = 82.0 margin_right = 268.0 @@ -217,51 +246,72 @@ __meta__ = { [node name="VBoxContainer" type="VBoxContainer" parent="Control/Dialogs/MainMenu/ScrollContainer"] margin_right = 220.0 -margin_bottom = 284.0 +margin_bottom = 368.0 size_flags_horizontal = 3 [node name="LoadPath" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] margin_right = 220.0 margin_bottom = 40.0 rect_min_size = Vector2( 0, 40 ) -text = "Open Markers File" +text = "Toggle Marker Visibility" -[node name="SavePath" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] +[node name="HSeparator5" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] margin_top = 44.0 margin_right = 220.0 -margin_bottom = 84.0 +margin_bottom = 48.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ImportPath" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] +margin_top = 52.0 +margin_right = 220.0 +margin_bottom = 72.0 +text = "Import Marker Pack" + +[node name="HSeparator6" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] +margin_top = 76.0 +margin_right = 220.0 +margin_bottom = 80.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SavePath" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] +margin_top = 84.0 +margin_right = 220.0 +margin_bottom = 124.0 rect_min_size = Vector2( 0, 40 ) text = "Save Markers File" [node name="HSeparator" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 88.0 +margin_top = 128.0 margin_right = 220.0 -margin_bottom = 92.0 +margin_bottom = 132.0 [node name="PointEditor" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -visible = false -margin_top = 96.0 -margin_right = 213.0 -margin_bottom = 136.0 +margin_top = 136.0 +margin_right = 220.0 +margin_bottom = 176.0 rect_min_size = Vector2( 0, 40 ) text = "Editor Panel" [node name="OpenEditorQuickPanel" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 96.0 +margin_top = 180.0 margin_right = 220.0 -margin_bottom = 136.0 +margin_bottom = 220.0 rect_min_size = Vector2( 0, 40 ) text = "Editor Panel" [node name="HSeparator3" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 140.0 +margin_top = 224.0 margin_right = 220.0 -margin_bottom = 144.0 +margin_bottom = 228.0 [node name="Ranges" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 148.0 +margin_top = 232.0 margin_right = 220.0 -margin_bottom = 188.0 +margin_bottom = 272.0 rect_min_size = Vector2( 0, 40 ) text = "Range Indicators" @@ -282,14 +332,14 @@ rect_min_size = Vector2( 0, 40 ) text = "Guacamole Script Editor" [node name="HSeparator4" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 192.0 +margin_top = 276.0 margin_right = 220.0 -margin_bottom = 196.0 +margin_bottom = 280.0 [node name="Settings" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 200.0 +margin_top = 284.0 margin_right = 220.0 -margin_bottom = 240.0 +margin_bottom = 324.0 rect_min_size = Vector2( 0, 40 ) text = "Settings" @@ -315,9 +365,9 @@ margin_bottom = 284.0 text = "Active Path" [node name="ExitButton" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 244.0 +margin_top = 328.0 margin_right = 220.0 -margin_bottom = 284.0 +margin_bottom = 368.0 rect_min_size = Vector2( 0, 40 ) text = "Exit Burrito" @@ -863,6 +913,7 @@ color = Color( 0, 0, 0, 1 ) [node name="Paths" type="Spatial" parent="."] [node name="Icons" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.106085, 0, 0 ) [node name="FeetLocation" type="Spatial" parent="."] @@ -870,6 +921,13 @@ color = Color( 0, 0, 0, 1 ) mesh = SubResource( 3 ) material/0 = SubResource( 4 ) +[node name="Control2" type="Control" parent="."] +margin_right = 40.0 +margin_bottom = 40.0 +__meta__ = { +"_edit_use_anchors_": false +} + [connection signal="pressed" from="Control/GlobalMenuButton/main_menu_toggle" to="." method="_on_main_menu_toggle_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/CloseEditorQuickPanel" to="." method="_on_CloseEditorQuickPanel_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/ChangeTexture" to="." method="_on_ChangeTexture_pressed"] @@ -877,10 +935,12 @@ material/0 = SubResource( 4 ) [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/NewPathPoint" to="." method="_on_NewPathPoint_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/NewIcon" to="." method="_on_NewIcon_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/AdjustPoints" to="." method="_on_AdjustNodesButton_pressed"] -[connection signal="file_selected" from="Control/Dialogs/FileDialog" to="." method="_on_FileDialog_file_selected"] +[connection signal="dir_selected" from="Control/Dialogs/FileDialog" to="Control/Dialogs/FileDialog" method="_on_FileDialog_dir_selected"] +[connection signal="file_selected" from="Control/Dialogs/FileDialog" to="Control/Dialogs/FileDialog" method="_on_FileDialog_file_selected"] [connection signal="hide" from="Control/Dialogs/FileDialog" to="." method="_on_Dialog_hide"] [connection signal="hide" from="Control/Dialogs/MainMenu" to="." method="_on_Dialog_hide"] [connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/LoadPath" to="." method="_on_LoadPath_pressed"] +[connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/ImportPath" to="." method="_on_ImportPath_pressed"] [connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/SavePath" to="." method="_on_SavePath_pressed"] [connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/OpenEditorQuickPanel" to="." method="_on_OpenEditorQuickPanel_pressed"] [connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/Ranges" to="." method="_on_RangesButton_pressed"] From 4df5c1bef1b9b06793089a02e6ec67d4b0454432 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Sat, 30 Dec 2023 16:55:14 -0500 Subject: [PATCH 02/10] Edit to scene from merge --- Spatial.tscn | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Spatial.tscn b/Spatial.tscn index 7913cb03..286a1a1c 100644 --- a/Spatial.tscn +++ b/Spatial.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=18 format=2] +[gd_scene load_steps=19 format=2] [ext_resource path="res://Spatial.gd" type="Script" id=1] [ext_resource path="res://shaders/range_indicators.shader" type="Shader" id=2] @@ -12,8 +12,8 @@ [ext_resource path="res://icon_new_point.png" type="Texture" id=11] [ext_resource path="res://SettingsDialog.gd" type="Script" id=12] [ext_resource path="res://Category3D.gd" type="Script" id=13] -[ext_resource path="res://Category2D.gd" type="Script" id=15] [ext_resource path="res://PackDialog.gd" type="Script" id=14] +[ext_resource path="res://Category2D.gd" type="Script" id=15] [sub_resource type="Shader" id=1] code = "shader_type canvas_item; @@ -194,17 +194,17 @@ mode = 2 access = 2 current_dir = "/home/steph/Desktop/Packs" current_path = "/home/steph/Desktop/Packs/" -script = ExtResource( 13 ) +script = ExtResource( 14 ) __meta__ = { "_edit_use_anchors_": false } [node name="WindowDialog" type="WindowDialog" parent="Control/Dialogs/FileDialog"] visible = true -margin_left = 108.0 -margin_top = 169.0 -margin_right = 708.0 -margin_bottom = 419.0 +margin_left = 8.0 +margin_top = 8.0 +margin_right = 663.0 +margin_bottom = 462.0 __meta__ = { "_edit_use_anchors_": false } From ece36df58dd96ab4834a91b158e25a255ff3d328 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Sun, 31 Dec 2023 19:20:59 -0500 Subject: [PATCH 03/10] Added method to call xml_converter --- Category2D.gd | 6 +++++ Category3D.gd | 7 ++++++ PackDialog.gd | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ Spatial.gd | 7 ++---- Spatial.tscn | 5 ++-- 5 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 PackDialog.gd diff --git a/Category2D.gd b/Category2D.gd index 79260a49..27d5fadd 100644 --- a/Category2D.gd +++ b/Category2D.gd @@ -10,3 +10,9 @@ func add_path2d(path): func add_subcategory(subcategory): self.add_child(subcategory, true) subcategories.push_back(subcategory) + +func clear_all(): + self.paths2d = [] + self.subcategories = [] + for child in self.get_children(): + child.queue_free() diff --git a/Category3D.gd b/Category3D.gd index e0eee3d6..21846e5e 100644 --- a/Category3D.gd +++ b/Category3D.gd @@ -16,3 +16,10 @@ func add_icon(icon): func add_subcategory(subcategory): self.add_child(subcategory, true) subcategories.push_back(subcategory) + +func clear_all(): + self.paths = [] + self.icons = [] + self.subcategories = [] + for child in self.get_children(): + child.queue_free() diff --git a/PackDialog.gd b/PackDialog.gd new file mode 100644 index 00000000..e611a893 --- /dev/null +++ b/PackDialog.gd @@ -0,0 +1,65 @@ +extends Control + +const executable_path: String = "./xml_converter/build/xml_converter" +var protobin_data_folder: String +var split_protobin_data_folder: String +var user_data_dir: String +onready var output_dialog = $WindowDialog +onready var output_label = $WindowDialog/ScrollContainer/Label + +func _ready(): + var dir = Directory.new() + self.user_data_dir = str(OS.get_user_data_dir()) + self.protobin_data_folder = self.user_data_dir.plus_file("packs") + self.split_protobin_data_folder = self.user_data_dir.plus_file("protobins") + if not dir.dir_exists(self.protobin_data_folder): + var success = dir.make_dir(self.protobin_data_folder) + if success != OK: + print("Error: Could not create data folder:", self.protobin_data_folder) + + +func clear_directory_contents(dir_path: String) -> void: + var dir = Directory.new() + if dir.open(dir_path) == OK: + while dir.get_next(): + var entry_path: String = dir_path + "/" + dir.get_file() + # Remove subdirectories and files, but not "." and ".." + if dir.current_is_dir() and dir.get_file() != "." and dir.get_file() != "..": + clear_directory_contents(entry_path) + # Remove the subdirectory after its contents are cleared + dir.remove(entry_path) + elif dir.current_is_file(): + dir.remove(entry_path) + else: + print("Failed to open directory:", dir_path) + +func _on_FileDialog_dir_selected(dir_path): + var output: Array = [] + print("Selected folder:", dir_path) + var dir = Directory.new() + var new_path: String = self.protobin_data_folder.plus_file(dir_path.get_file()) + if not dir.dir_exists(new_path): + var success = dir.make_dir(new_path) + if success != OK: + print("Error: Could not create data folder:", self.protobin_data_folder) + #else: + # #Pop up here to confirm overwrite? + # clear_directory_contents(dir_path) + var args: PoolStringArray = [ + "--input-taco-path", dir_path, + "--output-waypoint-path", new_path, + "--output-split-waypoint-path", self.split_protobin_data_folder] + custom_print(args) + var result: int = OS.execute(self.executable_path, args, true, output) + custom_print(output) + if result != OK: + print("Failed to execute the command. Error code:", result) + else: + print("Command executed successfully.") + +func custom_print(message: Array): + output_dialog.show() + for line in message: + output_label.text += line + "\n" + + diff --git a/Spatial.gd b/Spatial.gd index 35f37c80..b4e816e6 100644 --- a/Spatial.gd +++ b/Spatial.gd @@ -482,11 +482,8 @@ func _unhandled_input(event): ################################################################################ func clear_map_markers(): # Clear all the rendered assets to make way for the new ones - for child in self.markers_3d.get_children(): - child.queue_free() - - for child in self.markers_2d.get_children(): - child.queue_free() + self.markers_3d.clear_all() + self.markers_2d.clear_all() func init_category_tree(): self.markers_ui.clear() diff --git a/Spatial.tscn b/Spatial.tscn index 286a1a1c..df0ecaf1 100644 --- a/Spatial.tscn +++ b/Spatial.tscn @@ -936,7 +936,6 @@ __meta__ = { [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/NewIcon" to="." method="_on_NewIcon_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/AdjustPoints" to="." method="_on_AdjustNodesButton_pressed"] [connection signal="dir_selected" from="Control/Dialogs/FileDialog" to="Control/Dialogs/FileDialog" method="_on_FileDialog_dir_selected"] -[connection signal="file_selected" from="Control/Dialogs/FileDialog" to="Control/Dialogs/FileDialog" method="_on_FileDialog_file_selected"] [connection signal="hide" from="Control/Dialogs/FileDialog" to="." method="_on_Dialog_hide"] [connection signal="hide" from="Control/Dialogs/MainMenu" to="." method="_on_Dialog_hide"] [connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/LoadPath" to="." method="_on_LoadPath_pressed"] @@ -983,9 +982,9 @@ __meta__ = { [connection signal="text_changed" from="Control/Dialogs/SettingsDialog/ScrollContainer/GridContainer/WinePath" to="Control/Dialogs/SettingsDialog" method="save_settings"] [connection signal="text_changed" from="Control/Dialogs/SettingsDialog/ScrollContainer/GridContainer/EnvironmentVars" to="Control/Dialogs/SettingsDialog" method="save_settings"] [connection signal="hide" from="Control/Dialogs/CategoriesDialog" to="." method="_on_Dialog_hide"] -[connection signal="cell_selected" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_MarkerPacks_cell_selected"] [connection signal="cell_selected" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_MarkersUI_cell_selected"] -[connection signal="item_edited" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_MarkerPacks_item_edited"] +[connection signal="cell_selected" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_MarkerPacks_cell_selected"] [connection signal="item_edited" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_MarkersUI_item_edited"] +[connection signal="item_edited" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_MarkerPacks_item_edited"] [connection signal="multi_selected" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_Tree_multi_selected"] [connection signal="tree_entered" from="Control/Dialogs/CategoriesDialog/MarkersUI" to="." method="_on_Tree_tree_entered"] From c941e84bcf0d863b878102184deb27623b7f6eeb Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 1 Jan 2024 16:15:06 -0500 Subject: [PATCH 04/10] Cleaning up code --- PackDialog.gd | 26 ++---------- Spatial.gd | 3 +- Spatial.tscn | 115 ++++++++++++++++++++------------------------------ 3 files changed, 50 insertions(+), 94 deletions(-) diff --git a/PackDialog.gd b/PackDialog.gd index e611a893..0723af57 100644 --- a/PackDialog.gd +++ b/PackDialog.gd @@ -4,8 +4,8 @@ const executable_path: String = "./xml_converter/build/xml_converter" var protobin_data_folder: String var split_protobin_data_folder: String var user_data_dir: String -onready var output_dialog = $WindowDialog -onready var output_label = $WindowDialog/ScrollContainer/Label +onready var output_dialog = $OutputDialog +onready var output_label = $OutputDialog/ScrollContainer/OutputLabel func _ready(): var dir = Directory.new() @@ -17,22 +17,6 @@ func _ready(): if success != OK: print("Error: Could not create data folder:", self.protobin_data_folder) - -func clear_directory_contents(dir_path: String) -> void: - var dir = Directory.new() - if dir.open(dir_path) == OK: - while dir.get_next(): - var entry_path: String = dir_path + "/" + dir.get_file() - # Remove subdirectories and files, but not "." and ".." - if dir.current_is_dir() and dir.get_file() != "." and dir.get_file() != "..": - clear_directory_contents(entry_path) - # Remove the subdirectory after its contents are cleared - dir.remove(entry_path) - elif dir.current_is_file(): - dir.remove(entry_path) - else: - print("Failed to open directory:", dir_path) - func _on_FileDialog_dir_selected(dir_path): var output: Array = [] print("Selected folder:", dir_path) @@ -44,11 +28,11 @@ func _on_FileDialog_dir_selected(dir_path): print("Error: Could not create data folder:", self.protobin_data_folder) #else: # #Pop up here to confirm overwrite? - # clear_directory_contents(dir_path) var args: PoolStringArray = [ "--input-taco-path", dir_path, "--output-waypoint-path", new_path, - "--output-split-waypoint-path", self.split_protobin_data_folder] + "--output-split-waypoint-path", self.split_protobin_data_folder + ] custom_print(args) var result: int = OS.execute(self.executable_path, args, true, output) custom_print(output) @@ -61,5 +45,3 @@ func custom_print(message: Array): output_dialog.show() for line in message: output_label.text += line + "\n" - - diff --git a/Spatial.gd b/Spatial.gd index b4e816e6..7b17b00b 100644 --- a/Spatial.gd +++ b/Spatial.gd @@ -84,8 +84,7 @@ func _ready(): if (Settings.burrito_link_auto_launch_enabled): launch_burrito_link() - - + ################################################################################ diff --git a/Spatial.tscn b/Spatial.tscn index df0ecaf1..3f161804 100644 --- a/Spatial.tscn +++ b/Spatial.tscn @@ -183,12 +183,11 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="FileDialog" type="FileDialog" parent="Control/Dialogs"] -visible = true -margin_left = 312.0 -margin_top = 82.0 -margin_right = 983.0 -margin_bottom = 580.0 +[node name="ImportPackDialog" type="FileDialog" parent="Control/Dialogs"] +margin_left = 289.0 +margin_top = 36.0 +margin_right = 960.0 +margin_bottom = 534.0 window_title = "Open a Directory" mode = 2 access = 2 @@ -199,24 +198,23 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="WindowDialog" type="WindowDialog" parent="Control/Dialogs/FileDialog"] -visible = true -margin_left = 8.0 -margin_top = 8.0 -margin_right = 663.0 -margin_bottom = 462.0 +[node name="OutputDialog" type="WindowDialog" parent="Control/Dialogs/ImportPackDialog"] +margin_left = 689.0 +margin_top = 1.0 +margin_right = 1344.0 +margin_bottom = 455.0 __meta__ = { "_edit_use_anchors_": false } -[node name="ScrollContainer" type="ScrollContainer" parent="Control/Dialogs/FileDialog/WindowDialog"] -margin_right = 600.0 -margin_bottom = 250.0 +[node name="ScrollContainer" type="ScrollContainer" parent="Control/Dialogs/ImportPackDialog/OutputDialog"] +margin_right = 653.0 +margin_bottom = 453.0 __meta__ = { "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="Control/Dialogs/FileDialog/WindowDialog/ScrollContainer"] +[node name="OutputLabel" type="Label" parent="Control/Dialogs/ImportPackDialog/OutputDialog/ScrollContainer"] margin_right = 100.0 margin_bottom = 100.0 rect_min_size = Vector2( 100, 100 ) @@ -225,11 +223,10 @@ __meta__ = { } [node name="MainMenu" type="WindowDialog" parent="Control/Dialogs"] -visible = true -margin_left = 48.0 -margin_top = 82.0 -margin_right = 268.0 -margin_bottom = 715.0 +margin_left = 55.0 +margin_top = 60.0 +margin_right = 275.0 +margin_bottom = 693.0 window_title = "Main Menu" resizable = true __meta__ = { @@ -246,7 +243,7 @@ __meta__ = { [node name="VBoxContainer" type="VBoxContainer" parent="Control/Dialogs/MainMenu/ScrollContainer"] margin_right = 220.0 -margin_bottom = 368.0 +margin_bottom = 336.0 size_flags_horizontal = 3 [node name="LoadPath" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] @@ -266,52 +263,38 @@ __meta__ = { [node name="ImportPath" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] margin_top = 52.0 margin_right = 220.0 -margin_bottom = 72.0 +margin_bottom = 92.0 +rect_min_size = Vector2( 0, 40 ) text = "Import Marker Pack" -[node name="HSeparator6" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 76.0 -margin_right = 220.0 -margin_bottom = 80.0 -__meta__ = { -"_edit_use_anchors_": false -} - [node name="SavePath" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 84.0 +margin_top = 96.0 margin_right = 220.0 -margin_bottom = 124.0 +margin_bottom = 136.0 rect_min_size = Vector2( 0, 40 ) text = "Save Markers File" [node name="HSeparator" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 128.0 +margin_top = 140.0 margin_right = 220.0 -margin_bottom = 132.0 - -[node name="PointEditor" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 136.0 -margin_right = 220.0 -margin_bottom = 176.0 -rect_min_size = Vector2( 0, 40 ) -text = "Editor Panel" +margin_bottom = 144.0 [node name="OpenEditorQuickPanel" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 180.0 +margin_top = 148.0 margin_right = 220.0 -margin_bottom = 220.0 +margin_bottom = 188.0 rect_min_size = Vector2( 0, 40 ) text = "Editor Panel" [node name="HSeparator3" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 224.0 +margin_top = 192.0 margin_right = 220.0 -margin_bottom = 228.0 +margin_bottom = 196.0 [node name="Ranges" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 232.0 +margin_top = 200.0 margin_right = 220.0 -margin_bottom = 272.0 +margin_bottom = 240.0 rect_min_size = Vector2( 0, 40 ) text = "Range Indicators" @@ -325,21 +308,21 @@ text = "Compass" [node name="GuacamoleScript" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] visible = false -margin_top = 192.0 -margin_right = 213.0 -margin_bottom = 232.0 +margin_top = 224.0 +margin_right = 220.0 +margin_bottom = 264.0 rect_min_size = Vector2( 0, 40 ) text = "Guacamole Script Editor" [node name="HSeparator4" type="HSeparator" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 276.0 +margin_top = 244.0 margin_right = 220.0 -margin_bottom = 280.0 +margin_bottom = 248.0 [node name="Settings" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 284.0 +margin_top = 252.0 margin_right = 220.0 -margin_bottom = 324.0 +margin_bottom = 292.0 rect_min_size = Vector2( 0, 40 ) text = "Settings" @@ -359,15 +342,15 @@ __meta__ = { [node name="ActivePath" type="CheckButton" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] visible = false -margin_top = 244.0 -margin_right = 213.0 -margin_bottom = 284.0 +margin_top = 276.0 +margin_right = 220.0 +margin_bottom = 316.0 text = "Active Path" [node name="ExitButton" type="Button" parent="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer"] -margin_top = 328.0 +margin_top = 296.0 margin_right = 220.0 -margin_bottom = 368.0 +margin_bottom = 336.0 rect_min_size = Vector2( 0, 40 ) text = "Exit Burrito" @@ -913,7 +896,6 @@ color = Color( 0, 0, 0, 1 ) [node name="Paths" type="Spatial" parent="."] [node name="Icons" type="Spatial" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.106085, 0, 0 ) [node name="FeetLocation" type="Spatial" parent="."] @@ -921,13 +903,6 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.106085, 0, 0 ) mesh = SubResource( 3 ) material/0 = SubResource( 4 ) -[node name="Control2" type="Control" parent="."] -margin_right = 40.0 -margin_bottom = 40.0 -__meta__ = { -"_edit_use_anchors_": false -} - [connection signal="pressed" from="Control/GlobalMenuButton/main_menu_toggle" to="." method="_on_main_menu_toggle_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/CloseEditorQuickPanel" to="." method="_on_CloseEditorQuickPanel_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/ChangeTexture" to="." method="_on_ChangeTexture_pressed"] @@ -935,8 +910,8 @@ __meta__ = { [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/NewPathPoint" to="." method="_on_NewPathPoint_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/NewIcon" to="." method="_on_NewIcon_pressed"] [connection signal="pressed" from="Control/GlobalMenuButton/EditorQuckPanel/HBoxContainer/AdjustPoints" to="." method="_on_AdjustNodesButton_pressed"] -[connection signal="dir_selected" from="Control/Dialogs/FileDialog" to="Control/Dialogs/FileDialog" method="_on_FileDialog_dir_selected"] -[connection signal="hide" from="Control/Dialogs/FileDialog" to="." method="_on_Dialog_hide"] +[connection signal="dir_selected" from="Control/Dialogs/ImportPackDialog" to="Control/Dialogs/ImportPackDialog" method="_on_FileDialog_dir_selected"] +[connection signal="hide" from="Control/Dialogs/ImportPackDialog" to="." method="_on_Dialog_hide"] [connection signal="hide" from="Control/Dialogs/MainMenu" to="." method="_on_Dialog_hide"] [connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/LoadPath" to="." method="_on_LoadPath_pressed"] [connection signal="pressed" from="Control/Dialogs/MainMenu/ScrollContainer/VBoxContainer/ImportPath" to="." method="_on_ImportPath_pressed"] From ec1df3211497bc6cf950671d3eee466287bb0ed7 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 1 Jan 2024 16:21:17 -0500 Subject: [PATCH 05/10] Added lines to ensure that the split folder is made correctly --- PackDialog.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PackDialog.gd b/PackDialog.gd index 0723af57..5a42854d 100644 --- a/PackDialog.gd +++ b/PackDialog.gd @@ -16,6 +16,10 @@ func _ready(): var success = dir.make_dir(self.protobin_data_folder) if success != OK: print("Error: Could not create data folder:", self.protobin_data_folder) + if not dir.dir_exists(self.split_protobin_data_folder): + var success = dir.make_dir(self.split_protobin_data_folder) + if success != OK: + print("Error: Could not create data folder:", self.split_protobin_data_folder) func _on_FileDialog_dir_selected(dir_path): var output: Array = [] From 89fe1edcfbf9ade8c5089f8e62ac099e5014be20 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 1 Jan 2024 16:55:01 -0500 Subject: [PATCH 06/10] Renamed reference to node --- Spatial.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spatial.gd b/Spatial.gd index 7b17b00b..f5889c02 100644 --- a/Spatial.gd +++ b/Spatial.gd @@ -926,5 +926,5 @@ func _on_MarkersUI_item_edited(): func _on_ImportPath_pressed(): - $Control/Dialogs/FileDialog.show() + $Control/Dialogs/ImportPackDialog.show() From 3adf80a60bf20f4e1313b07ca4fbef23cdc7d04c Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 1 Jan 2024 16:59:00 -0500 Subject: [PATCH 07/10] Removed dev data --- Spatial.tscn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spatial.tscn b/Spatial.tscn index 3f161804..9cc664c7 100644 --- a/Spatial.tscn +++ b/Spatial.tscn @@ -191,8 +191,8 @@ margin_bottom = 534.0 window_title = "Open a Directory" mode = 2 access = 2 -current_dir = "/home/steph/Desktop/Packs" -current_path = "/home/steph/Desktop/Packs/" +current_dir = "" +current_path = "" script = ExtResource( 14 ) __meta__ = { "_edit_use_anchors_": false From 96c3fef44510cc64ad0b02f0fe91d315b046643d Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 1 Jan 2024 17:13:36 -0500 Subject: [PATCH 08/10] removed indent --- PackDialog.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PackDialog.gd b/PackDialog.gd index 5a42854d..b0e21258 100644 --- a/PackDialog.gd +++ b/PackDialog.gd @@ -36,7 +36,7 @@ func _on_FileDialog_dir_selected(dir_path): "--input-taco-path", dir_path, "--output-waypoint-path", new_path, "--output-split-waypoint-path", self.split_protobin_data_folder - ] + ] custom_print(args) var result: int = OS.execute(self.executable_path, args, true, output) custom_print(output) From f103c4b24329686a42f3f2e26a265dcf16dee0b5 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 1 Jan 2024 21:25:52 -0500 Subject: [PATCH 09/10] Removing custom print for now --- PackDialog.gd | 13 +++---------- Spatial.tscn | 24 ------------------------ 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/PackDialog.gd b/PackDialog.gd index b0e21258..10b86f2e 100644 --- a/PackDialog.gd +++ b/PackDialog.gd @@ -4,8 +4,6 @@ const executable_path: String = "./xml_converter/build/xml_converter" var protobin_data_folder: String var split_protobin_data_folder: String var user_data_dir: String -onready var output_dialog = $OutputDialog -onready var output_label = $OutputDialog/ScrollContainer/OutputLabel func _ready(): var dir = Directory.new() @@ -37,15 +35,10 @@ func _on_FileDialog_dir_selected(dir_path): "--output-waypoint-path", new_path, "--output-split-waypoint-path", self.split_protobin_data_folder ] - custom_print(args) - var result: int = OS.execute(self.executable_path, args, true, output) - custom_print(output) + print(args) + var result: int = OS.execute(self.executable_path, args, true, output, true) + print(output) if result != OK: print("Failed to execute the command. Error code:", result) else: print("Command executed successfully.") - -func custom_print(message: Array): - output_dialog.show() - for line in message: - output_label.text += line + "\n" diff --git a/Spatial.tscn b/Spatial.tscn index 9cc664c7..a220578a 100644 --- a/Spatial.tscn +++ b/Spatial.tscn @@ -198,30 +198,6 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="OutputDialog" type="WindowDialog" parent="Control/Dialogs/ImportPackDialog"] -margin_left = 689.0 -margin_top = 1.0 -margin_right = 1344.0 -margin_bottom = 455.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="ScrollContainer" type="ScrollContainer" parent="Control/Dialogs/ImportPackDialog/OutputDialog"] -margin_right = 653.0 -margin_bottom = 453.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="OutputLabel" type="Label" parent="Control/Dialogs/ImportPackDialog/OutputDialog/ScrollContainer"] -margin_right = 100.0 -margin_bottom = 100.0 -rect_min_size = Vector2( 100, 100 ) -__meta__ = { -"_edit_use_anchors_": false -} - [node name="MainMenu" type="WindowDialog" parent="Control/Dialogs"] margin_left = 55.0 margin_top = 60.0 From 6480614b3c5dfddfb6728a9ddc33e1959749ec5e Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 1 Jan 2024 21:45:14 -0500 Subject: [PATCH 10/10] Removed extra line --- Spatial.gd | 1 - 1 file changed, 1 deletion(-) diff --git a/Spatial.gd b/Spatial.gd index f5889c02..9cdafcf0 100644 --- a/Spatial.gd +++ b/Spatial.gd @@ -86,7 +86,6 @@ func _ready(): launch_burrito_link() - ################################################################################ # show_error #