From e333616874b86752a2acbcea480295f150a09d27 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Fri, 17 May 2024 19:01:45 -0400 Subject: [PATCH] fixed function that calls only one program to only call that program. Edited comments --- FileHandler.gd | 6 +++--- ImportPackDialog.gd | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/FileHandler.gd b/FileHandler.gd index a1f6bcc5..3f018386 100644 --- a/FileHandler.gd +++ b/FileHandler.gd @@ -1,10 +1,10 @@ -static func call_xml_converter(executable_path: String, args: PoolStringArray): +static func call_xml_converter(args: PoolStringArray): var output: Array = [] print(args) - var result: int = OS.execute(executable_path, args, true, output, true) + var result: int = OS.execute("./xml_converter/build/xml_converter", args, true, output, true) print(output) if result != OK: - print("Failed to execute the command. Error code:", result) + print("Failed to execute the converter. Error code:", result) else: print("Command executed successfully.") diff --git a/ImportPackDialog.gd b/ImportPackDialog.gd index 5e26a9f0..3db05f00 100644 --- a/ImportPackDialog.gd +++ b/ImportPackDialog.gd @@ -4,9 +4,9 @@ const FileHandler = preload("res://FileHandler.gd") var downloaded_markers_dir: String var unsaved_markers_dir: String var user_data_dir: String -var executable_path: String = "./xml_converter/build/xml_converter" func _ready(): + #TODO: Move these to global file Settings so they can be customized self.user_data_dir = str(OS.get_user_data_dir()) self.downloaded_markers_dir = self.user_data_dir.plus_file("packs") self.unsaved_markers_dir = self.user_data_dir.plus_file("protobins") @@ -17,11 +17,9 @@ func _on_FileDialog_dir_selected(dir_path: String): print("Selected folder:", dir_path) var new_path: String = self.downloaded_markers_dir.plus_file(dir_path.get_file()) FileHandler.create_directory_if_missing(new_path) - #else: - # #Pop up here to confirm overwrite? var args: PoolStringArray = [ "--input-taco-path", dir_path, "--output-waypoint-path", new_path, "--output-split-waypoint-path", self.unsaved_markers_dir ] - FileHandler.call_xml_converter(self.executable_path, args) + FileHandler.call_xml_converter(args)