Add true portable mode (#259)

This commit is contained in:
Jeod
2025-09-26 15:32:42 -04:00
committed by GitHub
parent 7b0a62c765
commit 659e9f3ce8
28 changed files with 176 additions and 96 deletions

View File

@@ -26,7 +26,7 @@ func get_resource(resource: Resource) -> Resource:
if original_resource is Texture:
var new_resource = null
if path.contains("user://"):
if path.contains(Global.config_path):
new_resource = ImageTexture.create_from_image(Image.load_from_file(path))
else:
new_resource = load(path)
@@ -64,7 +64,7 @@ func send_to_cache(resource_path := "", resource_to_cache: Resource = null) -> v
func get_resource_path(resource_path := "") -> String:
for i in Settings.file.visuals.resource_packs:
var test = resource_path.replace("res://Assets/", "user://resource_packs/" + i + "/")
var test = resource_path.replace("res://Assets/", Global.config_path.path_join("resource_packs/" + i + "/"))
if FileAccess.file_exists(test):
return test
return resource_path