Skip to content

Commit

Permalink
fixed function that calls only one program to only call that program.…
Browse files Browse the repository at this point in the history
… Edited comments
  • Loading branch information
klingbolt committed May 17, 2024
1 parent bccee54 commit e333616
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions FileHandler.gd
Original file line number Diff line number Diff line change
@@ -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.")

Expand Down
6 changes: 2 additions & 4 deletions ImportPackDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

0 comments on commit e333616

Please sign in to comment.