mlpcardgame/Scenes/Global/Mods.gd

16 lines
493 B
GDScript

extends Node
func _ready():
# Search for all available packs in the same folder and load them all!
var dir := Directory.new()
dir.list_dir_begin(true, true)
while true:
var next := dir.get_next()
if next == "":
break
if next.ends_with(".pck") or next.ends_with(".zip"):
# Found pck, load it!
print("Found pck/zip: ", next, "")
var success := ProjectSettings.load_resource_pack("res://" + next)
if not success:
print("[ERR] Could not load ", next, ", ignoring it")