From fb715193a0865b02feb5dade7f210cfa42265d88 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Tue, 24 Nov 2020 17:48:41 -0500 Subject: [PATCH] simplify pcAppearance --- src/events/intro/pcAppearance.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/events/intro/pcAppearance.js b/src/events/intro/pcAppearance.js index 440adddc2bb..96211ae954b 100644 --- a/src/events/intro/pcAppearance.js +++ b/src/events/intro/pcAppearance.js @@ -3,7 +3,7 @@ App.Intro.pcAppearance = function(options) { .addComment("For best result capitalize it."); options.addOption("Your race is", "race", V.PC).showTextBox() - .addValueList(getRaces()); + .addValueList(Array.from(setup.filterRaces, (k => [k, k.toLowerCase()]))); options.addOption("Your skin tone is", "skin", V.PC).showTextBox() .addValueList(makeAList(setup.naturalSkins)); @@ -17,19 +17,7 @@ App.Intro.pcAppearance = function(options) { options.addOption("Your hair is", "hColor", V.PC).showTextBox() .addValueList(makeAList(App.Medicine.Modification.Color.Primary.map(color => color.value))); - function getRaces() { - const array = []; - for (const race of setup.filterRaces) { - array.push([race, race.toLowerCase()]); - } - return array; - } - function makeAList(iterable) { - const array = []; - for (const item of iterable) { - array.push([capFirstChar(item), item]); - } - return array; + return Array.from(iterable, (k => [capFirstChar(k), k])); } }; -- GitLab