Fix the player settings page generating yaml files with string keys containing integers

This commit is contained in:
Chris Wilson
2020-10-18 00:51:50 -04:00
parent e0f1f4ecfa
commit c714131b37
3 changed files with 8 additions and 8 deletions

View File

@@ -147,7 +147,7 @@ const getSettingValue = (settings, keyString) => {
const exportSettings = () => {
const presetNumber = document.getElementById('preset-number').value;
const settings = JSON.parse(localStorage.getItem(`playerSettings${presetNumber}`));
const yamlText = jsyaml.safeDump(settings);
const yamlText = jsyaml.safeDump(settings, { noCompatMode: true }).replaceAll(/'(\d+)':/g, (x, y) => `${y}:`);
download(`${settings.description}.yaml`, yamlText);
};

View File

@@ -402,19 +402,19 @@
"keyString": "triforce_pieces_required.30",
"friendlyName": 30,
"description": "30 Triforce pieces are required before speaking with Murahadala.",
"defaultValue": 50
"defaultValue": 0
},
"40": {
"keyString": "triforce_pieces_required.40",
"friendlyName": 40,
"description": "40 Triforce pieces are required before speaking with Murahadala.",
"defaultValue": 50
"defaultValue": 0
},
"50": {
"keyString": "triforce_pieces_required.50",
"friendlyName": 50,
"description": "50 Triforce pieces are required before speaking with Murahadala.",
"defaultValue": 50
"defaultValue": 0
}
}
},
@@ -466,13 +466,13 @@
"keyString": "triforce_pieces_available.40",
"friendlyName": 40,
"description": "40 Triforce pieces will be hidden throughout Hyrule",
"defaultValue": 50
"defaultValue": 0
},
"50": {
"keyString": "triforce_pieces_available.50",
"friendlyName": 50,
"description": "50 Triforce pieces will be hidden throughout Hyrule",
"defaultValue": 50
"defaultValue": 0
}
}
},
@@ -492,7 +492,7 @@
"keyString": "triforce_pieces_extra.5",
"friendlyName": 5,
"description": "5 extra Triforce pieces will be hidden throughout Hyrule",
"defaultValue": 50
"defaultValue": 0
},
"10": {
"keyString": "triforce_pieces_extra.10",