Fixed issues with sprite overlap, fixed naming of files, added id parameter to CLI, removed numpy dependency
This commit is contained in:
parent
941b4c5614
commit
db406adfdc
3 changed files with 40 additions and 52 deletions
atlasimagecomposer/cli
|
@ -15,6 +15,7 @@ class Arguments(argparse.Namespace):
|
|||
Default Arguments when calling the CLI
|
||||
"""
|
||||
output: str
|
||||
id: str
|
||||
cacheclear: bool
|
||||
filter: List[str]
|
||||
timeout: int
|
||||
|
@ -31,9 +32,10 @@ def parse_arguments():
|
|||
|
||||
parser.add_argument("--version", action="version", version=f"atlasimagecomposer {__version__}")
|
||||
parser.add_argument("--output", action="store", type=str, default=None, dest="output", help="Set the output location. This can be an absolute or relative path")
|
||||
parser.add_argument("--id", action="store", type=str, default=None, dest="id", help="Set the servantId/charaId - Skips user prompt when provided")
|
||||
parser.add_argument("--filter", action="extend", nargs="+", dest="filter", help='Specify one or more spritesheet ids that will be fetched')
|
||||
parser.add_argument("--timeout", action="store", type=int, default=None, dest="timeout", help="Set the timeout for all requests towards AtlasAcademy, default is 10s")
|
||||
parser.add_argument("--clear-cache", action="store_true", default=False, dest="cacheclear", help="Clear cached assets before downloading files for a servant")
|
||||
parser.add_argument("--clear-cache", action="store_true", default=False, dest="cacheclear", help="Clear cached assets before downloading files")
|
||||
|
||||
|
||||
args = Arguments()
|
||||
|
@ -56,7 +58,10 @@ def run_cli():
|
|||
|
||||
welcome()
|
||||
|
||||
input_id = input("Enter servantId/charaId: ")
|
||||
input_id = args.id
|
||||
if not input_id:
|
||||
input_id = input("Enter servantId/charaId: ")
|
||||
|
||||
try:
|
||||
t = int(input_id)
|
||||
if t <= 0:
|
||||
|
@ -65,6 +70,8 @@ def run_cli():
|
|||
print("Servant ID has to be a valid integer above 0")
|
||||
sys.exit(1)
|
||||
|
||||
input_id = int(input_id)
|
||||
|
||||
if args.cacheclear:
|
||||
cachepath = Paths.IMAGES / str(input_id)
|
||||
if input_id > 10000:
|
||||
|
@ -75,4 +82,4 @@ def run_cli():
|
|||
else:
|
||||
print("No cache to clear was found, continuing")
|
||||
|
||||
compose(int(input_id), args.filter)
|
||||
compose(input_id, args.filter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue