Merge branch 'master' of https://github.com/berserker66/MultiWorld-Utilities
2
Rom.py
|
@ -2306,7 +2306,7 @@ def set_inverted_mode(world, player, rom):
|
||||||
rom.write_byte(0x1607C + 0x06, 0xF2)
|
rom.write_byte(0x1607C + 0x06, 0xF2)
|
||||||
rom.write_int16(0x160CB + 2 * 0x06, 0x0000)
|
rom.write_int16(0x160CB + 2 * 0x06, 0x0000)
|
||||||
rom.write_int16(0x16169 + 2 * 0x06, 0x0000)
|
rom.write_int16(0x16169 + 2 * 0x06, 0x0000)
|
||||||
rom.write_int16(snes_to_pc(0x02E87B), 0x00AE) # move flute splot 9
|
rom.write_int16(snes_to_pc(0x02E87B), 0x00AE) # move flute spot 9
|
||||||
rom.write_int16(snes_to_pc(0x02E89D), 0x0610)
|
rom.write_int16(snes_to_pc(0x02E89D), 0x0610)
|
||||||
rom.write_int16(snes_to_pc(0x02E8BF), 0x077E)
|
rom.write_int16(snes_to_pc(0x02E8BF), 0x077E)
|
||||||
rom.write_int16(snes_to_pc(0x02E8E1), 0x0672)
|
rom.write_int16(snes_to_pc(0x02E8E1), 0x0672)
|
||||||
|
|
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 541 B |
|
@ -1,39 +1,35 @@
|
||||||
import argparse
|
from Gui import *
|
||||||
import json
|
import threading
|
||||||
from os import listdir
|
|
||||||
from os.path import isfile, join
|
|
||||||
from Rom import Sprite
|
|
||||||
from Gui import get_image_for_sprite
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Dump sprite data and .png files to a directory.')
|
|
||||||
parser.add_argument('-i')
|
|
||||||
parser.add_argument('-o')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
if not args.i or not args.o:
|
|
||||||
print('Invalid arguments provided. -i and -o are required.')
|
|
||||||
exit()
|
|
||||||
|
|
||||||
# Target directories
|
# Target directories
|
||||||
input_dir = args.i
|
input_dir = local_path("data", "sprites", "alttpr")
|
||||||
output_dir = args.o
|
output_dir = local_path("WebHostLib", "static", "static")
|
||||||
|
|
||||||
# Get a list of all files in the input directory
|
#update sprites through gui.py's functions
|
||||||
targetFiles = [file for file in listdir(input_dir) if isfile(join(input_dir, file))]
|
done = threading.Event()
|
||||||
|
top = Tk()
|
||||||
|
top.withdraw()
|
||||||
|
BackgroundTaskProgress(top, update_sprites, "Updating Sprites", lambda succesful, resultmessage: done.set())
|
||||||
|
while not done.isSet():
|
||||||
|
top.update()
|
||||||
|
|
||||||
|
print("Done updating sprites")
|
||||||
|
|
||||||
spriteData = {}
|
spriteData = {}
|
||||||
|
|
||||||
for file in targetFiles:
|
for file in os.listdir(input_dir):
|
||||||
if file[-5:] != '.zspr':
|
sprite = Sprite(os.path.join(input_dir, file))
|
||||||
continue
|
|
||||||
|
|
||||||
sprite = Sprite(join(input_dir, file))
|
if not sprite.name:
|
||||||
spriteData[sprite.name] = file
|
print("Warning:",file,"has no name.")
|
||||||
|
sprite.name = file.split(".", 1)[0]
|
||||||
|
|
||||||
image = open(f'{output_dir}/{sprite.name}.gif', 'wb')
|
if sprite.valid:
|
||||||
|
with open(os.path.join(output_dir, "sprites", f"{sprite.name}.gif"), 'wb') as image:
|
||||||
image.write(get_image_for_sprite(sprite, True))
|
image.write(get_image_for_sprite(sprite, True))
|
||||||
image.close()
|
spriteData[sprite.name] = file
|
||||||
|
else:
|
||||||
|
print(file, "dropped, as it has no valid sprite data.")
|
||||||
|
|
||||||
jsonFile = open(f'{output_dir}/spriteData.json', 'w')
|
with open(f'{output_dir}/spriteData.json', 'w') as file:
|
||||||
jsonFile.write(json.dumps(spriteData))
|
json.dump(spriteData, file)
|
||||||
jsonFile.close()
|
|
||||||
|
|