Skip to content

Commit

Permalink
Beta - Add no light default for presets (if you already have the beta…
Browse files Browse the repository at this point in the history
… see discussion for how to reset default)
  • Loading branch information
Azmoria committed Oct 2, 2023
1 parent 447b358 commit 700734f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions TokenMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ function build_token_light_inputs(tokenIds) {
<div class="token-image-modal-footer-title">Preset</div>
<div class="token-image-modal-footer-title"><button id='editPresets'>Edit</button></div>
<select class="token-config-aura-preset">
<option value="none"></option>
<option value=""></option>
</select>
</div>
<div class="menu-vision-aura">
Expand Down Expand Up @@ -803,6 +803,17 @@ function build_token_light_inputs(tokenIds) {

if(localStorage.getItem('LIGHT_PRESETS') == null){
window.LIGHT_PRESETS = [
{
name: 'No Light (0/0)',
vision: {
},
light1: {
feet: '0'
},
light2: {
feet: '0'
}
},
{
name: 'Candle (5/5)',
vision: {
Expand Down Expand Up @@ -990,9 +1001,9 @@ function build_token_light_inputs(tokenIds) {
let preset = e.target.value;
let selectedPreset = window.LIGHT_PRESETS.filter(d=> d.name == preset)[0]


if(!selectedPreset) {
console.warn("somehow got an unexpected preset", preset, e);
return;
}
let wrapper = $(e.target).closest(".token-config-aura-wrapper");
if(selectedPreset.vision.feet){
Expand Down

0 comments on commit 700734f

Please sign in to comment.