update spriteData.json

This commit is contained in:
Fabian Dill
2021-03-13 01:56:31 +01:00
parent 77ffda031c
commit 6e129c3421
346 changed files with 236 additions and 126 deletions

View File

@@ -5,7 +5,8 @@ import threading
input_dir = local_path("data", "sprites", "alttpr")
output_dir = local_path("WebHostLib", "static", "static")
#update sprites through gui.py's functions
os.makedirs(os.path.join(output_dir, "sprites"), exist_ok=True)
# update sprites through gui.py's functions
done = threading.Event()
top = Tk()
top.withdraw()
@@ -21,11 +22,10 @@ for file in os.listdir(input_dir):
sprite = Sprite(os.path.join(input_dir, file))
if not sprite.name:
print("Warning:",file,"has no name.")
print("Warning:", file, "has no name.")
sprite.name = file.split(".", 1)[0]
if sprite.valid:
with open(os.path.join(output_dir, "sprites", f"{sprite.name}.gif"), 'wb') as image:
with open(os.path.join(output_dir, "sprites", f"{os.path.splitext(file)[0]}.gif"), 'wb') as image:
image.write(get_image_for_sprite(sprite, True))
spriteData.append({"file": file, "author": sprite.author_name, "name": sprite.name})
else: