mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-10-31 23:55:06 -04:00
Allow drag and drop
This commit is contained in:
parent
d0c5e7aa0e
commit
49f17b46d5
@ -4,7 +4,7 @@
|
|||||||
# Place a rom in this directory then run the script.
|
# Place a rom in this directory then run the script.
|
||||||
# If you are using multiple roms, the script will let you choose one.
|
# If you are using multiple roms, the script will let you choose one.
|
||||||
# To choose with a commandline argument:
|
# 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
|
# Invalid input results in the first rom being selected
|
||||||
|
|
||||||
import json, os, signal, time, sys, shutil, glob
|
import json, os, signal, time, sys, shutil, glob
|
||||||
@ -93,16 +93,9 @@ def main():
|
|||||||
# If commandline args exist
|
# If commandline args exist
|
||||||
if (len(sys.argv) > 1):
|
if (len(sys.argv) > 1):
|
||||||
try:
|
try:
|
||||||
if ((int(sys.argv[1]) - 1) < 1):
|
romToUse = sys.argv[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]
|
|
||||||
except:
|
except:
|
||||||
romToUse = roms[0]
|
print("Error with rom inputted via argument")
|
||||||
|
|
||||||
# No commandline args, select rom using user input
|
# No commandline args, select rom using user input
|
||||||
else:
|
else:
|
||||||
@ -132,12 +125,11 @@ def main():
|
|||||||
else:
|
else:
|
||||||
romToUse = roms[0]
|
romToUse = roms[0]
|
||||||
|
|
||||||
match checkChecksum(romToUse):
|
if checkChecksum(romToUse) == Checksums.OOT_PAL_GC:
|
||||||
case Checksums.OOT_PAL_GC:
|
|
||||||
xmlVer = "GC_NMQ_PAL_F"
|
xmlVer = "GC_NMQ_PAL_F"
|
||||||
case Checksums.OOT_PAL_GC_DBG1:
|
elif checkChecksum(romToUse) == Checksums.OOT_PAL_GC_DBG1:
|
||||||
xmlVer = "GC_NMQ_D"
|
xmlVer = "GC_NMQ_D"
|
||||||
case _: # default case
|
else: # default selection
|
||||||
xmlVer = "GC_MQ_D"
|
xmlVer = "GC_MQ_D"
|
||||||
|
|
||||||
if (os.path.exists("Extract")):
|
if (os.path.exists("Extract")):
|
||||||
|
Loading…
Reference in New Issue
Block a user