summaryrefslogtreecommitdiff
path: root/extractor/grf.gd
diff options
context:
space:
mode:
Diffstat (limited to 'extractor/grf.gd')
-rw-r--r--extractor/grf.gd12
1 files changed, 7 insertions, 5 deletions
diff --git a/extractor/grf.gd b/extractor/grf.gd
index 9917a74..08f72ee 100644
--- a/extractor/grf.gd
+++ b/extractor/grf.gd
@@ -190,23 +190,25 @@ static func open(path: String):
return grf
-func extract(destination: String = "res://data"):
+func extract(destination: String = "user://client_data"):
+ DirAccess.make_dir_recursive_absolute(destination)
+
for file_entry in file_entries:
var file_path: String = file_entry.get_file_path()
var base_directory = DirAccess.open(destination)
- base_directory.make_dir_recursive("extracted/" + file_path.get_base_dir())
+ base_directory.make_dir_recursive(file_path.get_base_dir())
- var file = FileAccess.open("%s/extracted/%s" % [destination, file_path], FileAccess.WRITE_READ)
+ var file = FileAccess.open("%s/%s" % [destination, file_path], FileAccess.WRITE_READ)
file.store_buffer(file_entry.get_contents(file_access))
-func convert(destination: String = "res://data"):
+func convert(destination: String = "res://client_data"):
for file_entry in file_entries:
var file_path: String = file_entry.get_file_path()
var base_directory = DirAccess.open(destination)
- var base_directory_path = "extracted/%s" % file_path.get_base_dir()
+ var base_directory_path = "%s" % file_path.get_base_dir()
base_directory.make_dir_recursive(base_directory_path)
base_directory.change_dir(base_directory_path)