def get_spritesomething_sprites(self): success = gui_common.get_sprites( self, "Unofficial SpriteSomething Samus", "snes/metroid3/samus/sheets/unofficial", "https://miketrethewey.github.io/SpriteSomething-collections/snes/metroid3/samus/sprites.json" ) return success
def get_spritesomething_sprites(self): success = gui_common.get_sprites( self, "Unofficial SpriteSomething Link", "snes/zelda3/link/sheets/unofficial", "https://raw.githubusercontent.com/Artheau/SpriteSomething/gh-pages/resources/app/snes/zelda3/link/sprites.json" ) return success
def get_spritesomething_sprites(self): success = gui_common.get_sprites( self, "Unofficial SpriteSomething Samus", "snes/metroid3/samus/sheets/unofficial", "https://raw.githubusercontent.com/miketrethewey/SpriteSomething-collections/gh-pages/snes/metroid3/samus/sprites.json" # "https://raw.githubusercontent.com/Artheau/SpriteSomething/gh-pages/resources/app/snes/metroid3/samus/sprites.json" ) return success
def __init__(self, command_line_args): print("%s (v%s)" % (self.create_random_title(), CONST.APP_VERSION)) #print title & version print("") #newline print("Initializing CLIMainFrame") #we made it, we're starting! if command_line_args["mode"]: #get the mode mode = command_line_args["mode"] if mode[:4] == "diag": #run diagnostics & exit; SpriteSomething.[py|exe] --cli=1 --mode=diag print("\n".join(diags.output())) exit(1) self.load_sprite(command_line_args["sprite"]) #we're loading a sprite! if mode == "export": #we're exporting as PNG/ZSPR/RDC based on the filetype provided, default to "export.png" # SpriteSomething.[py|exe] --cli=1 --mode=export --export-filename=export.[png|zspr|rdc] export_filename = command_line_args["export-filename"] or "export.png" self.save_file_as(export_filename) elif "inject" in mode: #we're injecting a [single|random] sprite into game file(s) # SpriteSomething.[py|exe] --cli=1 --mode=inject --dest-filename=resources/zelda3/gamefiles/export/export.sfc \ # --source-filename=resources/zelda3/gamefiles/source/zelda3.sfc dest_default_path = os.path.join("resources","user",self.game.console_name,self.game.internal_name,"gamefiles","export") #default export location | user_resources/snes/zelda3/gamefiles/export/*.* source_default_path = os.path.join("resources","user",self.game.console_name,self.game.internal_name,"gamefiles","source") #default source location | user_resources/snes/zelda3/gamefiles/source/*.* dest_filename = os.path.join(dest_default_path,"export") # user_resources/zelda3/gamefiles/export/export.* source_filename = os.path.join(source_default_path,self.game.internal_name) # user_resources/zelda3/gamefiles/source/zelda3.* if not os.path.isdir(dest_default_path): #make directories to get the designated destination if necessary os.makedirs(dest_default_path) dest_filename = command_line_args["dest-filename"] or dest_filename #if we've provide a destination, set it source_filename = command_line_args["src-filename"] or source_filename #if we've provided a source, set it if "-bulk" in mode: #if we're injecting into many game files # SpriteSomething.[py|exe] --cli=1 --mode=inject-bulk --src-filepath=resources/zelda3/gamefiles/inject source_filepath = os.path.join("resources","user",self.game.console_name,self.game.internal_name,"gamefiles","inject") #default inject location | user_resources/snes/zelda3/gamefiles/inject/*.* source_filepath = command_line_args["src-filepath"] or source_filepath #if we've provided a source directory, set it if "-random" in mode: #if we're injecting random sprites, get the directory sprite_filepath = command_line_args["spr-filepath"] or None # SpriteSomething.[py|exe] --cli=1 --mode=inject-bulk-random --src-filepath=user_resources/zelda3/gamefiles/inject \ # --spr-filepath=resource/zelda3/link/official if sprite_filepath == None: print("Sprite filepath not provided!") exit(1) self.randomize_into_ROM_bulk(source_filepath=source_filepath, sprite_filepath=sprite_filepath) else: self.copy_into_ROM_bulk(source_filepath=source_filepath) elif "-random" in mode: #we're injecting a random sprite into one game file sprite_filepath = command_line_args["spr-filepath"] or None if sprite_filepath == None: print("Sprite filepath not provided!") exit(1) self.randomize_into_ROM(inject=True, source_filename=source_filename, dest_filename=dest_filename, sprite_filepath=sprite_filepath) else: #we're injecting the loaded sprite into one game file if not os.path.isfile(source_filename) and not os.path.isfile(source_filename + ".sfc"): #check that the provided source exists, if not, nuke it from orbit print(f" Source File does not exist: {source_filename}") print(f" Source File does not exist: {source_filename}.sfc") print(" Nuke it from orbit.") exit(1) if not os.path.splitext(source_filename)[1]: #if we don't have a file extension, default to *.sfc source_filename += ".sfc" if not os.path.splitext(dest_filename)[1]: #if we don't have a file extension, default to *.sfc dest_filename += ".sfc" self.copy_into_ROM("-new" not in mode,dest_filename,source_filename) #if we're injecting "-new", make a copy elif "get-" in mode and "-sprites" in mode: #get sprites print(" Downloading Sprites") #get ALttPR sprites if mode == "get-alttpr-sprites": # SpriteSomething.[py|exe] --cli=1 --mode=get-alttpr-sprites self.load_sprite(os.path.join("resources","app","snes","zelda3","link","sheets","link.zspr")) #load Link get_sprites(self,"Official ALttPR","snes/zelda3/link/sheets/official","http://alttpr.com/sprites",False) #get ALttPR sprites; # FIXME: Do we want this in the sprite class or somewhere else? else: print("No valid CLI Mode provided") else: print("No CLI Mode provided")
def get_alttpr_sprites(self): success = gui_common.get_sprites(self, "Official ALttPR", "snes/zelda3/link/sheets/official", "http://alttpr.com/sprites") return success