summaryrefslogtreecommitdiff
path: root/extractor/grf.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-12-20 11:42:22 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-12-20 11:42:22 +0100
commitf4e07d090cded56ebab54363f1b47f1ea45c8682 (patch)
tree616698bb4306184469b92d68d3f74dfb61d02c72 /extractor/grf.gd
parent75793bd23d275d10d6a0bd8024a7e412b64557ce (diff)
next commitHEADmain
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)