diff --git a/js/003-data/playerData.js b/js/003-data/playerData.js index 3f687c94edf0e444cd92d0e18ef9b2d9e2b46573..b0848899a3e7b43388d4d809d4ea4b82a4f6155c 100644 --- a/js/003-data/playerData.js +++ b/js/003-data/playerData.js @@ -1,11 +1,12 @@ App.Data.player = { - refreshmentType: new Map([ - [0, `Smoked`], - [1, `Drank`], - [2, `Eaten`], - [3, `Snorted`], - [4, `Injected`], - [5, `Popped`], - [6, `Dissolved orally`], - ]) + // Value is stored in player object as the index of this array: If V.PC.refreshmentType === 0, we should display "Smoked". + refreshmentType: [ + `Smoked`, + `Drank`, + `Eaten`, + `Snorted`, + `Injected`, + `Popped`, + `Dissolved orally`, + ] }; diff --git a/src/events/intro/pcBodyIntro.js b/src/events/intro/pcBodyIntro.js index b8189a36c7e06badb08cef193c10570cc0056d7c..ecfd284ea0abc0b8269cea149708036e29956635 100644 --- a/src/events/intro/pcBodyIntro.js +++ b/src/events/intro/pcBodyIntro.js @@ -146,8 +146,6 @@ App.Intro.PCBodyIntro = function() { function nameIndulgence() { const el = document.createElement("p"); const options = new App.UI.OptionsGroup(); - let r = []; - let comment; App.UI.DOM.appendNewElement("div", el, `What is your name and alternate indulgence?`, ["intro", "question"]); @@ -184,8 +182,8 @@ App.Intro.PCBodyIntro = function() { ); options.addOption(`Preferred method of consumption:`, "refreshmentType", V.PC) - .addValueList(App.Data.player.refreshmentType) - .comment(`Flavor only; no mechanical effect. If entering a custom refreshment, please assign proper usage.`); + .addValueList(Array.from(App.Data.player.refreshmentType, (v, i) => [v, i])) + .addComment(`Flavor only; no mechanical effect. If entering a custom refreshment, please assign proper usage.`); el.append(options.render()); diff --git a/src/gui/options/options.js b/src/gui/options/options.js index 112f8eb8ca0737860d3eef5222d9bb9ff597f090..8fabc3c368bfb78a3614dd084aa9095be640584d 100644 --- a/src/gui/options/options.js +++ b/src/gui/options/options.js @@ -285,6 +285,7 @@ App.UI.OptionsGroup = (function() { } else { option.object[option.property] = Number(O.value); } + App.UI.reload(); }; buttonGroup.append(select); }