From 91f30e2aa4fa900ee14ff095b9c354d7b12dc16f Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 29 Nov 2020 14:58:04 -0500 Subject: [PATCH] fixes --- js/003-data/playerData.js | 19 ++++++++++--------- src/events/intro/pcBodyIntro.js | 6 ++---- src/gui/options/options.js | 1 + 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/003-data/playerData.js b/js/003-data/playerData.js index 3f687c94edf..b0848899a3e 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 b8189a36c7e..ecfd284ea0a 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 112f8eb8ca0..8fabc3c368b 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); } -- GitLab