From f4e07d090cded56ebab54363f1b47f1ea45c8682 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 20 Dec 2024 11:42:22 +0100 Subject: next commit --- extractor/grf.gd | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'extractor') 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) -- cgit v1.2.3