Allow drag and drop

This commit is contained in:
MegaMech 2022-04-30 22:42:51 -07:00 committed by GitHub
parent d0c5e7aa0e
commit 49f17b46d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
# Place a rom in this directory then run the script.
# If you are using multiple roms, the script will let you choose one.
# To choose with a commandline argument:
# Python3 extract_assets.py <number>
# Python3 extract_assets.py <rom_name>
# Invalid input results in the first rom being selected
import json, os, signal, time, sys, shutil, glob
@ -93,16 +93,9 @@ def main():
# If commandline args exist
if (len(sys.argv) > 1):
try:
if ((int(sys.argv[1]) - 1) < 1):
romToUse = roms[0]
elif ((int(sys.argv[1]) - 1) > len(roms)):
romToUse = roms[len(roms) - 1]
else:
romToUse = roms[int(sys.argv[1]) - 1]
romToUse = sys.argv[1]
except:
romToUse = roms[0]
print("Error with rom inputted via argument")
# No commandline args, select rom using user input
else:
@ -132,13 +125,12 @@ def main():
else:
romToUse = roms[0]
match checkChecksum(romToUse):
case Checksums.OOT_PAL_GC:
xmlVer = "GC_NMQ_PAL_F"
case Checksums.OOT_PAL_GC_DBG1:
xmlVer = "GC_NMQ_D"
case _: # default case
xmlVer = "GC_MQ_D"
if checkChecksum(romToUse) == Checksums.OOT_PAL_GC:
xmlVer = "GC_NMQ_PAL_F"
elif checkChecksum(romToUse) == Checksums.OOT_PAL_GC_DBG1:
xmlVer = "GC_NMQ_D"
else: # default selection
xmlVer = "GC_MQ_D"
if (os.path.exists("Extract")):
shutil.rmtree("Extract")