mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
[WebHost] weighted-settings: Fix footer style and clean up yaml download
This commit is contained in:
@@ -444,6 +444,26 @@ const exportSettings = () => {
|
||||
window.scrollTo(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up the settings output
|
||||
Object.keys(settings.game).forEach((game) => {
|
||||
// Remove any disabled games
|
||||
if (settings.game[game] === 0) {
|
||||
delete settings.game[game];
|
||||
delete settings[game];
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove any disabled options
|
||||
Object.keys(settings[game]).forEach((setting) => {
|
||||
Object.keys(settings[game][setting]).forEach((option) => {
|
||||
if (settings[game][setting][option] === 0) {
|
||||
delete settings[game][setting][option];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const yamlText = jsyaml.safeDump(settings, { noCompatMode: true }).replaceAll(/'(\d+)':/g, (x, y) => `${y}:`);
|
||||
download(`${document.getElementById('player-name').value}.yaml`, yamlText);
|
||||
};
|
||||
|
Reference in New Issue
Block a user