diff --git a/Main.js b/Main.js index e0377debd..e1bf944f6 100644 --- a/Main.js +++ b/Main.js @@ -147,7 +147,7 @@ function change_zoom(newZoom, x, y) { let pageY = Math.round(centerY * window.ZOOM - zoomCenterY) + window.VTTMargin; //Set scaling token names CSS variable this variable can be used with anything in #tokens - $("#tokens").get(0).style.setProperty("--font-size-zoom", Math.max(12 * Math.max((3 - window.ZOOM), 0), 8.5) + "px"); + $("#tokens").css("--font-size-zoom", Math.max(12 * Math.max((3 - window.ZOOM), 0), 8.5) + "px"); $("#VTT").css("transform", "scale(" + window.ZOOM + ")"); set_default_vttwrapper_size() diff --git a/MessageBroker.js b/MessageBroker.js index 93176bfac..41ef2cd04 100644 --- a/MessageBroker.js +++ b/MessageBroker.js @@ -1438,6 +1438,7 @@ class MessageBroker { set_default_vttwrapper_size(); reset_canvas(); + apply_zoom_from_storage(); // WE USED THE DM MAP TO GET RIGH WIDTH/HEIGHT. NOW WE REVERT TO THE PLAYER MAP diff --git a/Token.js b/Token.js index 1a4b9b7d4..8b66de873 100644 --- a/Token.js +++ b/Token.js @@ -2906,7 +2906,12 @@ function setTokenAuras (token, options) { (options.hidden || (options.hideaura && !token.attr("data-id").includes(window.PLAYER_ID)) || showAura == 'none') ? token.parent().parent().find("#aura_" + tokenId).hide() : token.parent().parent().find("#aura_" + tokenId).show() } - + if(options.animation?.aura){ + token.parent().parent().find("#aura_" + tokenId).attr('data-animation', options.animation.aura) + } + else{ + token.parent().parent().find("#aura_" + tokenId).removeAttr('data-animation') + } } else { @@ -2959,6 +2964,12 @@ function setTokenLight (token, options) { lightElement.contextmenu(function(){return false;}); $("#light_container").prepend(lightElement); } + if(options.animation?.light){ + token.parent().parent().find(".aura-element-container-clip[id='" + token.attr("data-id")+"']").attr('data-animation', options.animation.light) + } + else{ + token.parent().parent().find(".aura-element-container-clip[id='" + token.attr("data-id")+"']").removeAttr('data-animation') + } if(window.DM){ (options.hidden && options.reveal_light == 'never') ? token.parent().parent().find("#vision_" + tokenId).css("opacity", 0.5) : token.parent().parent().find("#vision_" + tokenId).css("opacity", 1) @@ -2987,6 +2998,7 @@ function setTokenLight (token, options) { } } } + } function setTokenBase(token, options) { diff --git a/TokenMenu.js b/TokenMenu.js index 29096b29f..eb80571bc 100644 --- a/TokenMenu.js +++ b/TokenMenu.js @@ -525,6 +525,10 @@ function build_token_auras_inputs(tokenIds) {
`); - + let animationPresets = { + 'Flicker': 'flicker-fx', + 'Rays': 'rays-fx', + 'Dome': 'force-fx', + 'Wild Magic': 'wild-fx', + } + for(let option in animationPresets){ + let allTokenSelected = tokens.map(t => t.options.animation?.aura); + let selected = allTokenSelected.length === 1 ? allTokenSelected[0] : ""; + wrapper.find('.token-config-animation-preset').append(``) + } const auraOption = { name: "auraVisible", label: "Enable Token Auras", @@ -694,6 +708,20 @@ function build_token_auras_inputs(tokenIds) { token.place_sync_persist(); }); }); + wrapper.find(".token-config-animation-preset").on("change", function(e) { + + let preset = e.target.value; + + tokens.forEach(token => { + + token.options.animation= { + ...token.options.animation, + aura: preset + } + token.place_sync_persist(); + }); + }); + $("#VTTWRAPPER .sidebar-modal").on("remove", function () { console.log("removing sidebar modal!!!"); @@ -769,12 +797,18 @@ function build_token_light_inputs(tokenIds) { +