diff --git a/WebHostLib/static/assets/player-settings.js b/WebHostLib/static/assets/player-settings.js
index f6185c6e..c014b46c 100644
--- a/WebHostLib/static/assets/player-settings.js
+++ b/WebHostLib/static/assets/player-settings.js
@@ -1,20 +1,8 @@
window.addEventListener('load', () => {
const gameSettings = document.getElementById('game-settings');
- new Promise((resolve, reject) => {
- const ajax = new XMLHttpRequest();
- ajax.onreadystatechange = () => {
- if (ajax.readyState !== 4) { return; }
- if (ajax.status !== 200) {
- reject("Unable to fetch source yaml file.");
- return;
- }
- resolve(ajax.responseText);
- };
- ajax.open('GET', `${window.location.origin}/static/static/playerSettings.yaml` ,true);
- ajax.send();
- }).then((results) => {
+ Promise.all([fetchPlayerSettingsYaml(), fetchPlayerSettingsJson()]).then((results) => {
// Load YAML into object
- const sourceData = jsyaml.load(results);
+ const sourceData = jsyaml.safeLoad(results[0], { json: true });
// Update localStorage with three settings objects. Preserve original objects if present.
for (let i=1; i<=3; i++) {
@@ -23,19 +11,51 @@ window.addEventListener('load', () => {
localStorage.setItem(`gameSettings${i}`, JSON.stringify(updatedObj));
}
+ // Build the entire UI
+ buildUI(JSON.parse(results[1]));
+
+ // Populate the UI and add event listeners
populateSettings();
document.getElementById('preset-number').addEventListener('change', populateSettings);
gameSettings.addEventListener('change', handleOptionChange);
gameSettings.addEventListener('keyup', handleOptionChange);
}).catch((error) => {
gameSettings.innerHTML = `
-
-
Game Settings
+
Player Settings
- This page is used to configure your game settings. You have three presets you can control, which
+ This page is used to configure your player settings. You have three presets you can control, which
you can access using the dropdown menu below. These settings will be usable when generating a
single player game, or you can export them to a .yaml
file and use them in a multiworld.
- Choose a preset and optionally assign it a nickname, which will be used as the file's description if
- you download it.
-
+
+ Choose a preset and optionally assign it a nickname, which will be used as the file's description if
+ you download it.
+
+
Choose a name you want to represent you in-game. This will appear when you send items
to other people in multiworld games.
@@ -58,73 +60,6 @@
-
- Glitches Required - Allows the generator to place required items in locations which require knowledge
- of glitches.
-
{% endblock %}