From 8f7f5ae3842830b33960d5f34c8bdb9c06076c4b Mon Sep 17 00:00:00 2001 From: Pyro Nicampt <81565698+PyroNicampt@users.noreply.github.com> Date: Sun, 19 Apr 2026 14:33:56 -0500 Subject: [PATCH] Fixes for dropdown and slider entries to settings --- legend.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/legend.js b/legend.js index cf1c0dc..d986a02 100644 --- a/legend.js +++ b/legend.js @@ -371,6 +371,7 @@ function addSettingEntry(thisSetting, parent, indent=0){ if(inputEntry == thisSetting.state) optionElement.selected = true; thisSetting.inputElement.appendChild(optionElement); } + if(thisSetting.state) thisSetting.inputElement.value = thisSetting.state; if(thisSetting.func){ thisSetting.inputElement.addEventListener('change', e =>{ thisSetting.func(e.target.value); @@ -385,6 +386,7 @@ function addSettingEntry(thisSetting, parent, indent=0){ thisSetting.inputElement.min = thisSetting.min ?? 0; thisSetting.inputElement.max = thisSetting.max ?? 100; thisSetting.inputElement.step = thisSetting.step ?? 1; + thisSetting.inputElement.value = thisSetting.state ?? 0; if(thisSetting.func){ thisSetting.inputElement.addEventListener('input', e => { thisSetting.func(e.target.value);