From 00feff6b56f0c8e01c4df558c615fddc3b6346aa Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sat, 13 Mar 2021 15:15:12 -0800 Subject: [PATCH 1/6] Keep all "." in player name except ".yaml" --- Mystery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mystery.py b/Mystery.py index c3c8ff44..9dc20024 100644 --- a/Mystery.py +++ b/Mystery.py @@ -188,7 +188,7 @@ def main(args=None, callback=ERmain): if path == args.weights: settings.name = f"Player{player}" elif not settings.name: - settings.name = os.path.split(path)[-1].split(".")[0] + settings.name = ".".join(os.path.split(path)[-1].split(".")[0:-1]) if "-" not in settings.shuffle and settings.shuffle != "vanilla": settings.shuffle += f"-{random.randint(0, 2 ** 64)}" @@ -214,7 +214,7 @@ def main(args=None, callback=ERmain): if path == args.weights: # if name came from the weights file, just use base player name erargs.name[player] = f"Player{player}" elif not erargs.name[player]: # if name was not specified, generate it from filename - erargs.name[player] = os.path.split(path)[-1].split(".")[0] + erargs.name[player] = ".".join(os.path.split(path)[-1].split(".")[0:-1]) new_name = [] name_counter[erargs.name[player]] += 1 for name in erargs.name[player].split("%%"): From 7000f572f6541f7a2fba581678886cd0e4861d4d Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sat, 13 Mar 2021 15:26:21 -0800 Subject: [PATCH 2/6] use os.path.splitext() to remove ".yaml" from player name. --- Mystery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mystery.py b/Mystery.py index 9dc20024..ef11fb82 100644 --- a/Mystery.py +++ b/Mystery.py @@ -188,7 +188,7 @@ def main(args=None, callback=ERmain): if path == args.weights: settings.name = f"Player{player}" elif not settings.name: - settings.name = ".".join(os.path.split(path)[-1].split(".")[0:-1]) + settings.name = os.path.splitext(os.path.split(path)[-1])[0] if "-" not in settings.shuffle and settings.shuffle != "vanilla": settings.shuffle += f"-{random.randint(0, 2 ** 64)}" @@ -214,7 +214,7 @@ def main(args=None, callback=ERmain): if path == args.weights: # if name came from the weights file, just use base player name erargs.name[player] = f"Player{player}" elif not erargs.name[player]: # if name was not specified, generate it from filename - erargs.name[player] = ".".join(os.path.split(path)[-1].split(".")[0:-1]) + erargs.name[player] = os.path.splitext(os.path.split(path)[-1])[0] new_name = [] name_counter[erargs.name[player]] += 1 for name in erargs.name[player].split("%%"): From 0aa50b51a21ee0d7e368481c25c3f17a9dbbe61e Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 14 Mar 2021 00:42:15 +0100 Subject: [PATCH 3/6] gitignore all sqllite3 databases --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9ba862d6..b08e4910 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.sfc *.wixobj *.lck +*.db3 *multidata *multisave @@ -29,7 +30,6 @@ weights/ /logs/ _persistent_storage.yaml mystery_result_*.yaml -/db.db3 *-errors.txt success.txt output/ From a305a0ffac99b1d849db3a622655a1d84375e71d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 13 Mar 2021 18:53:53 -0500 Subject: [PATCH 4/6] Save filenames to yaml instead of sprite names, bump weighted settings version to 4.1.1 rev0 --- WebHostLib/static/assets/weightedSettings.js | 9 +++++---- WebHostLib/static/static/weightedSettings.yaml | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/WebHostLib/static/assets/weightedSettings.js b/WebHostLib/static/assets/weightedSettings.js index 2192a18c..0eb7765c 100644 --- a/WebHostLib/static/assets/weightedSettings.js +++ b/WebHostLib/static/assets/weightedSettings.js @@ -401,8 +401,6 @@ const addSpriteOption = (event) => { const presetNumber = document.getElementById('preset-number').value; const playerSettings = JSON.parse(localStorage.getItem(`weightedSettings${presetNumber}`)); const spriteName = event.target.getAttribute('data-sprite'); - console.log(event.target); - console.log(spriteName); if (Object.keys(playerSettings.rom.sprite).indexOf(spriteName) !== -1) { // Do not add the same sprite twice @@ -445,8 +443,11 @@ const buildSpritePicker = (spriteData) => { sprites.setAttribute('id', 'sprite-picker-sprites'); spriteData.sprites.forEach((sprite) => { const spriteImg = document.createElement('img'); - spriteImg.setAttribute('src', `static/static/sprites/${sprite.name}.gif`); - spriteImg.setAttribute('data-sprite', sprite.name); + let spriteGifFile = sprite.file.split('.'); + spriteGifFile.pop(); + spriteGifFile = spriteGifFile.join('.') + '.gif'; + spriteImg.setAttribute('src', `static/static/sprites/${spriteGifFile}`); + spriteImg.setAttribute('data-sprite', sprite.file.split('.')[0]); spriteImg.setAttribute('alt', sprite.name); // Wrap the image in a span to allow for tooltip presence diff --git a/WebHostLib/static/static/weightedSettings.yaml b/WebHostLib/static/static/weightedSettings.yaml index d309f205..df03cbf4 100644 --- a/WebHostLib/static/static/weightedSettings.yaml +++ b/WebHostLib/static/static/weightedSettings.yaml @@ -20,7 +20,7 @@ # For use with the weighted-settings page on the website. Changing this value will cause all users to be prompted # to update their settings. The version number should match the current released version number, and the revision # should be updated manually by whoever edits this file. -ws_version: 4.1.0 rev0 +ws_version: 4.1.1 rev0 description: Template Name # Used to describe your yaml. Useful if you have multiple files name: YourName # Your name in-game. Spaces will be replaced with underscores and there is a 16 character limit @@ -356,7 +356,7 @@ rom: # - random # You can specify random multiple times for however many potentially unique random sprites you want in your pool. sprite: # Enter the name of your preferred sprite and weight it appropriately random: 0 - Link: 50 # To add other sprites: open the gui/Creator, go to adjust, select a sprite and write down the name the gui calls it + link: 50 # To add other sprites: open the gui/Creator, go to adjust, select a sprite and write down the name the gui calls it disablemusic: # If "on", all in-game music will be disabled on: 0 off: 50 From 2f1ceeee607333a86219b2fb8b581cdccf06965a Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 14 Mar 2021 02:04:28 +0100 Subject: [PATCH 5/6] make sure to not include sprites with setup --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index 73e2e9c0..8ccf085c 100644 --- a/setup.py +++ b/setup.py @@ -134,6 +134,9 @@ if os.path.exists(qusb2sneslog): qusb2snesconfig = buildfolder / "QUsb2Snes" / "config.ini" if os.path.exists(qusb2snesconfig): os.remove(qusb2snesconfig) +alttpr_sprites_folder = buildfolder / "data" / "sprites" / "alttpr" +for file in os.listdir(alttpr_sprites_folder): + os.remove(alttpr_sprites_folder / file) if signtool: for exe in exes: From a14c5dad5fcf1606cdb7b74ab4ee1aad86883337 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 14 Mar 2021 02:09:19 +0100 Subject: [PATCH 6/6] keep gitignore file so setup copies folder --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8ccf085c..ca55eb98 100644 --- a/setup.py +++ b/setup.py @@ -136,7 +136,8 @@ if os.path.exists(qusb2snesconfig): os.remove(qusb2snesconfig) alttpr_sprites_folder = buildfolder / "data" / "sprites" / "alttpr" for file in os.listdir(alttpr_sprites_folder): - os.remove(alttpr_sprites_folder / file) + if file != ".gitignore": + os.remove(alttpr_sprites_folder / file) if signtool: for exe in exes: