Merge branch 'main' into breaking_changes

This commit is contained in:
Fabian Dill 2021-03-14 07:04:40 +01:00
commit 03bcd2aed7
5 changed files with 14 additions and 9 deletions

2
.gitignore vendored
View File

@ -9,6 +9,7 @@
*.sfc *.sfc
*.wixobj *.wixobj
*.lck *.lck
*.db3
*multidata *multidata
*multisave *multisave
@ -30,7 +31,6 @@ weights/
/logs/ /logs/
_persistent_storage.yaml _persistent_storage.yaml
mystery_result_*.yaml mystery_result_*.yaml
/db.db3
*-errors.txt *-errors.txt
success.txt success.txt
output/ output/

View File

@ -188,7 +188,7 @@ def main(args=None, callback=ERmain):
if path == args.weights: if path == args.weights:
settings.name = f"Player{player}" settings.name = f"Player{player}"
elif not settings.name: elif not settings.name:
settings.name = os.path.split(path)[-1].split(".")[0] settings.name = os.path.splitext(os.path.split(path)[-1])[0]
if "-" not in settings.shuffle and settings.shuffle != "vanilla": if "-" not in settings.shuffle and settings.shuffle != "vanilla":
settings.shuffle += f"-{random.randint(0, 2 ** 64)}" 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 if path == args.weights: # if name came from the weights file, just use base player name
erargs.name[player] = f"Player{player}" erargs.name[player] = f"Player{player}"
elif not erargs.name[player]: # if name was not specified, generate it from filename 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] = os.path.splitext(os.path.split(path)[-1])[0]
new_name = [] new_name = []
name_counter[erargs.name[player]] += 1 name_counter[erargs.name[player]] += 1
for name in erargs.name[player].split("%%"): for name in erargs.name[player].split("%%"):

View File

@ -401,8 +401,6 @@ const addSpriteOption = (event) => {
const presetNumber = document.getElementById('preset-number').value; const presetNumber = document.getElementById('preset-number').value;
const playerSettings = JSON.parse(localStorage.getItem(`weightedSettings${presetNumber}`)); const playerSettings = JSON.parse(localStorage.getItem(`weightedSettings${presetNumber}`));
const spriteName = event.target.getAttribute('data-sprite'); const spriteName = event.target.getAttribute('data-sprite');
console.log(event.target);
console.log(spriteName);
if (Object.keys(playerSettings.rom.sprite).indexOf(spriteName) !== -1) { if (Object.keys(playerSettings.rom.sprite).indexOf(spriteName) !== -1) {
// Do not add the same sprite twice // Do not add the same sprite twice
@ -445,8 +443,11 @@ const buildSpritePicker = (spriteData) => {
sprites.setAttribute('id', 'sprite-picker-sprites'); sprites.setAttribute('id', 'sprite-picker-sprites');
spriteData.sprites.forEach((sprite) => { spriteData.sprites.forEach((sprite) => {
const spriteImg = document.createElement('img'); const spriteImg = document.createElement('img');
spriteImg.setAttribute('src', `static/static/sprites/${sprite.name}.gif`); let spriteGifFile = sprite.file.split('.');
spriteImg.setAttribute('data-sprite', sprite.name); 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); spriteImg.setAttribute('alt', sprite.name);
// Wrap the image in a span to allow for tooltip presence // Wrap the image in a span to allow for tooltip presence

View File

@ -20,7 +20,7 @@
# For use with the weighted-settings page on the website. Changing this value will cause all users to be prompted # 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 # 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. # 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 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 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. # - 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 sprite: # Enter the name of your preferred sprite and weight it appropriately
random: 0 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 disablemusic: # If "on", all in-game music will be disabled
on: 0 on: 0
off: 50 off: 50

View File

@ -134,6 +134,10 @@ if os.path.exists(qusb2sneslog):
qusb2snesconfig = buildfolder / "QUsb2Snes" / "config.ini" qusb2snesconfig = buildfolder / "QUsb2Snes" / "config.ini"
if os.path.exists(qusb2snesconfig): if os.path.exists(qusb2snesconfig):
os.remove(qusb2snesconfig) os.remove(qusb2snesconfig)
alttpr_sprites_folder = buildfolder / "data" / "sprites" / "alttpr"
for file in os.listdir(alttpr_sprites_folder):
if file != ".gitignore":
os.remove(alttpr_sprites_folder / file)
if signtool: if signtool:
for exe in exes: for exe in exes: