From bba7570fa11c5548545acd4c9b8124a55deb377d Mon Sep 17 00:00:00 2001 From: p4535992 Date: Wed, 1 Nov 2023 20:54:01 +0100 Subject: [PATCH 1/2] redo the pr --- .editorconfig | 11 + .eslintignore | 18 + .eslintrc | 250 ++ .gitattributes | 8 +- .github/ISSUE_TEMPLATE/bug_report.md | 88 +- .github/ISSUE_TEMPLATE/feature_request.md | 20 +- .github/ISSUE_TEMPLATE/styling.md | 20 +- .github/workflows/main.yml | 131 + .gitignore | 130 +- .husky/.gitignore | 1 + .husky/pre-commit | 4 + .prettierignore | 8 + .prettierrc | 19 +- CHANGELOG.md | 10 - README.md | 49 +- package.json | 56 +- src/fx/Anime.js | 560 +++ {tokenmagic => src}/fx/assets/box.webp | Bin .../fx/assets/distortion-1.png | Bin {tokenmagic => src}/fx/assets/dots-1.png | Bin {tokenmagic => src}/fx/assets/extrusion-1.png | Bin {tokenmagic => src}/fx/assets/gem-1.png | Bin {tokenmagic => src}/fx/assets/gem-2.png | Bin {tokenmagic => src}/fx/assets/hexa-1.png | Bin {tokenmagic => src}/fx/assets/noise-1.png | Bin {tokenmagic => src}/fx/assets/noise-2.jpg | Bin {tokenmagic => src}/fx/assets/noise-3.jpg | Bin {tokenmagic => src}/fx/assets/noise.jpg | Bin {tokenmagic => src}/fx/assets/noise.png | Bin {tokenmagic => src}/fx/assets/pentagram.png | Bin {tokenmagic => src}/fx/assets/star.webp | Bin {tokenmagic => src}/fx/assets/symbols-1.png | Bin .../fx/assets/templates/black-tone-pure.png | Bin .../templates/black-tone-strong-opacity.png | Bin .../templates/black-tone-vstrong-opacity.png | Bin .../templates/white-tone-strong-opacity.png | Bin .../videos/IounStoneGreaterAbsorption.webm | Bin {tokenmagic => src}/fx/assets/waves-1.png | Bin {tokenmagic => src}/fx/assets/waves-2.png | Bin {tokenmagic => src}/fx/assets/waves-3.png | Bin src/fx/filters/CustomFilter.js | 73 + src/fx/filters/FilterAdjustment.js | 24 + src/fx/filters/FilterAdvancedBloom.js | 23 + src/fx/filters/FilterAscii.js | 16 + src/fx/filters/FilterBevel.js | 25 + src/fx/filters/FilterBlur.js | 52 + src/fx/filters/FilterBlurEx.js | 311 ++ src/fx/filters/FilterBulgePinch.js | 31 + src/fx/filters/FilterCRT.js | 23 + src/fx/filters/FilterDDTint.js | 27 + src/fx/filters/FilterDistortion.js | 146 + src/fx/filters/FilterDot.js | 18 + src/fx/filters/FilterDropShadow.js | 29 + src/fx/filters/FilterDropShadowEx.js | 146 + src/fx/filters/FilterElectric.js | 70 + src/fx/filters/FilterFire.js | 127 + src/fx/filters/FilterFlood.js | 115 + src/fx/filters/FilterFog.js | 80 + src/fx/filters/FilterForceField.js | 201 + src/fx/filters/FilterFumes.js | 81 + src/fx/filters/FilterGleamingGlow.js | 122 + src/fx/filters/FilterGlobes.js | 82 + src/fx/filters/FilterGlow.js | 24 + src/fx/filters/FilterLiquid.js | 108 + src/fx/filters/FilterMirrorImages.js | 103 + src/fx/filters/FilterOldFilm.js | 21 + src/fx/filters/FilterOutline.js | 21 + src/fx/filters/FilterPixelate.js | 23 + src/fx/filters/FilterPolymorph.js | 144 + src/fx/filters/FilterRGBSplit.js | 66 + src/fx/filters/FilterRays.js | 130 + src/fx/filters/FilterRemoveShadow.js | 36 + src/fx/filters/FilterReplaceColor.js | 18 + src/fx/filters/FilterShockWave.js | 29 + src/fx/filters/FilterSmoke.js | 81 + src/fx/filters/FilterSolarRipples.js | 90 + src/fx/filters/FilterSpiderWeb.js | 137 + src/fx/filters/FilterSplash.js | 157 + src/fx/filters/FilterSprite.js | 407 ++ src/fx/filters/FilterSpriteMask.js | 344 ++ src/fx/filters/FilterTransform.js | 175 + src/fx/filters/FilterTwist.js | 30 + src/fx/filters/FilterWaves.js | 127 + src/fx/filters/FilterXFire.js | 207 + src/fx/filters/FilterXFog.js | 61 + src/fx/filters/FilterXRays.js | 126 + src/fx/filters/FilterZoomBlur.js | 34 + src/fx/filters/proto/FilterProto.js | 177 + .../fx/glsl/fragmentshaders/cosmicray.js | 0 .../fx/glsl/fragmentshaders/ddtint.js | 0 .../fx/glsl/fragmentshaders/dropshadow.js | 0 .../fx/glsl/fragmentshaders/electricity.js | 0 .../fx/glsl/fragmentshaders/fire.js | 0 .../fx/glsl/fragmentshaders/flood.js | 0 .../fx/glsl/fragmentshaders/fog.js | 0 .../fx/glsl/fragmentshaders/forcefield.js | 0 .../fx/glsl/fragmentshaders/fumes.js | 0 .../fx/glsl/fragmentshaders/globes.js | 0 .../fx/glsl/fragmentshaders/liquid.js | 0 .../fx/glsl/fragmentshaders/magicglow.js | 0 .../fx/glsl/fragmentshaders/matrix.js | 0 .../fx/glsl/fragmentshaders/mirrorimages.js | 0 .../fx/glsl/fragmentshaders/polymorph.js | 0 .../fx/glsl/fragmentshaders/removeshadow.js | 0 .../fx/glsl/fragmentshaders/ripples.js | 0 .../fx/glsl/fragmentshaders/smoke.js | 0 .../fx/glsl/fragmentshaders/spiderweb.js | 0 .../fx/glsl/fragmentshaders/splash.js | 0 .../fx/glsl/fragmentshaders/sprite.js | 0 .../fx/glsl/fragmentshaders/spritemask.js | 0 .../fx/glsl/fragmentshaders/waves.js | 0 .../fx/glsl/fragmentshaders/xfire.js | 0 .../fx/glsl/fragmentshaders/xfog.js | 0 .../fx/glsl/fragmentshaders/xray.js | 0 .../fx/glsl/vertexshaders/customvertex2D.js | 0 .../vertexshaders/customvertex2DSampler.js | 0 src/fx/presets/defaultpresets.js | 2677 +++++++++++++ .../gui/icons/simple-gui-macro.svg | 0 .../gui/macros/SImpleGUIMacro.js | 152 +- .../00 - A - Delete filters on Selected.webp | Bin .../00 - B - Delete filters by Placeable.webp | Bin .../gui/macros/images/01 - Bevel.webp | Bin .../gui/macros/images/02 - Adjustment.webp | Bin .../gui/macros/images/03 - Drop Shadow.webp | Bin .../gui/macros/images/04 - Outline.webp | Bin .../gui/macros/images/05 - Glow.webp | Bin .../gui/macros/images/06 - Bloom.webp | Bin .../gui/macros/images/07 - Distortion.webp | Bin .../gui/macros/images/08 - Old film.webp | Bin .../images/09 - T01 - Twist (transform).webp | Bin .../09 - T02 - Moo Man Dance (transform).webp | Bin .../images/10 - T01 - Bulge (transform).webp | Bin .../images/10 - T02 - Pinch (transform).webp | Bin .../gui/macros/images/11 - Blur.webp | Bin .../gui/macros/images/12 - Zoom Blur.webp | Bin .../macros/images/13 - Shockwave (wave).webp | Bin .../gui/macros/images/14 - Remove Shadow.webp | Bin .../gui/macros/images/15 - Cosmic Ray.webp | Bin .../gui/macros/images/16 - Inner Fog.webp | Bin .../gui/macros/images/17 - Fumes.webp | Bin .../gui/macros/images/18 - Electric.webp | Bin .../gui/macros/images/19 - T01 - Fire.webp | Bin .../images/19 - T02 - Devouring Fire.webp | Bin .../gui/macros/images/20 - Waves.webp | Bin .../gui/macros/images/21 - Flood.webp | Bin .../gui/macros/images/22 - Smoke.webp | Bin .../images/23 - T01 - Mirror Images.webp | Bin .../images/23 - T02 - Chaotic Images.webp | Bin .../images/23 - T03 - Spectral Images.webp | Bin .../images/24 - T01 - Hexa Force Field 2.webp | Bin ... - Hexa Force Field 3 - Scintillating.webp | Bin .../images/24 - T01 - Hexa Force Field.webp | Bin .../images/24 - T02 - Fire Shield 2.webp | Bin .../24 - T02 - Fire Shield 3 - Ring.webp | Bin .../24 - T02 - Fire Shield 4 - Lava Zone.webp | Bin .../macros/images/24 - T02 - Fire Shield.webp | Bin .../images/24 - T03 - Poisoned Smoke.webp | Bin .../images/24 - T04 - Shell - Earth.webp | Bin .../24 - T04 - Shell - Moving Ice Disc.webp | Bin ... - T05 - Mega - Chroma Shell (on top).webp | Bin .../24 - T05 - Mega - Ice Shell (on top).webp | Bin .../images/24 - T06 - Air Bubble 2.webp | Bin .../macros/images/24 - T06 - Air Bubble.webp | Bin .../images/24 - T07 - Mage Armor 2.webp | Bin .../macros/images/24 - T07 - Mage Armor.webp | Bin .../images/24 - T08 - Chromatic Bubble 2.webp | Bin .../images/24 - T08 - Chromatic Bubble.webp | Bin .../24 - T09 - Water Defense 2 - Ring.webp | Bin .../images/24 - T09 - Water Defense.webp | Bin .../macros/images/24 - T10 - Evil Aura.webp | Bin ... T11 - Grid Force Field 2 - Chromatic.webp | Bin .../images/24 - T11 - Grid Force Field.webp | Bin .../images/24 - T12 - Warp Time Aura 2.webp | Bin .../images/24 - T12 - Warp Time Aura.webp | Bin .../images/24 - T13 - Simple Color.webp | Bin .../25 - T01 - Sunburst Rays (xray).webp | Bin .../25 - T02 - Lucky Clover (xray).webp | Bin .../images/25 - T03 - X-ray Scan (xray).webp | Bin .../images/25 - T04 - Blue Rays ! (xray).webp | Bin .../26 - T01 - Spectral Body (liquid).webp | Bin ...26 - T02 - Mantle of Madness (liquid).webp | Bin ...- T03 - Drift in Plans (liquid+waves).webp | Bin .../27 - T01 - Burning Aura (xglow).webp | Bin .../27 - T02 - Glacial Aura (xglow).webp | Bin ...27 - T03 - Ugly Villains Aura (xglow).webp | Bin .../27 - T04 - Pure Fire (xglow+fire).webp | Bin .../27 - T05 - Pure Fire v2 (xglow+fire).webp | Bin .../27 - T06 - Pure Ice (xglow+smoke).webp | Bin .../macros/images/28 - Glory to Pixels.webp | Bin .../images/29 - T01 - Foul Fog (xfog).webp | Bin ...9 - T02 - Phase Spider Web (xfog+web).webp | Bin .../images/30 - T01 - Simple Web (web).webp | Bin .../30 - T02 - Infernal Web (field+web).webp | Bin .../31 - T01 - Glowing Globes (globes).webp | Bin ...1 - T02 - Fairy Outline (globes+glow).webp | Bin .../32 - T01 - Solar Ripples (ripples).webp | Bin ...y the Bewitched Flames (ripples+glow).webp | Bin .../33 - T01 - Evade Stance (transform).webp | Bin .../33 - T02 - Saving Roll (transform).webp | Bin .../33 - T03 - Dodge Jump (transform).webp | Bin ...04 - Some Real Nuts Here! (transform).webp | Bin ...4 - T01 - Wound - Repeatable (splash).webp | Bin .../images/34 - T02 - Dead (splash).webp | Bin .../34 - T03 - Blood Bath (splash).webp | Bin .../images/35 - T01 - Fire v2 (xfire).webp | Bin .../35 - T02 - Chromatic Fire (xfire).webp | Bin .../images/35 - T03 - Sparks (xfire).webp | Bin .../images/35 - T04 - Cold Fire (xfire).webp | Bin .../images/35 - T05 - Black Fire (xfire).webp | Bin .../35 - T06 - Custom Color Fire (xfire).webp | Bin .../images/35 - T07 - SuperFrost (xfire).webp | Bin ...8 - Animated SuperFrost (xfire+xglow).webp | Bin .../images/35 - T09 - SuperHeat (xfire).webp | Bin ...nimated SuperHeat (xfire+liquid+wave).webp | Bin ...1 - Turn into Mystery Man (polymorph).webp | Bin .../37 - T01 - Ioun Stone (sprite).webp | Bin .../images/37 - T02 - Pentagram (sprite).webp | Bin ...- T03 - Fire Pentagram (sprite+xglow).webp | Bin .../gui/macros/images/40 - Ascii.webp | Bin .../gui/macros/images/41 - Dot.webp | Bin .../gui/macros/images/42 - CRT.webp | Bin .../gui/macros/images/43 - RGB Split.webp | Bin .../44 - Criss Cross Overlay (sprite).webp | Bin .../images/45 - Star Mask (spriteMask).webp | Bin .../images/A - Multi-Filters Example.webp | Bin .../images/B - Multi-Filters Example.webp | Bin .../images/C - Electric Multi-Filters.webp | Bin .../images/D - Auto-Destroy Example.webp | Bin .../E - Click, click, click and click !.webp | Bin .../images/G - Randomization Example.webp | Bin .../gui/macros/images/original_token.webp | Bin src/import/TMFX-default-presets.json | 2444 ++++++++++++ src/import/TMFX-update-presets-v040.json | 569 +++ src/import/TMFX-update-presets-v040b.json | 162 + src/import/TMFX-update-presets-v041.json | 148 + src/import/TMFX-update-presets-v043.json | 409 ++ src/lang/en.json | 58 + src/lang/es.json | 59 + src/lang/fr.json | 56 + src/lang/ja.json | 58 + src/lang/ko.json | 54 + src/lang/pt-BR.json | 52 + src/lang/ru.json | 58 + src/lang/zh-tw.json | 58 + src/libs/filters/pixi-filters.js | 3521 +++++++++++++++++ .../libs/filters/pixi-filters.js.map | 0 src/module.js | 2080 ++++++++++ src/module.json | 127 + .../packs/token-magic-book-of-fire/000017.ldb | Bin .../packs/token-magic-book-of-fire/CURRENT | 0 .../packs/token-magic-book-of-fire/LOCK | 0 .../packs/token-magic-book-of-fire/LOG | 0 .../packs/token-magic-book-of-fire/LOG.old | 0 .../token-magic-book-of-fire/MANIFEST-000384 | Bin .../packs/token-magic-portfolio/000202.ldb | Bin .../packs/token-magic-portfolio/CURRENT | 0 .../packs/token-magic-portfolio/LOCK | 0 .../packs/token-magic-portfolio/LOG | 0 .../packs/token-magic-portfolio/LOG.old | 0 .../token-magic-portfolio/MANIFEST-000387 | Bin src/scripts/autoTemplate/TheWitcherTRPG.js | 151 + src/scripts/autoTemplate/dnd5e.js | 206 + src/scripts/autoTemplate/pf2e.js | 206 + .../module => src/scripts}/constants.js | 2 +- src/scripts/migration/migration.js | 176 + src/scripts/proto/PlaceableObjectProto.js | 171 + src/scripts/settings.js | 613 +++ src/styles/tokenmagic.css | 30 + .../settings/TheWitcherTRPG/categories.html | 0 .../settings/TheWitcherTRPG/overrides.html | 0 .../templates/settings/dnd5e/categories.html | 0 .../templates/settings/dnd5e/overrides.html | 0 .../templates/settings/pf2e/categories.html | 0 .../templates/settings/pf2e/overrides.html | 0 .../templates/settings/settings.html | 0 tokenmagic/fx/Anime.js | 560 --- tokenmagic/fx/filters/CustomFilter.js | 73 - tokenmagic/fx/filters/FilterAdjustment.js | 24 - tokenmagic/fx/filters/FilterAdvancedBloom.js | 23 - tokenmagic/fx/filters/FilterAscii.js | 16 - tokenmagic/fx/filters/FilterBevel.js | 25 - tokenmagic/fx/filters/FilterBlur.js | 52 - tokenmagic/fx/filters/FilterBlurEx.js | 311 -- tokenmagic/fx/filters/FilterBulgePinch.js | 31 - tokenmagic/fx/filters/FilterCRT.js | 23 - tokenmagic/fx/filters/FilterDDTint.js | 27 - tokenmagic/fx/filters/FilterDistortion.js | 146 - tokenmagic/fx/filters/FilterDot.js | 18 - tokenmagic/fx/filters/FilterDropShadow.js | 29 - tokenmagic/fx/filters/FilterDropShadowEx.js | 146 - tokenmagic/fx/filters/FilterElectric.js | 70 - tokenmagic/fx/filters/FilterFire.js | 127 - tokenmagic/fx/filters/FilterFlood.js | 115 - tokenmagic/fx/filters/FilterFog.js | 80 - tokenmagic/fx/filters/FilterForceField.js | 201 - tokenmagic/fx/filters/FilterFumes.js | 81 - tokenmagic/fx/filters/FilterGleamingGlow.js | 122 - tokenmagic/fx/filters/FilterGlobes.js | 82 - tokenmagic/fx/filters/FilterGlow.js | 24 - tokenmagic/fx/filters/FilterLiquid.js | 108 - tokenmagic/fx/filters/FilterMirrorImages.js | 103 - tokenmagic/fx/filters/FilterOldFilm.js | 21 - tokenmagic/fx/filters/FilterOutline.js | 21 - tokenmagic/fx/filters/FilterPixelate.js | 23 - tokenmagic/fx/filters/FilterPolymorph.js | 144 - tokenmagic/fx/filters/FilterRGBSplit.js | 66 - tokenmagic/fx/filters/FilterRays.js | 130 - tokenmagic/fx/filters/FilterRemoveShadow.js | 36 - tokenmagic/fx/filters/FilterReplaceColor.js | 18 - tokenmagic/fx/filters/FilterShockWave.js | 29 - tokenmagic/fx/filters/FilterSmoke.js | 81 - tokenmagic/fx/filters/FilterSolarRipples.js | 90 - tokenmagic/fx/filters/FilterSpiderWeb.js | 137 - tokenmagic/fx/filters/FilterSplash.js | 157 - tokenmagic/fx/filters/FilterSprite.js | 407 -- tokenmagic/fx/filters/FilterSpriteMask.js | 344 -- tokenmagic/fx/filters/FilterTransform.js | 175 - tokenmagic/fx/filters/FilterTwist.js | 30 - tokenmagic/fx/filters/FilterWaves.js | 127 - tokenmagic/fx/filters/FilterXFire.js | 207 - tokenmagic/fx/filters/FilterXFog.js | 61 - tokenmagic/fx/filters/FilterXRays.js | 126 - tokenmagic/fx/filters/FilterZoomBlur.js | 34 - tokenmagic/fx/filters/proto/FilterProto.js | 177 - tokenmagic/fx/presets/defaultpresets.js | 2677 ------------- tokenmagic/import/TMFX-default-presets.json | 2444 ------------ .../import/TMFX-update-presets-v040.json | 569 --- .../import/TMFX-update-presets-v040b.json | 162 - .../import/TMFX-update-presets-v041.json | 148 - .../import/TMFX-update-presets-v043.json | 409 -- tokenmagic/lang/en.json | 58 - tokenmagic/lang/es.json | 59 - tokenmagic/lang/fr.json | 56 - tokenmagic/lang/ja.json | 58 - tokenmagic/lang/ko.json | 54 - tokenmagic/lang/pt-BR.json | 52 - tokenmagic/lang/ru.json | 58 - tokenmagic/lang/zh-tw.json | 58 - tokenmagic/libs/filters/pixi-filters.js | 1839 --------- tokenmagic/migration/migration.js | 176 - tokenmagic/module.json | 127 - .../module/autoTemplate/TheWitcherTRPG.js | 151 - tokenmagic/module/autoTemplate/dnd5e.js | 206 - tokenmagic/module/autoTemplate/pf2e.js | 206 - .../module/proto/PlaceableObjectProto.js | 171 - tokenmagic/module/settings.js | 613 --- tokenmagic/module/tokenmagic.js | 2080 ---------- .../packs/token-magic-book-of-fire/000386.log | 0 .../packs/token-magic-portfolio/000389.log | 0 tokenmagic/styles/tokenmagic.css | 30 - vite.config.mjs | 211 + 351 files changed, 20412 insertions(+), 17896 deletions(-) create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 .github/workflows/main.yml create mode 100644 .husky/.gitignore create mode 100644 .husky/pre-commit create mode 100644 .prettierignore create mode 100644 src/fx/Anime.js rename {tokenmagic => src}/fx/assets/box.webp (100%) rename {tokenmagic => src}/fx/assets/distortion-1.png (100%) rename {tokenmagic => src}/fx/assets/dots-1.png (100%) rename {tokenmagic => src}/fx/assets/extrusion-1.png (100%) rename {tokenmagic => src}/fx/assets/gem-1.png (100%) rename {tokenmagic => src}/fx/assets/gem-2.png (100%) rename {tokenmagic => src}/fx/assets/hexa-1.png (100%) rename {tokenmagic => src}/fx/assets/noise-1.png (100%) rename {tokenmagic => src}/fx/assets/noise-2.jpg (100%) rename {tokenmagic => src}/fx/assets/noise-3.jpg (100%) rename {tokenmagic => src}/fx/assets/noise.jpg (100%) rename {tokenmagic => src}/fx/assets/noise.png (100%) rename {tokenmagic => src}/fx/assets/pentagram.png (100%) rename {tokenmagic => src}/fx/assets/star.webp (100%) rename {tokenmagic => src}/fx/assets/symbols-1.png (100%) rename {tokenmagic => src}/fx/assets/templates/black-tone-pure.png (100%) rename {tokenmagic => src}/fx/assets/templates/black-tone-strong-opacity.png (100%) rename {tokenmagic => src}/fx/assets/templates/black-tone-vstrong-opacity.png (100%) rename {tokenmagic => src}/fx/assets/templates/white-tone-strong-opacity.png (100%) rename {tokenmagic => src}/fx/assets/videos/IounStoneGreaterAbsorption.webm (100%) rename {tokenmagic => src}/fx/assets/waves-1.png (100%) rename {tokenmagic => src}/fx/assets/waves-2.png (100%) rename {tokenmagic => src}/fx/assets/waves-3.png (100%) create mode 100644 src/fx/filters/CustomFilter.js create mode 100644 src/fx/filters/FilterAdjustment.js create mode 100644 src/fx/filters/FilterAdvancedBloom.js create mode 100644 src/fx/filters/FilterAscii.js create mode 100644 src/fx/filters/FilterBevel.js create mode 100644 src/fx/filters/FilterBlur.js create mode 100644 src/fx/filters/FilterBlurEx.js create mode 100644 src/fx/filters/FilterBulgePinch.js create mode 100644 src/fx/filters/FilterCRT.js create mode 100644 src/fx/filters/FilterDDTint.js create mode 100644 src/fx/filters/FilterDistortion.js create mode 100644 src/fx/filters/FilterDot.js create mode 100644 src/fx/filters/FilterDropShadow.js create mode 100644 src/fx/filters/FilterDropShadowEx.js create mode 100644 src/fx/filters/FilterElectric.js create mode 100644 src/fx/filters/FilterFire.js create mode 100644 src/fx/filters/FilterFlood.js create mode 100644 src/fx/filters/FilterFog.js create mode 100644 src/fx/filters/FilterForceField.js create mode 100644 src/fx/filters/FilterFumes.js create mode 100644 src/fx/filters/FilterGleamingGlow.js create mode 100644 src/fx/filters/FilterGlobes.js create mode 100644 src/fx/filters/FilterGlow.js create mode 100644 src/fx/filters/FilterLiquid.js create mode 100644 src/fx/filters/FilterMirrorImages.js create mode 100644 src/fx/filters/FilterOldFilm.js create mode 100644 src/fx/filters/FilterOutline.js create mode 100644 src/fx/filters/FilterPixelate.js create mode 100644 src/fx/filters/FilterPolymorph.js create mode 100644 src/fx/filters/FilterRGBSplit.js create mode 100644 src/fx/filters/FilterRays.js create mode 100644 src/fx/filters/FilterRemoveShadow.js create mode 100644 src/fx/filters/FilterReplaceColor.js create mode 100644 src/fx/filters/FilterShockWave.js create mode 100644 src/fx/filters/FilterSmoke.js create mode 100644 src/fx/filters/FilterSolarRipples.js create mode 100644 src/fx/filters/FilterSpiderWeb.js create mode 100644 src/fx/filters/FilterSplash.js create mode 100644 src/fx/filters/FilterSprite.js create mode 100644 src/fx/filters/FilterSpriteMask.js create mode 100644 src/fx/filters/FilterTransform.js create mode 100644 src/fx/filters/FilterTwist.js create mode 100644 src/fx/filters/FilterWaves.js create mode 100644 src/fx/filters/FilterXFire.js create mode 100644 src/fx/filters/FilterXFog.js create mode 100644 src/fx/filters/FilterXRays.js create mode 100644 src/fx/filters/FilterZoomBlur.js create mode 100644 src/fx/filters/proto/FilterProto.js rename {tokenmagic => src}/fx/glsl/fragmentshaders/cosmicray.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/ddtint.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/dropshadow.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/electricity.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/fire.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/flood.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/fog.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/forcefield.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/fumes.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/globes.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/liquid.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/magicglow.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/matrix.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/mirrorimages.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/polymorph.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/removeshadow.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/ripples.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/smoke.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/spiderweb.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/splash.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/sprite.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/spritemask.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/waves.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/xfire.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/xfog.js (100%) rename {tokenmagic => src}/fx/glsl/fragmentshaders/xray.js (100%) rename {tokenmagic => src}/fx/glsl/vertexshaders/customvertex2D.js (100%) rename {tokenmagic => src}/fx/glsl/vertexshaders/customvertex2DSampler.js (100%) create mode 100644 src/fx/presets/defaultpresets.js rename {tokenmagic => src}/gui/icons/simple-gui-macro.svg (100%) rename {tokenmagic => src}/gui/macros/SImpleGUIMacro.js (54%) rename {tokenmagic => src}/gui/macros/images/00 - A - Delete filters on Selected.webp (100%) rename {tokenmagic => src}/gui/macros/images/00 - B - Delete filters by Placeable.webp (100%) rename {tokenmagic => src}/gui/macros/images/01 - Bevel.webp (100%) rename {tokenmagic => src}/gui/macros/images/02 - Adjustment.webp (100%) rename {tokenmagic => src}/gui/macros/images/03 - Drop Shadow.webp (100%) rename {tokenmagic => src}/gui/macros/images/04 - Outline.webp (100%) rename {tokenmagic => src}/gui/macros/images/05 - Glow.webp (100%) rename {tokenmagic => src}/gui/macros/images/06 - Bloom.webp (100%) rename {tokenmagic => src}/gui/macros/images/07 - Distortion.webp (100%) rename {tokenmagic => src}/gui/macros/images/08 - Old film.webp (100%) rename {tokenmagic => src}/gui/macros/images/09 - T01 - Twist (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/09 - T02 - Moo Man Dance (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/10 - T01 - Bulge (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/10 - T02 - Pinch (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/11 - Blur.webp (100%) rename {tokenmagic => src}/gui/macros/images/12 - Zoom Blur.webp (100%) rename {tokenmagic => src}/gui/macros/images/13 - Shockwave (wave).webp (100%) rename {tokenmagic => src}/gui/macros/images/14 - Remove Shadow.webp (100%) rename {tokenmagic => src}/gui/macros/images/15 - Cosmic Ray.webp (100%) rename {tokenmagic => src}/gui/macros/images/16 - Inner Fog.webp (100%) rename {tokenmagic => src}/gui/macros/images/17 - Fumes.webp (100%) rename {tokenmagic => src}/gui/macros/images/18 - Electric.webp (100%) rename {tokenmagic => src}/gui/macros/images/19 - T01 - Fire.webp (100%) rename {tokenmagic => src}/gui/macros/images/19 - T02 - Devouring Fire.webp (100%) rename {tokenmagic => src}/gui/macros/images/20 - Waves.webp (100%) rename {tokenmagic => src}/gui/macros/images/21 - Flood.webp (100%) rename {tokenmagic => src}/gui/macros/images/22 - Smoke.webp (100%) rename {tokenmagic => src}/gui/macros/images/23 - T01 - Mirror Images.webp (100%) rename {tokenmagic => src}/gui/macros/images/23 - T02 - Chaotic Images.webp (100%) rename {tokenmagic => src}/gui/macros/images/23 - T03 - Spectral Images.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T01 - Hexa Force Field 2.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T01 - Hexa Force Field 3 - Scintillating.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T01 - Hexa Force Field.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T02 - Fire Shield 2.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T02 - Fire Shield 3 - Ring.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T02 - Fire Shield 4 - Lava Zone.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T02 - Fire Shield.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T03 - Poisoned Smoke.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T04 - Shell - Earth.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T04 - Shell - Moving Ice Disc.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T05 - Mega - Chroma Shell (on top).webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T05 - Mega - Ice Shell (on top).webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T06 - Air Bubble 2.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T06 - Air Bubble.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T07 - Mage Armor 2.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T07 - Mage Armor.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T08 - Chromatic Bubble 2.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T08 - Chromatic Bubble.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T09 - Water Defense 2 - Ring.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T09 - Water Defense.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T10 - Evil Aura.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T11 - Grid Force Field 2 - Chromatic.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T11 - Grid Force Field.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T12 - Warp Time Aura 2.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T12 - Warp Time Aura.webp (100%) rename {tokenmagic => src}/gui/macros/images/24 - T13 - Simple Color.webp (100%) rename {tokenmagic => src}/gui/macros/images/25 - T01 - Sunburst Rays (xray).webp (100%) rename {tokenmagic => src}/gui/macros/images/25 - T02 - Lucky Clover (xray).webp (100%) rename {tokenmagic => src}/gui/macros/images/25 - T03 - X-ray Scan (xray).webp (100%) rename {tokenmagic => src}/gui/macros/images/25 - T04 - Blue Rays ! (xray).webp (100%) rename {tokenmagic => src}/gui/macros/images/26 - T01 - Spectral Body (liquid).webp (100%) rename {tokenmagic => src}/gui/macros/images/26 - T02 - Mantle of Madness (liquid).webp (100%) rename {tokenmagic => src}/gui/macros/images/26 - T03 - Drift in Plans (liquid+waves).webp (100%) rename {tokenmagic => src}/gui/macros/images/27 - T01 - Burning Aura (xglow).webp (100%) rename {tokenmagic => src}/gui/macros/images/27 - T02 - Glacial Aura (xglow).webp (100%) rename {tokenmagic => src}/gui/macros/images/27 - T03 - Ugly Villains Aura (xglow).webp (100%) rename {tokenmagic => src}/gui/macros/images/27 - T04 - Pure Fire (xglow+fire).webp (100%) rename {tokenmagic => src}/gui/macros/images/27 - T05 - Pure Fire v2 (xglow+fire).webp (100%) rename {tokenmagic => src}/gui/macros/images/27 - T06 - Pure Ice (xglow+smoke).webp (100%) rename {tokenmagic => src}/gui/macros/images/28 - Glory to Pixels.webp (100%) rename {tokenmagic => src}/gui/macros/images/29 - T01 - Foul Fog (xfog).webp (100%) rename {tokenmagic => src}/gui/macros/images/29 - T02 - Phase Spider Web (xfog+web).webp (100%) rename {tokenmagic => src}/gui/macros/images/30 - T01 - Simple Web (web).webp (100%) rename {tokenmagic => src}/gui/macros/images/30 - T02 - Infernal Web (field+web).webp (100%) rename {tokenmagic => src}/gui/macros/images/31 - T01 - Glowing Globes (globes).webp (100%) rename {tokenmagic => src}/gui/macros/images/31 - T02 - Fairy Outline (globes+glow).webp (100%) rename {tokenmagic => src}/gui/macros/images/32 - T01 - Solar Ripples (ripples).webp (100%) rename {tokenmagic => src}/gui/macros/images/32 - T02 - Devoured by the Bewitched Flames (ripples+glow).webp (100%) rename {tokenmagic => src}/gui/macros/images/33 - T01 - Evade Stance (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/33 - T02 - Saving Roll (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/33 - T03 - Dodge Jump (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/33 - T04 - Some Real Nuts Here! (transform).webp (100%) rename {tokenmagic => src}/gui/macros/images/34 - T01 - Wound - Repeatable (splash).webp (100%) rename {tokenmagic => src}/gui/macros/images/34 - T02 - Dead (splash).webp (100%) rename {tokenmagic => src}/gui/macros/images/34 - T03 - Blood Bath (splash).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T01 - Fire v2 (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T02 - Chromatic Fire (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T03 - Sparks (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T04 - Cold Fire (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T05 - Black Fire (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T06 - Custom Color Fire (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T07 - SuperFrost (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T08 - Animated SuperFrost (xfire+xglow).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T09 - SuperHeat (xfire).webp (100%) rename {tokenmagic => src}/gui/macros/images/35 - T10 - Animated SuperHeat (xfire+liquid+wave).webp (100%) rename {tokenmagic => src}/gui/macros/images/36 - T01 - Turn into Mystery Man (polymorph).webp (100%) rename {tokenmagic => src}/gui/macros/images/37 - T01 - Ioun Stone (sprite).webp (100%) rename {tokenmagic => src}/gui/macros/images/37 - T02 - Pentagram (sprite).webp (100%) rename {tokenmagic => src}/gui/macros/images/37 - T03 - Fire Pentagram (sprite+xglow).webp (100%) rename {tokenmagic => src}/gui/macros/images/40 - Ascii.webp (100%) rename {tokenmagic => src}/gui/macros/images/41 - Dot.webp (100%) rename {tokenmagic => src}/gui/macros/images/42 - CRT.webp (100%) rename {tokenmagic => src}/gui/macros/images/43 - RGB Split.webp (100%) rename {tokenmagic => src}/gui/macros/images/44 - Criss Cross Overlay (sprite).webp (100%) rename {tokenmagic => src}/gui/macros/images/45 - Star Mask (spriteMask).webp (100%) rename {tokenmagic => src}/gui/macros/images/A - Multi-Filters Example.webp (100%) rename {tokenmagic => src}/gui/macros/images/B - Multi-Filters Example.webp (100%) rename {tokenmagic => src}/gui/macros/images/C - Electric Multi-Filters.webp (100%) rename {tokenmagic => src}/gui/macros/images/D - Auto-Destroy Example.webp (100%) rename {tokenmagic => src}/gui/macros/images/E - Click, click, click and click !.webp (100%) rename {tokenmagic => src}/gui/macros/images/G - Randomization Example.webp (100%) rename {tokenmagic => src}/gui/macros/images/original_token.webp (100%) create mode 100644 src/import/TMFX-default-presets.json create mode 100644 src/import/TMFX-update-presets-v040.json create mode 100644 src/import/TMFX-update-presets-v040b.json create mode 100644 src/import/TMFX-update-presets-v041.json create mode 100644 src/import/TMFX-update-presets-v043.json create mode 100644 src/lang/en.json create mode 100644 src/lang/es.json create mode 100644 src/lang/fr.json create mode 100644 src/lang/ja.json create mode 100644 src/lang/ko.json create mode 100644 src/lang/pt-BR.json create mode 100644 src/lang/ru.json create mode 100644 src/lang/zh-tw.json create mode 100644 src/libs/filters/pixi-filters.js rename {tokenmagic => src}/libs/filters/pixi-filters.js.map (100%) create mode 100644 src/module.js create mode 100644 src/module.json rename {tokenmagic => src}/packs/token-magic-book-of-fire/000017.ldb (100%) rename {tokenmagic => src}/packs/token-magic-book-of-fire/CURRENT (100%) rename {tokenmagic => src}/packs/token-magic-book-of-fire/LOCK (100%) rename {tokenmagic => src}/packs/token-magic-book-of-fire/LOG (100%) rename {tokenmagic => src}/packs/token-magic-book-of-fire/LOG.old (100%) rename {tokenmagic => src}/packs/token-magic-book-of-fire/MANIFEST-000384 (100%) rename {tokenmagic => src}/packs/token-magic-portfolio/000202.ldb (100%) rename {tokenmagic => src}/packs/token-magic-portfolio/CURRENT (100%) rename {tokenmagic => src}/packs/token-magic-portfolio/LOCK (100%) rename {tokenmagic => src}/packs/token-magic-portfolio/LOG (100%) rename {tokenmagic => src}/packs/token-magic-portfolio/LOG.old (100%) rename {tokenmagic => src}/packs/token-magic-portfolio/MANIFEST-000387 (100%) create mode 100644 src/scripts/autoTemplate/TheWitcherTRPG.js create mode 100644 src/scripts/autoTemplate/dnd5e.js create mode 100644 src/scripts/autoTemplate/pf2e.js rename {tokenmagic/module => src/scripts}/constants.js (66%) create mode 100644 src/scripts/migration/migration.js create mode 100644 src/scripts/proto/PlaceableObjectProto.js create mode 100644 src/scripts/settings.js create mode 100644 src/styles/tokenmagic.css rename {tokenmagic => src}/templates/settings/TheWitcherTRPG/categories.html (100%) rename {tokenmagic => src}/templates/settings/TheWitcherTRPG/overrides.html (100%) rename {tokenmagic => src}/templates/settings/dnd5e/categories.html (100%) rename {tokenmagic => src}/templates/settings/dnd5e/overrides.html (100%) rename {tokenmagic => src}/templates/settings/pf2e/categories.html (100%) rename {tokenmagic => src}/templates/settings/pf2e/overrides.html (100%) rename {tokenmagic => src}/templates/settings/settings.html (100%) delete mode 100644 tokenmagic/fx/Anime.js delete mode 100644 tokenmagic/fx/filters/CustomFilter.js delete mode 100644 tokenmagic/fx/filters/FilterAdjustment.js delete mode 100644 tokenmagic/fx/filters/FilterAdvancedBloom.js delete mode 100644 tokenmagic/fx/filters/FilterAscii.js delete mode 100644 tokenmagic/fx/filters/FilterBevel.js delete mode 100644 tokenmagic/fx/filters/FilterBlur.js delete mode 100644 tokenmagic/fx/filters/FilterBlurEx.js delete mode 100644 tokenmagic/fx/filters/FilterBulgePinch.js delete mode 100644 tokenmagic/fx/filters/FilterCRT.js delete mode 100644 tokenmagic/fx/filters/FilterDDTint.js delete mode 100644 tokenmagic/fx/filters/FilterDistortion.js delete mode 100644 tokenmagic/fx/filters/FilterDot.js delete mode 100644 tokenmagic/fx/filters/FilterDropShadow.js delete mode 100644 tokenmagic/fx/filters/FilterDropShadowEx.js delete mode 100644 tokenmagic/fx/filters/FilterElectric.js delete mode 100644 tokenmagic/fx/filters/FilterFire.js delete mode 100644 tokenmagic/fx/filters/FilterFlood.js delete mode 100644 tokenmagic/fx/filters/FilterFog.js delete mode 100644 tokenmagic/fx/filters/FilterForceField.js delete mode 100644 tokenmagic/fx/filters/FilterFumes.js delete mode 100644 tokenmagic/fx/filters/FilterGleamingGlow.js delete mode 100644 tokenmagic/fx/filters/FilterGlobes.js delete mode 100644 tokenmagic/fx/filters/FilterGlow.js delete mode 100644 tokenmagic/fx/filters/FilterLiquid.js delete mode 100644 tokenmagic/fx/filters/FilterMirrorImages.js delete mode 100644 tokenmagic/fx/filters/FilterOldFilm.js delete mode 100644 tokenmagic/fx/filters/FilterOutline.js delete mode 100644 tokenmagic/fx/filters/FilterPixelate.js delete mode 100644 tokenmagic/fx/filters/FilterPolymorph.js delete mode 100644 tokenmagic/fx/filters/FilterRGBSplit.js delete mode 100644 tokenmagic/fx/filters/FilterRays.js delete mode 100644 tokenmagic/fx/filters/FilterRemoveShadow.js delete mode 100644 tokenmagic/fx/filters/FilterReplaceColor.js delete mode 100644 tokenmagic/fx/filters/FilterShockWave.js delete mode 100644 tokenmagic/fx/filters/FilterSmoke.js delete mode 100644 tokenmagic/fx/filters/FilterSolarRipples.js delete mode 100644 tokenmagic/fx/filters/FilterSpiderWeb.js delete mode 100644 tokenmagic/fx/filters/FilterSplash.js delete mode 100644 tokenmagic/fx/filters/FilterSprite.js delete mode 100644 tokenmagic/fx/filters/FilterSpriteMask.js delete mode 100644 tokenmagic/fx/filters/FilterTransform.js delete mode 100644 tokenmagic/fx/filters/FilterTwist.js delete mode 100644 tokenmagic/fx/filters/FilterWaves.js delete mode 100644 tokenmagic/fx/filters/FilterXFire.js delete mode 100644 tokenmagic/fx/filters/FilterXFog.js delete mode 100644 tokenmagic/fx/filters/FilterXRays.js delete mode 100644 tokenmagic/fx/filters/FilterZoomBlur.js delete mode 100644 tokenmagic/fx/filters/proto/FilterProto.js delete mode 100644 tokenmagic/fx/presets/defaultpresets.js delete mode 100644 tokenmagic/import/TMFX-default-presets.json delete mode 100644 tokenmagic/import/TMFX-update-presets-v040.json delete mode 100644 tokenmagic/import/TMFX-update-presets-v040b.json delete mode 100644 tokenmagic/import/TMFX-update-presets-v041.json delete mode 100644 tokenmagic/import/TMFX-update-presets-v043.json delete mode 100644 tokenmagic/lang/en.json delete mode 100644 tokenmagic/lang/es.json delete mode 100644 tokenmagic/lang/fr.json delete mode 100644 tokenmagic/lang/ja.json delete mode 100644 tokenmagic/lang/ko.json delete mode 100644 tokenmagic/lang/pt-BR.json delete mode 100644 tokenmagic/lang/ru.json delete mode 100644 tokenmagic/lang/zh-tw.json delete mode 100644 tokenmagic/libs/filters/pixi-filters.js delete mode 100644 tokenmagic/migration/migration.js delete mode 100644 tokenmagic/module.json delete mode 100644 tokenmagic/module/autoTemplate/TheWitcherTRPG.js delete mode 100644 tokenmagic/module/autoTemplate/dnd5e.js delete mode 100644 tokenmagic/module/autoTemplate/pf2e.js delete mode 100644 tokenmagic/module/proto/PlaceableObjectProto.js delete mode 100644 tokenmagic/module/settings.js delete mode 100644 tokenmagic/module/tokenmagic.js delete mode 100644 tokenmagic/packs/token-magic-book-of-fire/000386.log delete mode 100644 tokenmagic/packs/token-magic-portfolio/000389.log delete mode 100644 tokenmagic/styles/tokenmagic.css create mode 100644 vite.config.mjs diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..28e442a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +[*.yml] +indent_size = 2 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..7807f51 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,18 @@ +gulpfile.js +.eslintrc.js +.prettierrc.js +jsconfig.json +/.pnp.js +/.yarn/ + +.github/ +dist/ +docs/ +external/ +src/languages/ +src/assets/ +src/lang/ +src/scripts/ +src/styles/ +src/templates/ +src/**/*.svelte \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..0d0ef10 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,250 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true, + "jquery": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018, + "requireConfigFile": false, + "sourceType": "module", + "project": "./tsconfig.json", + }, + "plugins": [ + "jsdoc" + ], + "extends": [ + "prettier", + "plugin:import/errors", + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:json/recommended" + ], + "ignorePatterns": ["dist/"], + "rules": { + "array-bracket-spacing": ["warn", "never"], + "array-callback-return": "warn", + "arrow-spacing": "warn", + "comma-dangle": ["warn", "never"], + "comma-style": "warn", + "computed-property-spacing": "warn", + "constructor-super": "error", + "default-param-last": "warn", + "dot-location": ["warn", "property"], + "eol-last": ["error", "always"], + // "eqeqeq": ["warn", "smart"], + "func-call-spacing": "warn", + "func-names": ["warn", "never"], + "getter-return": "warn", + "lines-between-class-members": "warn", + "new-parens": ["warn", "always"], + "no-alert": "warn", + "no-array-constructor": "warn", + "no-class-assign": "warn", + "no-compare-neg-zero": "warn", + "no-cond-assign": "warn", + "no-const-assign": "error", + "no-constant-condition": "warn", + "no-constructor-return": "warn", + "no-delete-var": "warn", + "no-dupe-args": "warn", + "no-dupe-class-members": "warn", + "no-dupe-keys": "warn", + "no-duplicate-case": "warn", + "no-duplicate-imports": ["warn", {"includeExports": true}], + "no-empty": ["warn", {"allowEmptyCatch": true}], + "no-empty-character-class": "warn", + "no-empty-pattern": "warn", + "no-func-assign": "warn", + "no-global-assign": "warn", + "no-implicit-coercion": ["warn", {"allow": ["!!"]}], + "no-implied-eval": "warn", + "no-import-assign": "warn", + "no-invalid-regexp": "warn", + "no-irregular-whitespace": "warn", + "no-iterator": "warn", + "no-lone-blocks": "warn", + "no-lonely-if": "warn", + "no-loop-func": "warn", + "no-misleading-character-class": "warn", + "no-mixed-operators": "warn", + "no-multi-str": "warn", + "no-multiple-empty-lines": "warn", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-symbol": "warn", + "no-new-wrappers": "warn", + "no-nonoctal-decimal-escape": "warn", + "no-obj-calls": "warn", + "no-octal": "warn", + "no-octal-escape": "warn", + "no-promise-executor-return": "warn", + "no-proto": "warn", + "no-regex-spaces": "warn", + "no-script-url": "warn", + "no-self-assign": "warn", + "no-self-compare": "warn", + "no-setter-return": "warn", + "no-sequences": "warn", + "no-template-curly-in-string": "warn", + "no-this-before-super": "error", + "no-unexpected-multiline": "warn", + "no-unmodified-loop-condition": "warn", + "no-unneeded-ternary": "warn", + "no-unreachable": "warn", + "no-unreachable-loop": "warn", + "no-unsafe-negation": ["warn", {"enforceForOrderingRelations": true}], + "no-unsafe-optional-chaining": ["warn", {"disallowArithmeticOperators": true}], + "no-unused-expressions": "warn", + "no-useless-backreference": "warn", + "no-useless-call": "warn", + "no-useless-catch": "warn", + "no-useless-computed-key": ["warn", {"enforceForClassMembers": true}], + "no-useless-concat": "warn", + "no-useless-constructor": "warn", + "no-useless-rename": "warn", + "no-useless-return": "warn", + "no-var": "warn", + "no-void": "warn", + "no-whitespace-before-property": "warn", + "prefer-numeric-literals": "warn", + "prefer-object-spread": "warn", + "prefer-regex-literals": "warn", + "prefer-spread": "warn", + "rest-spread-spacing": ["warn", "never"], + "semi-spacing": "warn", + "semi-style": ["warn", "last"], + "space-unary-ops": ["warn", {"words": true, "nonwords": false}], + "switch-colon-spacing": "warn", + "symbol-description": "warn", + "template-curly-spacing": ["warn", "never"], + "unicode-bom": ["warn", "never"], + "use-isnan": ["warn", {"enforceForSwitchCase": true, "enforceForIndexOf": true}], + "valid-typeof": ["warn", {"requireStringLiterals": true}], + "wrap-iife": ["warn", "inside"], + + "arrow-parens": ["warn", "as-needed", {"requireForBlockBody": false}], + "capitalized-comments": ["warn", "always", {"ignoreConsecutiveComments": true}], + "comma-spacing": "warn", + "dot-notation": "warn", + "indent": ["warn", 2, {"SwitchCase": 1}], + "key-spacing": "warn", + "keyword-spacing": ["warn", {"overrides": {"catch": {"before": true, "after": false}}}], + "max-len": ["warn", { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true + }], + "no-extra-boolean-cast": ["warn", {"enforceForLogicalOperands": true}], + "no-extra-semi": "warn", + "no-multi-spaces": ["warn", {"ignoreEOLComments": true}], + "no-tabs": "warn", + "no-throw-literal": "error", + "no-trailing-spaces": "warn", + "no-useless-escape": "warn", + "no-unused-vars": ["warn", {"args": "none"}], + "nonblock-statement-body-position": ["warn", "beside"], + "one-var": ["warn", "never"], + "operator-linebreak": ["warn", "before", { + "overrides": {"=": "after", "+=": "after", "-=": "after"} + }], + "prefer-template": "warn", + "quote-props": ["warn", "as-needed", {"keywords": false}], + "quotes": ["warn", "double", {"avoidEscape": true, "allowTemplateLiterals": false}], + "semi": "warn", + "space-before-blocks": ["warn", "always"], + "space-before-function-paren": ["warn", { + "anonymous": "never", + "named": "never", + "asyncArrow": "always" + }], + // "spaced-comment": "warn", + + "jsdoc/check-access": "warn", + "jsdoc/check-alignment": "warn", + "jsdoc/check-examples": "off", + "jsdoc/check-indentation": "off", + "jsdoc/check-line-alignment": "off", + "jsdoc/check-param-names": "warn", + "jsdoc/check-property-names": "warn", + "jsdoc/check-syntax": "off", + "jsdoc/check-tag-names": "warn", + "jsdoc/check-types": "warn", + "jsdoc/check-values": "warn", + "jsdoc/empty-tags": "warn", + "jsdoc/implements-on-classes": "warn", + "jsdoc/match-description": "off", + "jsdoc/newline-after-description": "off", + "jsdoc/no-bad-blocks": "warn", + "jsdoc/no-defaults": "off", + "jsdoc/no-types": "off", + "jsdoc/no-undefined-types": "off", + "jsdoc/require-description": "warn", + "jsdoc/require-description-complete-sentence": "off", + "jsdoc/require-example": "off", + "jsdoc/require-file-overview": "off", + "jsdoc/require-hyphen-before-param-description": ["warn", "never"], + "jsdoc/require-jsdoc": "warn", + "jsdoc/require-param": "warn", + "jsdoc/require-param-description": "off", + "jsdoc/require-param-name": "warn", + "jsdoc/require-param-type": "warn", + "jsdoc/require-property": "warn", + "jsdoc/require-property-description": "off", + "jsdoc/require-property-name": "warn", + "jsdoc/require-property-type": "warn", + "jsdoc/require-returns": "warn", + "jsdoc/require-returns-check": "warn", + "jsdoc/require-returns-description": "off", + "jsdoc/require-returns-type": "warn", + "jsdoc/require-throws": "off", + "jsdoc/require-yields": "warn", + "jsdoc/require-yields-check": "warn", + "jsdoc/valid-types": "off", + + "eqeqeq": ["error", "always"], + "import/named": "off", + "import/no-default-export": "error", + "prettier/prettier": "error", + "no-console": "off", + "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], + "spaced-comment": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], + "@typescript-eslint/prefer-namespace-keyword": "off", + "@typescript-eslint/no-namespace": ["error", { "allowDeclarations": true }], + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", // Handled by tsconfig + "@typescript-eslint/array-type": ["error", { "default": "array" }], + }, + "settings": { + "jsdoc": { + "preferredTypes": { + ".<>": "<>" + }, + "tagNamePreference": { + "auguments": "extends" + } + }, + "import/resolver": { + "node": { + "paths": ["src", "types", "", "dist"], + "extensions": [".css", ".js", ".mjs", ".json", ".jsx", ".scss", ".ts", ".tsx"], + }, + "eslint-import-resolver-typescript": true, + "typescript": { + "alwaysTryTypes": true, + }, + }, + "import/parsers": { "@typescript-eslint/parser": [".ts"] }, + } +} diff --git a/.gitattributes b/.gitattributes index ef35ab7..815a562 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,7 @@ -tokenmagic/packs/** binary \ No newline at end of file +.github export-ignore +FUNDING.yml export-ignore + +.gitattributes export-ignore +README.md export-ignore +preview.jpg export-ignore +patchnotes.md export-ignore diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d8ed97e..0cc8d45 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,44 +1,44 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[BUG]" -labels: bug -assignees: '' - ---- - -**Module Version:** v0.0.0 - -**Before open any issue** - -1) Enable the module setting _"Enable debugging"_ -2) Click F12 go to the _console_ tab -3) make the test you want and replicate the error -4) Go to the tab console open on point 2) and just right click and click 'Save as' and 'Save' or send a screenshot of the exception on the console. -5) Attach the text file on the github issue with all the logs related tot he module, or send a screenshot of the messages on the console. - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Browser:** - - - -**Foundry Version:** - -**Game System:** - -**Additional context** -Add any other context (like other modules installed) about the problem here. +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + +**Module Version:** v0.0.0 + +**Before open any issue** + +1) Enable the module setting _"Enable debugging"_ +2) Click F12 go to the _console_ tab +3) make the test you want and replicate the error +4) Go to the tab console open on point 2) and just right click and click 'Save as' and 'Save' or send a screenshot of the exception on the console. +5) Attach the text file on the github issue with all the logs related tot he module, or send a screenshot of the messages on the console. + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Browser:** + - + +**Foundry Version:** + +**Game System:** + +**Additional context** +Add any other context (like other modules installed) about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 809b7b0..017320a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,10 +1,10 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - - +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/styling.md b/.github/ISSUE_TEMPLATE/styling.md index 914837c..43706ab 100644 --- a/.github/ISSUE_TEMPLATE/styling.md +++ b/.github/ISSUE_TEMPLATE/styling.md @@ -1,10 +1,10 @@ ---- -name: Styling -about: Request a change or bug related to styles -title: '' -labels: styling -assignees: '' - ---- - - +--- +name: Styling +about: Request a change or bug related to styles +title: '' +labels: styling +assignees: '' + +--- + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0b4aa1b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,131 @@ +name: Release Creation + +on: + release: + types: [ published ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Substitute the Manifest and Download URLs in the module.json + + - name: Substitute Manifest and Download Links For Versioned Ones + id: sub_release_manifest_version + uses: microsoft/variable-substitution@v1 + with: + files: 'src/module.json' + env: + version: ${{github.event.release.tag_name}} + url: https://github.com/${{github.repository}} + manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json + download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip + + # for a FULL RELEASE + # - name: Substitute Manifest and Download Links For Versioned Ones + # if: "!github.event.release.prerelease" + # id: sub_release_manifest_version + # uses: microsoft/variable-substitution@v1 + # with: + # files: 'module.json' + # env: + # version: ${{github.event.release.tag_name}} + # url: https://github.com/${{github.repository}} + # manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json + # download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip + + # Substitute the Manifest and Download URLs in the module.json + # for a PRE RELEASE. Manifest pointing to live module.json on branch, + # which is updated after tag. + # - name: Substitute Manifest and Download Links For Versioned Ones + # if: "github.event.release.prerelease" + # id: sub_prerelease_manifest_version + # uses: microsoft/variable-substitution@v1 + # with: + # files: 'module.json' + # env: + # version: ${{github.event.release.tag_name}} + # url: https://github.com/${{github.repository}} + # manifest: https://raw.githubusercontent.com/${{github.repository}}/next/module.json + # download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip + + # Install packages. + - run: npm install + + # Build distribution. + - run: npm run build + + - run: mkdir package + + - run: mv -v ./dist/* ./package/ + + # Create a zip file with all files required by the module to add to the release + #- run: zip -r ./module.zip module.json LICENSE module.js module.js.map style.css templates/ languages/ packs/ assets/ + # - run: zip -r ./package/module.zip ./package/* + + # && ensures that zip only runs if the directory was correctly changed, + # and the parentheses run everything in a subshell, so the current directory + # is restored at the end. Using OLDPWD avoids having to calculate the relative path to package.zip. + # https://unix.stackexchange.com/questions/385405/zip-all-files-and-subfolder-in-directory-without-parent-directory + - run: (cd package && zip -r "$OLDPWD/module.zip" .) + + - name: Update Release with Files + id: create_version_release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true # Set this to false if you want to prevent updating existing releases + name: ${{ github.event.release.name }} + draft: false + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: './src/module.json, ./module.zip' + tag: ${{ github.event.release.tag_name }} + body: ${{ github.event.release.body }} + + # Create a release for this specific version + # - name: Update Release with Files + # if: "!github.event.release.prerelease" + # id: create_version_release + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true # Set this to false if you want to prevent updating existing releases + # name: ${{ github.event.release.name }} + # draft: false + # prerelease: false + # token: ${{ secrets.GITHUB_TOKEN }} + # artifacts: './module.json, ./module.zip' + # tag: ${{ github.event.release.tag_name }} + # body: ${{ github.event.release.body }} + + # OR create a pre-release for this specific version + # - name: Update Release with Files + # if: "github.event.release.prerelease" + # id: create_version_prerelease + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true # Set this to false if you want to prevent updating existing releases + # name: ${{ github.event.release.name }} + # draft: false + # prerelease: true + # token: ${{ secrets.GITHUB_TOKEN }} + # artifacts: './module.json, ./module.zip' + # tag: ${{ github.event.release.tag_name }} + # body: ${{ github.event.release.body }} + + #update next branch + # - name: Prepare repository + # if: "github.event.release.prerelease" + # run: | + # git config --global user.name '${{github.actor}}' + # git config --global user.email '${{github.actor}}@users.noreply.github.com' + # git add module.json + # git stash + # git clean -f + # git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" + # git fetch origin "next" + # git switch -c "next" "origin/next" + # git checkout stash module.json + # git commit -m "${{github.event.release.tag_name}} manifest" + # git push -f diff --git a/.gitignore b/.gitignore index 36b0783..a99f3df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,122 @@ -# IDE -.vs/ -.vscode/ -.idea/ -# Module -tokenmagic.zip -tokenmagic/fx/assets/particles/ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# Foundry foundry.js -dist/* -tokenmagic/packs/* \ No newline at end of file +/dist +/package +/.vite-cache +/package-lock.json diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..36af219 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9c39c0c --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +/dist +/package-lock.json +/.pnp.js +/.yarn/ +/.vscode/ +/.idea +.vite-cache/** +**/*.md diff --git a/.prettierrc b/.prettierrc index 655730a..2561174 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,18 @@ { - "printWidth": 120, - "useTabs": true, - "singleQuote": true + "tabWidth": 2, + "useTabs": false, + "singleQuote": false, + "trailingComma": "es5", + "semi": true, + "printWidth": 120, + "bracketSpacing": true, + "overrides": [ + { + "files": ["*.scss", "*.css"], + "options": { + "requirePragma": false, + "parser": "scss" + } + } + ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index aac3969..af6d82f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,3 @@ -# Token Magic FX - Update v0.6.5.0 - -- Source files have been bundled to reduce number of requests -- New filter added under `TokenMagic Portfolio` - - `45 - Star Mask (spriteMask)` - - Uses the provided image's alpha component to mask the target -- New GUI added under `TokenMagic Portfolio - - `00 - D - TMFX GUI - Toggle Presets` - - Allows searching for and toggling of presets on currently selected placeables - # Token Magic FX - Update v0.6.4.1 - fixed v11 compatibility warnings diff --git a/README.md b/README.md index 41ddc3b..ffed14e 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,8 @@ [![Foundry Hub Endorsements](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Ftokenmagic%2Fshield%2Fendorsements&style=for-the-badge)](https://www.foundryvtt-hub.com/package/tokenmagic/) ![GitHub all releases](https://img.shields.io/github/downloads/Feu-Secret/tokenmagic/total?style=for-the-badge) -*If you want to support more modules of this kind, I invite you to go and support the original author to [ko-fi](https://ko-fi.com/K3K24XAWE) , or with [paypal](https://www.paypal.me/silentFire "Paypal")* +## If you want to support more modules of this kind, I invite you to go and support the original author [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/K3K24XAWE) , or [my paypal](https://www.paypal.me/silentFire "Paypal") -[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/K3K24XAWE) # Token Magic FX @@ -765,6 +764,51 @@ let glowFunc = async function() { glowFunc(); ``` +## Api + +TODO + +# Build + +## Install all packages + +```bash +npm install +``` + +### dev + +`dev` will let you develop you own code with hot reloading on the browser + +```bash +npm run dev +``` + +## npm build scripts + +### build + +`build` will build and set up a symlink between `dist` and your `dataPath`. + +```bash +npm run build +``` + +### build-watch + +`build-watch` will build and watch for changes, rebuilding automatically. + +```bash +npm run build-watch +``` + +### prettier-format + +`prettier-format` launch the prettier plugin based on the configuration [here](./.prettierrc) + +```bash +npm run-script prettier-format +``` ## Issues @@ -804,4 +848,3 @@ My most sincere thanks. *Discord : SecretFire#4843* - diff --git a/package.json b/package.json index 89d9e12..f4d2e21 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,56 @@ { "name": "tokenmagic", - "version": "1.0.0", + "title": "Token Magic FX", + "description": "

Add special effects and animations on your tokens, tiles, drawings and templates.

", + "version": "0.6.4.1", + "main": "module.js", + "license": "SEE LICENSE IN LICENSE", "private": true, "type": "module", - "source:": "tokenmagic/module/tokenmagic.js", - "main": "tokenmagic/module/tokenmagicBundle.js", - "targets": { - "main": { - "optimize": true - } + "author": "", + "contributors": [], + "imports": { + "#runtime/*": "@typhonjs-fvtt/runtime/*", + "#standard/*": "@typhonjs-fvtt/svelte-standard/*" + }, + "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.4.0", + "@fortawesome/free-solid-svg-icons": "^6.4.0", + "@fortawesome/react-fontawesome": "^0.2.0", + "@rollup/plugin-node-resolve": "^15.2.1", + "@typhonjs-fvtt/runtime": "^0.1.0", + "@typhonjs-fvtt/svelte-standard": "^0.1.0", + "svelte": "^4.0.0", + "svelte-virtual-scroll-list": "^1.1.0" }, "devDependencies": { - "parcel": "latest" + "@typhonjs-config/eslint-config": "^0.3.0", + "eslint": "^8", + "husky": "^8.0.3", + "jquery": "^3.6.4", + "jsdoc": "^4.0.2", + "lint-staged": "^13.2.1", + "prettier": "^2.8.7", + "sass": "^1.63.6", + "svelte-dnd-action": "^0.9.18", + "svelte-preprocess": "^5", + "vite": "^4.4.0", + "vite-plugin-clean": "^1.0.0", + "vite-plugin-run": "^0.4.1", + "vite-plugin-static-copy": "^0.16.0" }, + "browserslist": [ + ">5%", + "not IE 11" + ], "scripts": { - "build": "npx parcel build tokenmagic/module/tokenmagic.js", - "watch": "npx parcel watch tokenmagic/module/tokenmagic.js" + "build": "vite build", + "dev": "vite", + "eslint": "eslint .", + "prepare": "husky install", + "prettier-format": "prettier --config .prettierrc --write \"./src/**/*.{js,mjs,json,scss,css}\"" + }, + "lint-staged": { + "*.{js,css}": "prettier --write" } } diff --git a/src/fx/Anime.js b/src/fx/Anime.js new file mode 100644 index 0000000..80e926d --- /dev/null +++ b/src/fx/Anime.js @@ -0,0 +1,560 @@ +import { isAnimationDisabled } from "../module.js"; + +export class Anime { + constructor(puppet) { + const self = this; + this.puppet = puppet; + this.animated = null; + this.animeId = randomID(); + + // Time/synchronization related variables + this.frameTime = {}; + this.elapsedTime = {}; + this.loopElapsedTime = {}; + this.loops = {}; + this.internalLoops = {}; + this.ping = {}; + this.pauseBetweenElapsedTime = {}; + this.pauseBetween = {}; + this.shutdown = {}; + + if (!(this.puppet == null)) { + if ( + this.puppet.hasOwnProperty("animated") && + !(this.puppet.animated == null) && + typeof this.puppet.animated === "object" && + Object.keys(this.puppet.animated).length > 0 + ) { + this.initAnimatedInternals(this.puppet.animated); + this.animated = this.puppet.animated; // easy access to the puppet's animodes + } + Anime.addAnimation(self); // ready to tick + } + } + + static rgbToValue(r, g, b) { + return (r << 16) | (g << 8) | b; + } + + static valueToRgb(bin) { + const r = bin >> 16; + const g = (bin >> 8) & 0xff; + const b = bin & 0xff; + return [r, g, b]; + } + + static oscillation(elapsed, loopDuration, syncShift, val1, val2, func, isSync, xpi = Anime.twoPi) { + return ( + ((val1 - val2) * + (func( + xpi * (isSync ? Anime.getSynchronizedTime(loopDuration, syncShift) : elapsed / loopDuration + syncShift) + ) + + 1)) / + 2 + + val2 + ); + } + + static colOscillation(elapsed, loopDuration, syncShift, val1, val2, isSync, xpi = Anime.twoPi) { + const rgbValue1 = Anime.valueToRgb(val1); + const rgbValue2 = Anime.valueToRgb(val2); + + return Anime.rgbToValue( + Math.floor( + Anime.oscillation(elapsed, loopDuration, syncShift, rgbValue1[0], rgbValue2[0], Math.cos, isSync, xpi) + ), + Math.floor( + Anime.oscillation(elapsed, loopDuration, syncShift, rgbValue1[1], rgbValue2[1], Math.cos, isSync, xpi) + ), + Math.floor(Anime.oscillation(elapsed, loopDuration, syncShift, rgbValue1[2], rgbValue2[2], Math.cos, isSync, xpi)) + ); + } + + static getSynchronizedTime(loopDuration, syncShift) { + return Anime._lastTime / loopDuration + syncShift; + } + + static getSynchronizedRotation(loopDuration, syncShift) { + return (360 * ((Anime._lastTime + syncShift) % loopDuration)) / loopDuration; + } + + static getPuppetsByParams(params) { + let puppetArray = []; + Anime._animeMap.forEach((anime, id) => { + if ( + anime.puppet.placeableId === params.placeableId && + anime.puppet.filterId === params.filterId && + (!anime.puppet.hasOwnProperty("filterInternalId") || anime.puppet.filterInternalId === params.filterInternalId) + ) { + puppetArray.push(anime.puppet); + } + }); + return puppetArray; + } + + static addAnimation(anime) { + Anime._animeMap.set(anime.animeId, anime); + Anime._resumeAnimation(); + } + + static removeAnimation(placeableId) { + Anime._animeMap.forEach((anime, id) => { + if (anime.puppet.placeableId === placeableId) { + Anime._animeMap.delete(id); + } + }); + if (Anime._animeMap.size === 0) { + Anime._suspendAnimation(); + } + } + + static removeAnimationByFilterId(placeableId, filterId) { + Anime._animeMap.forEach((anime, id) => { + if (anime.puppet.placeableId === placeableId && anime.puppet.filterId === filterId) { + Anime._animeMap.delete(id); + } + }); + if (Anime._animeMap.size === 0) { + Anime._suspendAnimation(); + } + } + + static resetAnimation() { + Anime._animeMap = new Map(); + Anime._suspended = true; + } + + static tick() { + Anime._lastTime = canvas.app.ticker.lastTime; + Anime._frameTime = Anime._lastTime - Anime._prevTime; + + for (const [id, anime] of Anime._animeMap) { + if (anime.puppet.enabled) { + if (anime.puppet.hasOwnProperty("preComputation") && anime.puppet.placeableImg != null) { + anime.puppet.preComputation(); + } + if (anime.puppet.hasOwnProperty("animated") && !(anime.puppet.animated == null)) { + anime.animate(Anime._frameTime); + } + } + } + + Anime._prevTime = Anime._lastTime; + } + + static _suspendAnimation() { + if (Anime._activated && !Anime._suspended && !isAnimationDisabled()) { + Anime._detachFromTicker(); + } + Anime._suspended = true; + } + + static _resumeAnimation() { + if (Anime._activated && Anime._suspended && !isAnimationDisabled()) { + Anime._attachToTicker(); + } + Anime._suspended = false; + } + + static activateAnimation() { + if (!Anime._activated && !Anime._suspended && !isAnimationDisabled()) { + Anime._attachToTicker(); + } + Anime._activated = true; + } + + static deactivateAnimation() { + if (Anime._activated && !Anime._suspended && !isAnimationDisabled()) { + Anime._detachFromTicker(); + } + Anime._activated = false; + } + + static _attachToTicker() { + canvas.app.ticker.add(Anime.tick, this, PIXI.UPDATE_PRIORITY.LOW + 1); + Anime._lastTime = canvas.app.ticker.lastTime; + Anime._prevTime = Anime._lastTime; + } + + static _detachFromTicker() { + canvas.app.ticker.remove(Anime.tick, this); + Anime._lastTime = 0; + Anime._prevTime = 0; + } + + static getAnimeMap() { + return Anime._animeMap; + } + + initAnimatedInternals(animated) { + Object.keys(animated).forEach((effect) => { + // Internals init + this.initInternals(effect); + }); + } + + initInternals(effect) { + this.elapsedTime[effect] = 0; + this.loopElapsedTime[effect] = 0; + this.pauseBetweenElapsedTime[effect] = 0; + this.loops[effect] = 0; + this.internalLoops[effect] = 0; + this.frameTime[effect] = 0; + this.pauseBetween[effect] = false; + this.ping[effect] = false; + this.shutdown[effect] = false; + } + + hasInternals(effect) { + return this.elapsedTime.hasOwnProperty(effect); + } + + animate(frameTime) { + for (const effect of Object.keys(this.puppet.animated)) { + if (this.animated[effect].active && this.cycleCheck(effect, frameTime)) { + if (this[this.animated[effect].animType] != null) { + this[this.animated[effect].animType](effect); + } + if (this.shutdown[effect]) { + this.animated[effect].active = false; + this.shutdown[effect] = false; + + // persists the value of an effect which is terminated. + this.persistTerminatedEffect(effect); + } else { + this.loopElapsedTime[effect] += frameTime; + this.elapsedTime[effect] += frameTime; + } + } + } + this.autoDisableCheck(); + } + + cycleCheck(effect, frameTime) { + this.frameTime[effect] = frameTime; + + if (this.isPauseBetweenLoop(effect, frameTime)) { + return false; + } + + if (this.loopElapsedTime[effect] > this.animated[effect].loopDuration) { + this.loopElapsedTime[effect] -= this.animated[effect].loopDuration; + this.ping[effect] = true; + + if (this.animated[effect].loops !== Infinity) { + this.loops[effect]++; + this.internalLoops[effect]++; + } + + if (this.loops[effect] >= this.animated[effect].loops) { + // correction to stop exactly on the target value when the last loop end. + this.elapsedTime[effect] = this.internalLoops[effect] * this.animated[effect].loopDuration; + this.loops[effect] = 0; + this.loopElapsedTime[effect] = 0; + this.shutdown[effect] = true; + } else if (this.animated[effect].pauseBetweenDuration > 0) { + this.elapsedTime[effect] = this.animated[effect].loopDuration; + this.pauseBetween[effect] = true; + } + } + return true; + } + + async persistTerminatedEffect(effect) { + if (!(this.puppet.filterOwner === game.data.userId)) { + return; + } + + let animeInfo; + let doInit = true; + let flag = this.puppet.targetPlaceable.document.getFlag("tokenmagic", "animeInfo"); + + if (flag) { + // fastest than array.find + for (const animeinfo of flag.values()) { + if ( + animeinfo.tmFilterId === this.puppet.filterId && + animeinfo.tmFilterInternalId === this.puppet.filterInternalId && + animeinfo.tmFilterEffect === effect + ) { + if (animeinfo && animeinfo instanceof Object) { + animeinfo.tmFilterEffectValue = this.puppet[effect]; + doInit = false; + break; + } + } + } + } + + if (doInit) { + animeInfo = [ + { + tmFilterId: this.puppet.filterId, + tmFilterInternalId: this.puppet.filterInternalId, + tmFilterEffect: effect, + tmFilterEffectValue: this.puppet[effect], + }, + ]; + + if (flag) flag = flag.concat(animeInfo); + else flag = animeInfo; + } + + flag = duplicate(flag); + await this.puppet.targetPlaceable._TMFXsetAnimeFlag(flag); + } + + autoDisableCheck() { + if (!(this.puppet.autoDisable || this.puppet.autoDestroy)) { + return; + } + if (!(this.puppet.filterOwner === game.data.userId)) { + return; + } + if (this.puppet.enabled === false && !this.puppet.autoDestroy) { + return; + } + + if (Object.values(this.animated).every((animeEffect) => animeEffect.active === false)) { + this.disableOrDestroy(); + } + } + + async disableOrDestroy() { + if (this.puppet == null) return; + const placeable = this.puppet.targetPlaceable; + if (placeable == null) return; + + if (this.puppet.autoDestroy) { + await window.TokenMagic.deleteFilters(placeable, this.puppet.filterId); + } else { + let params = {}; + params.filterType = this.puppet.filterType; + params.filterId = this.puppet.filterId; + params.enabled = false; + await window.TokenMagic.updateFiltersByPlaceable(placeable, [params]); + } + } + + isPauseBetweenLoop(effect, frametime) { + if (this.pauseBetween[effect] && this.animated[effect].pauseBetweenDuration > 0) { + this.pauseBetweenElapsedTime[effect] += frametime; + if (this.pauseBetweenElapsedTime[effect] < this.animated[effect].pauseBetweenDuration) { + return true; + } else { + this.pauseBetweenElapsedTime[effect] = 0; + return (this.pauseBetween[effect] = false); + } + } + return false; + } + + pauseBetweenCheck(effect, frametime) { + if (this.pauseStart[effect] && this.animated[effect].pauseStartDuration > 0) { + this.pauseStartElapsedTime[effect] += frametime; + if (this.pauseStartElapsedTime[effect] < this.animated[effect].pauseStartDuration) { + return false; + } else { + this.pauseStart[effect] = false; + return true; + } + } + } + + moveToward(effect) { + this.puppet[effect] = + ((this.animated[effect].val1 - this.animated[effect].val2) / this.animated[effect].loopDuration) * + this.elapsedTime[effect]; + } + + colorOscillation(effect) { + this.puppet[effect] = Anime.colOscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + false + ); + } + + halfColorOscillation(effect) { + this.puppet[effect] = Anime.colOscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + false, + Math.PI + ); + } + + syncColorOscillation(effect) { + this.puppet[effect] = Anime.colOscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + true + ); + } + + cosOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + Math.cos, + false + ); + } + + halfCosOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + Math.cos, + false, + Math.PI + ); + } + + sinOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + Math.sin, + false + ); + } + + halfSinOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + Math.sin, + false, + Math.PI + ); + } + + chaoticOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift + Math.random() * this.animated[effect].chaosFactor, + this.animated[effect].val1, + this.animated[effect].val2, + Math.cos, + false + ); + } + + syncCosOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + Math.cos, + true + ); + } + + syncSinOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift, + this.animated[effect].val1, + this.animated[effect].val2, + Math.sin, + true + ); + } + + syncChaoticOscillation(effect) { + this.puppet[effect] = Anime.oscillation( + this.elapsedTime[effect], + this.animated[effect].loopDuration, + this.animated[effect].syncShift + Math.random() * this.animated[effect].chaosFactor, + this.animated[effect].val1, + this.animated[effect].val2, + Math.cos, + true + ); + } + + rotation(effect) { + const computedRotation = (360 * this.elapsedTime[effect]) / this.animated[effect].loopDuration; + this.puppet[effect] = this.animated[effect].clockWise ? computedRotation : 360 - computedRotation; + } + + syncRotation(effect) { + const computedRotation = Anime.getSynchronizedRotation( + this.animated[effect].loopDuration, + this.animated[effect].syncShift + ); + this.puppet[effect] = this.animated[effect].clockWise ? computedRotation : 360 - computedRotation; + } + + randomNumber(effect) { + const randomNumber = + Math.random() * (this.animated[effect].val2 - this.animated[effect].val1) + this.animated[effect].val1; + if (this.animated[effect].wantInteger) { + this.puppet[effect] = Math.floor(randomNumber); + } else { + this.puppet[effect] = randomNumber; + } + } + + randomNumberPerLoop(effect) { + if (this._ringing(effect)) { + this.randomNumber(effect); + } + } + + randomColor(effect) { + this.puppet[effect] = Math.floor(Math.random() * 16777215); + } + + randomColorPerLoop(effect) { + if (this._ringing(effect)) { + this.randomColor(effect); + } + } + + move(effect) { + this.puppet[effect] += this.animated[effect].speed * this.frameTime[effect]; + } + + _ringing(effect) { + if (this.ping[effect]) { + this.ping[effect] = false; + return true; + } + return false; + } +} + +Anime._lastTime = 0; +Anime._prevTime = 0; +Anime._frameTime = 0; +Anime._animeMap = new Map(); +Anime.twoPi = Math.PI * 2; +Anime._activated = false; +Anime._suspended = true; diff --git a/tokenmagic/fx/assets/box.webp b/src/fx/assets/box.webp similarity index 100% rename from tokenmagic/fx/assets/box.webp rename to src/fx/assets/box.webp diff --git a/tokenmagic/fx/assets/distortion-1.png b/src/fx/assets/distortion-1.png similarity index 100% rename from tokenmagic/fx/assets/distortion-1.png rename to src/fx/assets/distortion-1.png diff --git a/tokenmagic/fx/assets/dots-1.png b/src/fx/assets/dots-1.png similarity index 100% rename from tokenmagic/fx/assets/dots-1.png rename to src/fx/assets/dots-1.png diff --git a/tokenmagic/fx/assets/extrusion-1.png b/src/fx/assets/extrusion-1.png similarity index 100% rename from tokenmagic/fx/assets/extrusion-1.png rename to src/fx/assets/extrusion-1.png diff --git a/tokenmagic/fx/assets/gem-1.png b/src/fx/assets/gem-1.png similarity index 100% rename from tokenmagic/fx/assets/gem-1.png rename to src/fx/assets/gem-1.png diff --git a/tokenmagic/fx/assets/gem-2.png b/src/fx/assets/gem-2.png similarity index 100% rename from tokenmagic/fx/assets/gem-2.png rename to src/fx/assets/gem-2.png diff --git a/tokenmagic/fx/assets/hexa-1.png b/src/fx/assets/hexa-1.png similarity index 100% rename from tokenmagic/fx/assets/hexa-1.png rename to src/fx/assets/hexa-1.png diff --git a/tokenmagic/fx/assets/noise-1.png b/src/fx/assets/noise-1.png similarity index 100% rename from tokenmagic/fx/assets/noise-1.png rename to src/fx/assets/noise-1.png diff --git a/tokenmagic/fx/assets/noise-2.jpg b/src/fx/assets/noise-2.jpg similarity index 100% rename from tokenmagic/fx/assets/noise-2.jpg rename to src/fx/assets/noise-2.jpg diff --git a/tokenmagic/fx/assets/noise-3.jpg b/src/fx/assets/noise-3.jpg similarity index 100% rename from tokenmagic/fx/assets/noise-3.jpg rename to src/fx/assets/noise-3.jpg diff --git a/tokenmagic/fx/assets/noise.jpg b/src/fx/assets/noise.jpg similarity index 100% rename from tokenmagic/fx/assets/noise.jpg rename to src/fx/assets/noise.jpg diff --git a/tokenmagic/fx/assets/noise.png b/src/fx/assets/noise.png similarity index 100% rename from tokenmagic/fx/assets/noise.png rename to src/fx/assets/noise.png diff --git a/tokenmagic/fx/assets/pentagram.png b/src/fx/assets/pentagram.png similarity index 100% rename from tokenmagic/fx/assets/pentagram.png rename to src/fx/assets/pentagram.png diff --git a/tokenmagic/fx/assets/star.webp b/src/fx/assets/star.webp similarity index 100% rename from tokenmagic/fx/assets/star.webp rename to src/fx/assets/star.webp diff --git a/tokenmagic/fx/assets/symbols-1.png b/src/fx/assets/symbols-1.png similarity index 100% rename from tokenmagic/fx/assets/symbols-1.png rename to src/fx/assets/symbols-1.png diff --git a/tokenmagic/fx/assets/templates/black-tone-pure.png b/src/fx/assets/templates/black-tone-pure.png similarity index 100% rename from tokenmagic/fx/assets/templates/black-tone-pure.png rename to src/fx/assets/templates/black-tone-pure.png diff --git a/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png b/src/fx/assets/templates/black-tone-strong-opacity.png similarity index 100% rename from tokenmagic/fx/assets/templates/black-tone-strong-opacity.png rename to src/fx/assets/templates/black-tone-strong-opacity.png diff --git a/tokenmagic/fx/assets/templates/black-tone-vstrong-opacity.png b/src/fx/assets/templates/black-tone-vstrong-opacity.png similarity index 100% rename from tokenmagic/fx/assets/templates/black-tone-vstrong-opacity.png rename to src/fx/assets/templates/black-tone-vstrong-opacity.png diff --git a/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png b/src/fx/assets/templates/white-tone-strong-opacity.png similarity index 100% rename from tokenmagic/fx/assets/templates/white-tone-strong-opacity.png rename to src/fx/assets/templates/white-tone-strong-opacity.png diff --git a/tokenmagic/fx/assets/videos/IounStoneGreaterAbsorption.webm b/src/fx/assets/videos/IounStoneGreaterAbsorption.webm similarity index 100% rename from tokenmagic/fx/assets/videos/IounStoneGreaterAbsorption.webm rename to src/fx/assets/videos/IounStoneGreaterAbsorption.webm diff --git a/tokenmagic/fx/assets/waves-1.png b/src/fx/assets/waves-1.png similarity index 100% rename from tokenmagic/fx/assets/waves-1.png rename to src/fx/assets/waves-1.png diff --git a/tokenmagic/fx/assets/waves-2.png b/src/fx/assets/waves-2.png similarity index 100% rename from tokenmagic/fx/assets/waves-2.png rename to src/fx/assets/waves-2.png diff --git a/tokenmagic/fx/assets/waves-3.png b/src/fx/assets/waves-3.png similarity index 100% rename from tokenmagic/fx/assets/waves-3.png rename to src/fx/assets/waves-3.png diff --git a/src/fx/filters/CustomFilter.js b/src/fx/filters/CustomFilter.js new file mode 100644 index 0000000..3c62ac7 --- /dev/null +++ b/src/fx/filters/CustomFilter.js @@ -0,0 +1,73 @@ +const _tempRect = new PIXI.Rectangle(); + +export class CustomFilter extends PIXI.Filter { + constructor(...args) { + super(...args); + + if (!this.uniforms.filterMatrix || !this.uniforms.filterMatrixInverse) + this.uniforms.filterMatrix = new PIXI.Matrix(); + + if (!this.uniforms.filterMatrixInverse) this.uniforms.filterMatrixInverse = new PIXI.Matrix(); + } + + apply(filterManager, input, output, clear) { + const filterMatrix = this.uniforms.filterMatrix; + + if (filterMatrix) { + const { sourceFrame, destinationFrame, target } = filterManager.activeState; + + filterMatrix.set(destinationFrame.width, 0, 0, destinationFrame.height, sourceFrame.x, sourceFrame.y); + + const worldTransform = PIXI.Matrix.TEMP_MATRIX; + + const localBounds = target.getLocalBounds(_tempRect); + + if (this.sticky) { + worldTransform.copyFrom(target.transform.worldTransform); + worldTransform.invert(); + + const rotation = target.transform.rotation; + const sin = Math.sin(rotation); + const cos = Math.cos(rotation); + const scaleX = Math.hypot( + cos * worldTransform.a + sin * worldTransform.c, + cos * worldTransform.b + sin * worldTransform.d + ); + const scaleY = Math.hypot( + -sin * worldTransform.a + cos * worldTransform.c, + -sin * worldTransform.b + cos * worldTransform.d + ); + + localBounds.pad(scaleX * this.boundsPadding.x, scaleY * this.boundsPadding.y); + } else { + const transform = target.transform; + worldTransform.a = transform.scale.x; + worldTransform.b = 0; + worldTransform.c = 0; + worldTransform.d = transform.scale.y; + worldTransform.tx = transform.position.x - transform.pivot.x * transform.scale.x; + worldTransform.ty = transform.position.y - transform.pivot.y * transform.scale.y; + worldTransform.prepend(target.parent.transform.worldTransform); + worldTransform.invert(); + + const scaleX = Math.hypot(worldTransform.a, worldTransform.b); + const scaleY = Math.hypot(worldTransform.c, worldTransform.d); + + localBounds.pad(scaleX * this.boundsPadding.x, scaleY * this.boundsPadding.y); + } + + filterMatrix.prepend(worldTransform); + filterMatrix.translate(-localBounds.x, -localBounds.y); + filterMatrix.scale(1.0 / localBounds.width, 1.0 / localBounds.height); + + const filterMatrixInverse = this.uniforms.filterMatrixInverse; + + if (filterMatrixInverse) { + filterMatrixInverse.copyFrom(filterMatrix); + filterMatrixInverse.invert(); + } + } + + filterManager.applyFilter(this, input, output, clear); + } +} diff --git a/src/fx/filters/FilterAdjustment.js b/src/fx/filters/FilterAdjustment.js new file mode 100644 index 0000000..c443256 --- /dev/null +++ b/src/fx/filters/FilterAdjustment.js @@ -0,0 +1,24 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterAdjustment extends PIXI.filters.AdjustmentFilter { + constructor(params) { + super(); + this.enabled = false; + this.gamma = 1; + this.saturation = 1; + this.contrast = 1; + this.brightness = 1; + this.red = 1; + this.green = 1; + this.blue = 1; + this.alpha = 1; + this.zOrder = 30; + this.animating = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterAdvancedBloom.js b/src/fx/filters/FilterAdvancedBloom.js new file mode 100644 index 0000000..276f54b --- /dev/null +++ b/src/fx/filters/FilterAdvancedBloom.js @@ -0,0 +1,23 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterXBloom extends PIXI.filters.AdvancedBloomFilter { + constructor(params) { + super(); + + this.enabled = false; + this.threshold = 0.5; + this.bloomScale = 1.0; + this.brightness = 1.0; + this.blur = 4.0; + this.quality = 4.0; + this.zOrder = 40; + + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterAscii.js b/src/fx/filters/FilterAscii.js new file mode 100644 index 0000000..ce94905 --- /dev/null +++ b/src/fx/filters/FilterAscii.js @@ -0,0 +1,16 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterAscii extends PIXI.filters.AsciiFilter { + constructor(params) { + super(); + this.size = 8; + this.zOrder = 310; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterBevel.js b/src/fx/filters/FilterBevel.js new file mode 100644 index 0000000..39b1897 --- /dev/null +++ b/src/fx/filters/FilterBevel.js @@ -0,0 +1,25 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterBevel extends PIXI.filters.BevelFilter { + constructor(params) { + super(); + this.blendMode = PIXI.BLEND_MODES.NORMAL; + this.padding = 10; + this.enabled = false; + this.rotation = 0; + this.thickness = 5; + this.lightColor = 0xffffff; + this.lightAlpha = 0.95; + this.shadowColor = 0x000000; + this.shadowAlpha = 0.95; + this.zOrder = 90; + this.quality = 1; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterBlur.js b/src/fx/filters/FilterBlur.js new file mode 100644 index 0000000..2f63ffb --- /dev/null +++ b/src/fx/filters/FilterBlur.js @@ -0,0 +1,52 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; +import { FilterBlurEx } from "./FilterBlurEx.js"; + +export class FilterBlur extends FilterBlurEx { + constructor(params) { + super(); + this.enabled = false; + this.blur = 2; + this.quality = 4; + this.zOrder = 290; + this.repeatEdgePixels = false; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get blur() { + return this.strengthX; + } + + set blur(value) { + this.strengthX = this.strengthY = value; + } + + get blurX() { + return this.strengthX; + } + + set blurX(value) { + this.strengthX = value; + } + + get blurY() { + return this.strengthY; + } + + set blurY(value) { + this.strengthY = value; + } + + calculatePadding() { + const scale = this.targetPlaceable.worldTransform.a; + this.blurXFilter.blur = scale * this.strengthX; + this.blurYFilter.blur = scale * this.strengthY; + this.updatePadding(); + super.calculatePadding(); + } +} diff --git a/src/fx/filters/FilterBlurEx.js b/src/fx/filters/FilterBlurEx.js new file mode 100644 index 0000000..03414a6 --- /dev/null +++ b/src/fx/filters/FilterBlurEx.js @@ -0,0 +1,311 @@ +import { CustomFilter } from "./CustomFilter.js"; + +export class FilterBlurEx extends CustomFilter { + blurXFilter; + blurYFilter; + + _repeatEdgePixels; + + constructor(strength = 8, quality = 4, resolution = PIXI.settings.FILTER_RESOLUTION, kernelSize = 5) { + super(); + + this.blurXFilter = new BlurFilterPassEx(true, strength, quality, resolution, kernelSize); + this.blurYFilter = new BlurFilterPassEx(false, strength, quality, resolution, kernelSize); + + this.resolution = resolution; + this.quality = quality; + this.blur = strength; + + this.repeatEdgePixels = false; + } + + apply(filterManager, input, output, clearMode) { + const xStrength = Math.abs(this.blurXFilter.strength); + const yStrength = Math.abs(this.blurYFilter.strength); + + if (xStrength && yStrength) { + const renderTarget = filterManager.getFilterTexture(); + + this.blurXFilter.apply(filterManager, input, renderTarget, PIXI.CLEAR_MODES.CLEAR); + this.blurYFilter.apply(filterManager, renderTarget, output, clearMode); + + filterManager.returnFilterTexture(renderTarget); + } else if (yStrength) { + this.blurYFilter.apply(filterManager, input, output, clearMode); + } else { + this.blurXFilter.apply(filterManager, input, output, clearMode); + } + } + + updatePadding() { + if (this._repeatEdgePixels) { + this.padding = 0; + } else { + this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2; + } + } + + get blur() { + return this.blurXFilter.blur; + } + + set blur(value) { + this.blurXFilter.blur = this.blurYFilter.blur = value; + this.updatePadding(); + } + + get quality() { + return this.blurXFilter.quality; + } + + set quality(value) { + this.blurXFilter.quality = this.blurYFilter.quality = value; + } + + get blurX() { + return this.blurXFilter.blur; + } + + set blurX(value) { + this.blurXFilter.blur = value; + this.updatePadding(); + } + + get blurY() { + return this.blurYFilter.blur; + } + + set blurY(value) { + this.blurYFilter.blur = value; + this.updatePadding(); + } + + get blendMode() { + return this.blurYFilter.blendMode; + } + + set blendMode(value) { + this.blurYFilter.blendMode = value; + } + + get repeatEdgePixels() { + return this._repeatEdgePixels; + } + + set repeatEdgePixels(value) { + this._repeatEdgePixels = value; + this.updatePadding(); + } +} + +export class BlurFilterPassEx extends CustomFilter { + horizontal; + strength; + passes; + _quality; + + constructor(horizontal, strength = 8, quality = 4, resolution = PIXI.settings.FILTER_RESOLUTION, kernelSize = 5) { + const vertSrc = generateBlurVertSource(kernelSize, horizontal); + const fragSrc = generateBlurFragSource(kernelSize); + + super( + // vertex shader + vertSrc, + // fragment shader + fragSrc + ); + + this.horizontal = horizontal; + + this.resolution = resolution; + + this._quality = 0; + + this.quality = quality; + + this.blur = strength; + } + + apply(filterManager, input, output, clearMode) { + if (output) { + if (this.horizontal) { + this.uniforms.strength = (1 / output.width) * (output.width / input.width); + } else { + this.uniforms.strength = (1 / output.height) * (output.height / input.height); + } + } else { + if (this.horizontal) { + this.uniforms.strength = (1 / filterManager.renderer.width) * (filterManager.renderer.width / input.width); + } else { + this.uniforms.strength = (1 / filterManager.renderer.height) * (filterManager.renderer.height / input.height); + } + } + + // screen space! + this.uniforms.strength *= this.strength; + this.uniforms.strength /= this.passes; + + if (this.passes === 1) { + filterManager.applyFilter(this, input, output, clearMode); + } else { + const renderTarget = filterManager.getFilterTexture(); + const renderer = filterManager.renderer; + + let flip = input; + let flop = renderTarget; + + this.state.blend = false; + filterManager.applyFilter(this, flip, flop, PIXI.CLEAR_MODES.CLEAR); + + for (let i = 1; i < this.passes - 1; i++) { + filterManager.bindAndClear(flip, PIXI.CLEAR_MODES.BLIT); + + this.uniforms.uSampler = flop; + + const temp = flop; + + flop = flip; + flip = temp; + + renderer.shader.bind(this); + renderer.geometry.draw(5); + } + + this.state.blend = true; + filterManager.applyFilter(this, flop, output, clearMode); + filterManager.returnFilterTexture(renderTarget); + } + } + + get blur() { + return this.strength; + } + + set blur(value) { + this.padding = 1 + Math.abs(value) * 2; + this.strength = value; + } + + get quality() { + return this._quality; + } + + set quality(value) { + this._quality = value; + this.passes = value; + } +} + +const GAUSSIAN_VALUES = { + 5: [0.153388, 0.221461, 0.250301], + 7: [0.071303, 0.131514, 0.189879, 0.214607], + 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236], + 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596], + 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641], + 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448], +}; + +const fragTemplate = [ + "varying vec2 vBlurTexCoords[%size%];", + "uniform sampler2D uSampler;", + + "void main(void)", + "{", + " gl_FragColor = vec4(0.0);", + " %blur%", + "}", +].join("\n"); + +export function generateBlurFragSource(kernelSize) { + const kernel = GAUSSIAN_VALUES[kernelSize]; + const halfLength = kernel.length; + + let fragSource = fragTemplate; + + let blurLoop = ""; + const template = "gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;"; + let value; + + for (let i = 0; i < kernelSize; i++) { + let blur = template.replace("%index%", i.toString()); + + value = i; + + if (i >= halfLength) { + value = kernelSize - i - 1; + } + + blur = blur.replace("%value%", kernel[value].toString()); + + blurLoop += blur; + blurLoop += "\n"; + } + + fragSource = fragSource.replace("%blur%", blurLoop); + fragSource = fragSource.replace("%size%", kernelSize.toString()); + + return fragSource; +} + +const vertTemplate = ` + attribute vec2 aVertexPosition; + uniform mat3 projectionMatrix; + uniform float strength; + varying vec2 vBlurTexCoords[%size%]; + uniform vec4 inputSize; + uniform vec4 outputFrame; + vec4 filterVertexPosition( void ) + { + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); + } + vec2 filterTextureCoord( void ) + { + return aVertexPosition * (outputFrame.zw * inputSize.zw); + } + void main(void) + { + gl_Position = filterVertexPosition(); + vec2 textureCoord = filterTextureCoord(); + %blur% + }`; + +export function generateBlurVertSource(kernelSize, x) { + const halfLength = Math.ceil(kernelSize / 2); + + let vertSource = vertTemplate; + + let blurLoop = ""; + let template; + + if (x) { + template = "vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);"; + } else { + template = "vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);"; + } + + for (let i = 0; i < kernelSize; i++) { + let blur = template.replace("%index%", i.toString()); + + blur = blur.replace("%sampleIndex%", `${i - (halfLength - 1)}.0`); + + blurLoop += blur; + blurLoop += "\n"; + } + + vertSource = vertSource.replace("%blur%", blurLoop); + vertSource = vertSource.replace("%size%", kernelSize.toString()); + + return vertSource; +} + +export function getMaxKernelSize(gl) { + const maxVaryings = PIXI.gl.getParameter(PIXI.gl.MAX_VARYING_VECTORS); + let kernelSize = 15; + + while (kernelSize > maxVaryings) { + kernelSize -= 2; + } + + return kernelSize; +} diff --git a/src/fx/filters/FilterBulgePinch.js b/src/fx/filters/FilterBulgePinch.js new file mode 100644 index 0000000..09f90aa --- /dev/null +++ b/src/fx/filters/FilterBulgePinch.js @@ -0,0 +1,31 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterBulgePinch extends PIXI.filters.BulgePinchFilter { + constructor(params) { + super(); + + this.strength = 0; + this.radiusPercent = 100; + this.zOrder = 140; + this.autoFit = false; + + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + + // Anchor point + this.center = [0.5, 0.5]; + } + + handleTransform() { + this.radius = + (Math.max(this.placeableImg.width, this.placeableImg.height) * + this.targetPlaceable.worldTransform.a * + this.radiusPercent) / + 200; + } +} diff --git a/src/fx/filters/FilterCRT.js b/src/fx/filters/FilterCRT.js new file mode 100644 index 0000000..2e81ad2 --- /dev/null +++ b/src/fx/filters/FilterCRT.js @@ -0,0 +1,23 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterCRT extends PIXI.filters.CRTFilter { + constructor(params) { + super(); + this.curvature = 1.0; + this.lineWidth = 1.0; + this.lineContrast = 0.25; + this.verticalLine = false; + this.noise = 0.08; + this.noiseSize = 1.0; + this.seed = 0; + this.vignetting = 0; + this.zOrder = 320; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterDDTint.js b/src/fx/filters/FilterDDTint.js new file mode 100644 index 0000000..cdd39ea --- /dev/null +++ b/src/fx/filters/FilterDDTint.js @@ -0,0 +1,27 @@ +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; +import { ddTint } from "../glsl/fragmentshaders/ddtint.js"; + +export class FilterDDTint extends CustomFilter { + constructor(params) { + super(customVertex2D, ddTint); + this.tint = [1, 0, 0]; + this.zOrder = 100; + this.animating = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get tint() { + return this.uniforms.tint; + } + + set tint(value) { + this.uniforms.tint = value; + } +} diff --git a/src/fx/filters/FilterDistortion.js b/src/fx/filters/FilterDistortion.js new file mode 100644 index 0000000..b09d212 --- /dev/null +++ b/src/fx/filters/FilterDistortion.js @@ -0,0 +1,146 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; +import { fixPath } from "../../module.js"; + +export class FilterDistortion extends PIXI.filters.DisplacementFilter { + constructor(params) { + // Loading distortion sprite + var displacementSpriteMask; + var spriteMaskPath; + spriteMaskPath = params.hasOwnProperty("maskPath") + ? fixPath(params.maskPath) + : "modules/tokenmagic/fx/assets/distortion-1.png"; + displacementSpriteMask = PIXI.Sprite.from(spriteMaskPath); + super(displacementSpriteMask); + + // Configuring distortion sprite + this.sprite = displacementSpriteMask; + this.wrapMode = PIXI.WRAP_MODES.REPEAT; + this.position = new PIXI.Point(); + this.skew = new PIXI.Point(); + this.pivot = new PIXI.Point(); + this.anchorSet = 0.5; + this.transition = null; + this.padding = 15; // conf + this.enabled = false; + this.maskSpriteX = 0; + this.maskSpriteY = 0; + this.maskSpriteScaleX = 4; + this.maskSpriteScaleY = 4; + this.maskSpriteSkewX = 0; + this.maskSpriteSkewY = 0; + this.maskSpriteRotation = 0; + this.zOrder = 4000; + this.sticky = true; + + this.animated = {}; + this.setTMParams(params); + this.maskPath = spriteMaskPath; + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + this.sprite.anchor.set(this.anchorSet); + this.sprite.texture.baseTexture.wrapMode = this.wrapMode; + } + } + + set maskSpriteX(value) { + this.position.x = value; + } + + set maskSpriteY(value) { + this.position.y = value; + } + + get maskSpriteX() { + return this.position.x; + } + + get maskSpriteY() { + return this.position.y; + } + + set maskSpriteScaleX(value) { + this.scale.x = value; + } + + set maskSpriteScaleY(value) { + this.scale.y = value; + } + + get maskSpriteScaleX() { + return this.scale.x; + } + + get maskSpriteScaleY() { + return this.scale.y; + } + + set maskSpriteRotation(value) { + this.rotation = value; + } + + get maskSpriteRotation() { + return this.rotation; + } + + set maskSpriteSkewX(value) { + this.skew.x = value; + } + + get maskSpriteSkewX() { + return this.skew.x; + } + + set maskSpriteSkewY(value) { + this.skew.y = value; + } + + get maskSpriteSkewY() { + return this.skew.y; + } + + set maskSpritePivotX(value) { + this.pivot.x = value; + } + + get maskSpritePivotX() { + return this.pivot.x; + } + + set maskSpritePivotY(value) { + this.pivot.y = value; + } + + get maskSpritePivotY() { + return this.pivot.y; + } + + handleTransform() { + this.sprite.position.x = this.targetPlaceable.x + this.placeableImg.x + this.position.x; + this.sprite.position.y = this.targetPlaceable.y + this.placeableImg.y + this.position.y; + this.sprite.skew.x = this.skew.x; + this.sprite.skew.x = this.skew.y; + this.sprite.rotation = this.rotation; + this.sprite.pivot.x = this.pivot.x; + this.sprite.pivot.y = this.pivot.y; + + if (this.sticky) this.sprite.rotation += this.placeableImg.rotation; + + this.sprite.transform.updateTransform(canvas.stage.transform); + } + + apply(filterManager, input, output, clear) { + this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite); + this.uniforms.scale.x = this.scale.x; + this.uniforms.scale.y = this.scale.y; + + const wt = this.maskSprite.worldTransform; + this.uniforms.rotation[0] = wt.a; + this.uniforms.rotation[1] = wt.b; + this.uniforms.rotation[2] = wt.c; + this.uniforms.rotation[3] = wt.d; + + filterManager.applyFilter(this, input, output, clear); + } +} diff --git a/src/fx/filters/FilterDot.js b/src/fx/filters/FilterDot.js new file mode 100644 index 0000000..8d55bae --- /dev/null +++ b/src/fx/filters/FilterDot.js @@ -0,0 +1,18 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterDot extends PIXI.filters.DotFilter { + constructor(params) { + super(); + this.scale = 1; + this.angle = 5; + this.grayscale = true; + this.zOrder = 330; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterDropShadow.js b/src/fx/filters/FilterDropShadow.js new file mode 100644 index 0000000..2e96f0b --- /dev/null +++ b/src/fx/filters/FilterDropShadow.js @@ -0,0 +1,29 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; +import { FilterDropShadowEx } from "./FilterDropShadowEx.js"; + +export class FilterDropShadow extends FilterDropShadowEx { + constructor(params) { + super(); + this.enabled = false; + this.rotation = 45; + this.distance = 5; + this.color = 0x000000; + this.alpha = 0.5; + this.shadowOnly = false; + this.blur = 2; + this.quality = 3; + this.padding = 10; + this.zOrder = 110; + this.animated = {}; + this.resolution = game.settings.get("core", "pixelRatioResolutionScaling") + ? window.devicePixelRatio + : PIXI.settings.FILTER_RESOLUTION; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + this.autoFit = false; + } +} diff --git a/src/fx/filters/FilterDropShadowEx.js b/src/fx/filters/FilterDropShadowEx.js new file mode 100644 index 0000000..c80bbaf --- /dev/null +++ b/src/fx/filters/FilterDropShadowEx.js @@ -0,0 +1,146 @@ +import { CustomFilter } from "./CustomFilter.js"; +import { dropShadow } from "../glsl/fragmentshaders/dropshadow.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import "./proto/FilterProto.js"; + +export class FilterDropShadowEx extends CustomFilter { + shadowOnly; + angle = 45; + + _distance = 5; + _resolution = PIXI.settings.FILTER_RESOLUTION; + _tintFilter; + _blurFilter; + + constructor(options = {}) { + super(); + + const opt = options ? { ...FilterDropShadowEx.defaults, ...options } : FilterDropShadowEx.defaults; + + const { kernels, blur, quality, resolution } = opt; + + this._tintFilter = new PIXI.Filter(customVertex2D, dropShadow); + this._tintFilter.uniforms.color = new Float32Array(4); + this._tintFilter.uniforms.shift = new PIXI.Point(); + this._tintFilter.resolution = resolution; + this._blurFilter = kernels + ? new PIXI.filters.KawaseBlurFilter(kernels) + : new PIXI.filters.KawaseBlurFilter(blur, quality); + + this._pixelSize = 1.0; + this.resolution = resolution; + + const { shadowOnly, rotation, distance, alpha, color } = opt; + + this.shadowOnly = shadowOnly; + this.rotation = rotation; + this.distance = distance; + this.alpha = alpha; + this.color = color; + } + + apply(filterManager, input, output, clear) { + this._updateShiftAndScale(); + const target = filterManager.getFilterTexture(); + + this._tintFilter.apply(filterManager, input, target, 1); + this._blurFilter.apply(filterManager, target, output, clear); + + if (this.shadowOnly !== true) { + filterManager.applyFilter(this, input, output, 0); + } + + filterManager.returnFilterTexture(target); + } + + _updateShiftAndScale() { + const scale = this.targetPlaceable?.worldTransform.a ?? 1.0; + this._tintFilter.uniforms.shift.set( + this.distance * Math.cos(this.angle) * scale, + this.distance * Math.sin(this.angle) * scale + ); + this._pixelSize = Math.max(1.0, 1.0 * scale); + } + + get resolution() { + return this._resolution; + } + set resolution(value) { + this._resolution = value; + + if (this._tintFilter) { + this._tintFilter.resolution = value; + } + if (this._blurFilter) { + this._blurFilter.resolution = value; + } + } + + get distance() { + return this._distance; + } + set distance(value) { + this._distance = value; + } + + get rotation() { + return this.angle / PIXI.DEG_TO_RAD; + } + set rotation(value) { + this.angle = value * PIXI.DEG_TO_RAD; + } + + get alpha() { + return this._tintFilter.uniforms.alpha; + } + set alpha(value) { + this._tintFilter.uniforms.alpha = value; + } + + get color() { + return PIXI.utils.rgb2hex(this._tintFilter.uniforms.color); + } + set color(value) { + new PIXI.Color(value).toRgbArray(this._tintFilter.uniforms.color); + } + + get kernels() { + return this._blurFilter.kernels; + } + set kernels(value) { + this._blurFilter.kernels = value; + } + + get blur() { + return this._blurFilter.blur; + } + set blur(value) { + this._blurFilter.blur = value; + } + + get quality() { + return this._blurFilter.quality; + } + set quality(value) { + this._blurFilter.quality = value; + } + + get _pixelSize() { + return this._blurFilter.pixelSize; + } + set _pixelSize(value) { + this._blurFilter.pixelSize = value; + } +} + +FilterDropShadowEx.defaults = { + rotation: 45, + distance: 5, + color: 0x000000, + alpha: 0.5, + shadowOnly: false, + kernels: null, + blur: 2, + quality: 3, + resolution: PIXI.settings.FILTER_RESOLUTION, +}; diff --git a/src/fx/filters/FilterElectric.js b/src/fx/filters/FilterElectric.js new file mode 100644 index 0000000..bd43773 --- /dev/null +++ b/src/fx/filters/FilterElectric.js @@ -0,0 +1,70 @@ +import { zapElectricity } from "../glsl/fragmentshaders/electricity.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterElectric extends CustomFilter { + constructor(params) { + let { time, blend, color } = Object.assign({}, FilterElectric.defaults, params); + + var shaderFragment; + if (params.hasOwnProperty("intensity") && typeof params.intensity === "number") { + var intensityVal = Math.floor(params.intensity); + shaderFragment = zapElectricity.replace("#define INTENSITY 5", "#define INTENSITY " + intensityVal); + } else { + shaderFragment = zapElectricity; + } + + super(customVertex2D, shaderFragment); + + this.uniforms.color = new Float32Array([1.0, 1.0, 1.0, 1.0]); + this.uniforms.blend = 2; + + Object.assign(this, { + time, + blend, + color, + }); + + this.zOrder = 160; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + + this.quality = 0.5; + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } +} + +FilterElectric.defaults = { + time: 0.0, + blend: 1, + color: 0xffffff, +}; diff --git a/src/fx/filters/FilterFire.js b/src/fx/filters/FilterFire.js new file mode 100644 index 0000000..047ac2f --- /dev/null +++ b/src/fx/filters/FilterFire.js @@ -0,0 +1,127 @@ +import { burnFire } from "../glsl/fragmentshaders/fire.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterFire extends CustomFilter { + constructor(params) { + let { time, color, amplitude, intensity, fireBlend, blend, anchorX, anchorY, alphaDiscard } = Object.assign( + {}, + FilterFire.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, burnFire); + + this.uniforms.color = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.anchor = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + amplitude, + intensity, + fireBlend, + blend, + anchorX, + anchorY, + alphaDiscard, + }); + + this.zOrder = 150; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get amplitude() { + return this.uniforms.amplitude; + } + + set amplitude(value) { + this.uniforms.amplitude = value; + } + + get intensity() { + return this.uniforms.intensity; + } + + set intensity(value) { + this.uniforms.intensity = value; + } + + get fireBlend() { + return this.uniforms.fireBlend; + } + + set fireBlend(value) { + this.uniforms.fireBlend = Math.floor(value); + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get anchorX() { + return this.uniforms.anchor[0]; + } + + set anchorX(value) { + this.uniforms.anchor[0] = value; + } + + get anchorY() { + return this.uniforms.anchor[1]; + } + + set anchorY(value) { + this.uniforms.anchor[1] = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } +} + +FilterFire.defaults = { + time: 0, + color: 0xffffff, + amplitude: 1, + intensity: 1, + fireBlend: 1, + blend: 2, + anchorX: 1, + anchorY: 1, + alphaDiscard: false, +}; diff --git a/src/fx/filters/FilterFlood.js b/src/fx/filters/FilterFlood.js new file mode 100644 index 0000000..014cf49 --- /dev/null +++ b/src/fx/filters/FilterFlood.js @@ -0,0 +1,115 @@ +import { seaFlood } from "../glsl/fragmentshaders/flood.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterFlood extends CustomFilter { + constructor(params) { + let { time, scale, glint, billowy, color, shiftX, shiftY, tintIntensity } = Object.assign( + {}, + FilterFlood.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, seaFlood); + + this.uniforms.waterColor = new Float32Array([0.0, 0.18, 0.54]); + this.uniforms.shift = new Float32Array([0.0, 0.0]); + + Object.assign(this, { + time, + scale, + glint, + billowy, + color, + shiftX, + shiftY, + tintIntensity, + }); + + this.zOrder = 170; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.waterColor); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.waterColor); + } + + get scale() { + return this.uniforms.scale; + } + + set scale(value) { + this.uniforms.scale = value; + } + + get glint() { + return this.uniforms.glint; + } + + set glint(value) { + this.uniforms.glint = value; + } + + get billowy() { + return this.uniforms.billowy; + } + + set billowy(value) { + this.uniforms.billowy = value; + } + + get tintIntensity() { + return this.uniforms.tintIntensity; + } + + set tintIntensity(value) { + this.uniforms.tintIntensity = value; + } + + get shiftX() { + return this.uniforms.shift[0]; + } + + set shiftX(value) { + this.uniforms.shift[0] = value; + } + + get shiftY() { + this.uniforms.shift[1]; + } + + set shiftY(value) { + this.uniforms.shift[1] = value; + } +} + +FilterFlood.defaults = { + time: 0, + glint: 0.5, + scale: 70, + billowy: 0.5, + color: 0x0020a9, + shiftX: 0, + shiftY: 0, + tintIntensity: 0.2, +}; diff --git a/src/fx/filters/FilterFog.js b/src/fx/filters/FilterFog.js new file mode 100644 index 0000000..78a33ea --- /dev/null +++ b/src/fx/filters/FilterFog.js @@ -0,0 +1,80 @@ +import { innerFog } from "../glsl/fragmentshaders/fog.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; + +export class FilterFog extends CustomFilter { + constructor(params) { + let { time, color, density, dimX, dimY } = Object.assign({}, FilterFog.defaults, params); + + // specific vertex and fragment shaders + super(customVertex2D, innerFog); + + this.uniforms.color = new Float32Array([1.0, 0.4, 0.1, 0.55]); + this.uniforms.dimensions = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + density, + dimX, + dimY, + }); + + this.zOrder = 190; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get density() { + return this.uniforms.density; + } + + set density(value) { + this.uniforms.density = value; + } + + get dimX() { + return this.uniforms.dimensions[0]; + } + + set dimX(value) { + this.uniforms.dimensions[0] = value; + } + + get dimY() { + return this.uniforms.dimensions[1]; + } + + set dimY(value) { + this.uniforms.dimensions[1] = value; + } +} + +FilterFog.defaults = { + time: 0.0, + color: 0xffffff, + density: 0.5, + dimX: 1.0, + dimY: 1.0, +}; diff --git a/src/fx/filters/FilterForceField.js b/src/fx/filters/FilterForceField.js new file mode 100644 index 0000000..4741578 --- /dev/null +++ b/src/fx/filters/FilterForceField.js @@ -0,0 +1,201 @@ +import { forceField } from "../glsl/fragmentshaders/forcefield.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterForceField extends CustomFilter { + constructor(params) { + let { + time, + color, + lightAlpha, + blend, + shieldType, + posLightX, + posLightY, + lightSize, + scale, + intensity, + radius, + hideRadius, + chromatic, + discardThreshold, + alphaDiscard, + } = Object.assign({}, FilterForceField.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, forceField); + + this.uniforms.color = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.posLight = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + lightAlpha, + blend, + shieldType, + posLightX, + posLightY, + lightSize, + scale, + intensity, + radius, + hideRadius, + chromatic, + discardThreshold, + alphaDiscard, + }); + + this.zOrder = 2000; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get lightAlpha() { + return this.uniforms.lightColorAlpha; + } + + set lightAlpha(value) { + this.uniforms.lightColorAlpha = value; + } + + get shieldType() { + return this.uniforms.shieldType; + } + + set shieldType(value) { + this.uniforms.shieldType = Math.floor(value); + } + + get posLightX() { + return this.uniforms.posLight[0]; + } + + set posLightX(value) { + this.uniforms.posLight[0] = value; + } + + get posLightY() { + return this.uniforms.posLight[1]; + } + + set posLightY(value) { + this.uniforms.posLight[1] = value; + } + + get lightSize() { + return this.uniforms.lightSize; + } + + set lightSize(value) { + this.uniforms.lightSize = value; + } + + get scale() { + return this.uniforms.scale; + } + + set scale(value) { + this.uniforms.scale = value; + } + + get intensity() { + return this.uniforms.intensity; + } + + set intensity(value) { + this.uniforms.intensity = value; + } + + get radius() { + return this.uniforms.radius; + } + + set radius(value) { + this.uniforms.radius = value; + } + + get hideRadius() { + return this.uniforms.hideRadius; + } + + set hideRadius(value) { + this.uniforms.hideRadius = value; + } + + get discardThreshold() { + return this.uniforms.discardThreshold; + } + + set discardThreshold(value) { + this.uniforms.discardThreshold = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } + + get chromatic() { + return this.uniforms.chromatic; + } + + set chromatic(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.chromatic = value; + } + } +} + +FilterForceField.defaults = { + time: 0, + color: 0xbbbbbb, + lightAlpha: 1.0, + blend: 2, + shieldType: 1, + posLightX: 0.65, + posLightY: 0.25, + lightSize: 0.483, + scale: 1, + intensity: 1, + radius: 1, + hideRadius: 0, + chromatic: false, + discardThreshold: 0.25, + alphaDiscard: false, +}; diff --git a/src/fx/filters/FilterFumes.js b/src/fx/filters/FilterFumes.js new file mode 100644 index 0000000..e047810 --- /dev/null +++ b/src/fx/filters/FilterFumes.js @@ -0,0 +1,81 @@ +import { fumes } from "../glsl/fragmentshaders/fumes.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterFumes extends CustomFilter { + constructor(params) { + let { time, color, blend, dimX, dimY } = Object.assign({}, FilterFumes.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, fumes); + + this.uniforms.color = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.dimensions = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + blend, + dimX, + dimY, + }); + + this.zOrder = 210; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get dimX() { + return this.uniforms.dimensions[0]; + } + + set dimX(value) { + this.uniforms.dimensions[0] = value; + } + + get dimY() { + return this.uniforms.dimensions[1]; + } + + set dimY(value) { + this.uniforms.dimensions[1] = value; + } +} + +FilterFumes.defaults = { + time: 0, + color: 0xffffff, + blend: 2, + dimX: 1, + dimY: 1, +}; diff --git a/src/fx/filters/FilterGleamingGlow.js b/src/fx/filters/FilterGleamingGlow.js new file mode 100644 index 0000000..8a22519 --- /dev/null +++ b/src/fx/filters/FilterGleamingGlow.js @@ -0,0 +1,122 @@ +import { magicGlow } from "../glsl/fragmentshaders/magicglow.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterGleamingGlow extends CustomFilter { + constructor(params) { + let { time, color, thickness, scale, auraIntensity, subAuraIntensity, discard, threshold, auraType } = + Object.assign({}, FilterGleamingGlow.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, magicGlow); + + this.uniforms.color = new Float32Array([1.0, 0.4, 0.1, 1.0]); + this.uniforms.thickness = new Float32Array([0.01, 0.01]); + + Object.assign(this, { + time, + color, + thickness, + scale, + auraIntensity, + subAuraIntensity, + discard, + threshold, + auraType, + }); + + this.zOrder = 80; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get scale() { + return this.uniforms.scale; + } + + set scale(value) { + this.uniforms.scale = value; + } + + get auraIntensity() { + return this.uniforms.auraIntensity; + } + + set auraIntensity(value) { + this.uniforms.auraIntensity = value; + } + + get subAuraIntensity() { + return this.uniforms.subAuraIntensity; + } + + set subAuraIntensity(value) { + this.uniforms.subAuraIntensity = value; + } + + get threshold() { + return this.uniforms.threshold; + } + + set threshold(value) { + this.uniforms.threshold = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get discard() { + return this.uniforms.holes; + } + + set discard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.holes = value; + } + } + + get auraType() { + return this.uniforms.auraType; + } + + set auraType(value) { + this.uniforms.auraType = Math.floor(value); + } + + apply(filterManager, input, output, clear) { + this.uniforms.thickness[0] = (this.thickness * this.targetPlaceable.worldTransform.a) / input._frame.width; + this.uniforms.thickness[1] = (this.thickness * this.targetPlaceable.worldTransform.a) / input._frame.height; + super.apply(filterManager, input, output, clear); + } +} + +FilterGleamingGlow.defaults = { + time: 0, + color: 0xff8010, + thickness: 5, + scale: 1, + auraIntensity: 1, + subAuraIntensity: 1, + discard: false, + threshold: 0.5, + auraType: 1, +}; diff --git a/src/fx/filters/FilterGlobes.js b/src/fx/filters/FilterGlobes.js new file mode 100644 index 0000000..79d378f --- /dev/null +++ b/src/fx/filters/FilterGlobes.js @@ -0,0 +1,82 @@ +import { globes } from "../glsl/fragmentshaders/globes.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterGlobes extends CustomFilter { + constructor(params) { + let { time, color, scale, distortion, alphaDiscard } = Object.assign({}, FilterGlobes.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, globes); + + this.uniforms.color = new Float32Array([0.75, 0.75, 0.75]); + + Object.assign(this, { + time, + color, + scale, + distortion, + alphaDiscard, + }); + + this.zOrder = 270; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get scale() { + return this.uniforms.scale; + } + + set scale(value) { + this.uniforms.scale = value; + } + + get distortion() { + return this.uniforms.distortion; + } + + set distortion(value) { + this.uniforms.distortion = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } +} + +FilterGlobes.defaults = { + time: 0.0, + color: 0xaa3050, + scale: 20, + distortion: 0.25, + alphaDiscard: false, +}; diff --git a/src/fx/filters/FilterGlow.js b/src/fx/filters/FilterGlow.js new file mode 100644 index 0000000..d8b3f8e --- /dev/null +++ b/src/fx/filters/FilterGlow.js @@ -0,0 +1,24 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterGlow extends PIXI.filters.GlowFilter { + constructor(params) { + super(); + this.padding = 15; + this.enabled = false; + this.innerStrength = 0; + this.outerStrength = 6.5; + this.color = 0x0020ff; + this.quality = 1; + this.alpha = 1; + this.zOrder = 70; + this.animated = {}; + this.setTMParams(params); + // Imposed value. Should not be a shader uniform + this.distance = 10; + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterLiquid.js b/src/fx/filters/FilterLiquid.js new file mode 100644 index 0000000..d7705a5 --- /dev/null +++ b/src/fx/filters/FilterLiquid.js @@ -0,0 +1,108 @@ +import { liquid } from "../glsl/fragmentshaders/liquid.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterLiquid extends CustomFilter { + constructor(params) { + let { time, color, scale, intensity, blend, spectral, alphaDiscard } = Object.assign( + {}, + FilterLiquid.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, liquid); + + this.uniforms.color = new Float32Array([0.1, 0.45, 1.0]); + + Object.assign(this, { + time, + color, + scale, + intensity, + blend, + spectral, + alphaDiscard, + }); + + this.zOrder = 180; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get scale() { + return this.uniforms.scale; + } + + set scale(value) { + this.uniforms.scale = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get intensity() { + return this.uniforms.intensity; + } + + set intensity(value) { + this.uniforms.intensity = value; + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get spectral() { + return this.uniforms.spectral; + } + + set spectral(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.spectral = value; + } + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } +} + +FilterLiquid.defaults = { + time: 0.0, + color: 0x0595ff, + scale: 1, + intensity: 5, + blend: 4, + spectral: false, + alphaDiscard: false, +}; diff --git a/src/fx/filters/FilterMirrorImages.js b/src/fx/filters/FilterMirrorImages.js new file mode 100644 index 0000000..3afd07c --- /dev/null +++ b/src/fx/filters/FilterMirrorImages.js @@ -0,0 +1,103 @@ +import { mirrorImages } from "../glsl/fragmentshaders/mirrorimages.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterMirrorImages extends CustomFilter { + constructor(params) { + let { time, blend, alphaImg, alphaChr, nbImage, ampX, ampY } = Object.assign( + {}, + FilterMirrorImages.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, mirrorImages); + + Object.assign(this, { + time, + blend, + alphaImg, + alphaChr, + nbImage, + ampX, + ampY, + }); + + this.zOrder = 100; + this.autoFit = false; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get alphaImg() { + return this.uniforms.alphaImg; + } + + set alphaImg(value) { + this.uniforms.alphaImg = value; + } + + get alphaChr() { + return this.uniforms.alphaChr; + } + + set alphaChr(value) { + this.uniforms.alphaChr = value; + } + + get nbImage() { + return this.uniforms.nbImage; + } + + set nbImage(value) { + this.uniforms.nbImage = Math.floor(value); + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get ampX() { + return this.uniforms.ampX; + } + + set ampX(value) { + this.uniforms.ampX = value; + } + + get ampY() { + return this.uniforms.ampY; + } + + set ampY(value) { + this.uniforms.ampY = value; + } +} + +FilterMirrorImages.defaults = { + time: 0, + blend: 4, + alphaImg: 0.5, + alphaChr: 1.0, + nbImage: 4, + ampX: 0.15, + ampY: 0.15, +}; diff --git a/src/fx/filters/FilterOldFilm.js b/src/fx/filters/FilterOldFilm.js new file mode 100644 index 0000000..d956288 --- /dev/null +++ b/src/fx/filters/FilterOldFilm.js @@ -0,0 +1,21 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterOldFilm extends PIXI.filters.OldFilmFilter { + constructor(params) { + super(); + this.enabled = false; + this.vignetting = 0; + this.noise = 0.08; + this.scratch = 0.1; + this.scratchDensity = 0.1; + this.seed = 0; + this.zOrder = 60; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterOutline.js b/src/fx/filters/FilterOutline.js new file mode 100644 index 0000000..7b3c484 --- /dev/null +++ b/src/fx/filters/FilterOutline.js @@ -0,0 +1,21 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterOutline extends PIXI.filters.OutlineFilter { + constructor(params) { + super(); + this.blendMode = PIXI.BLEND_MODES.NORMAL; + this.padding = 5; + this.enabled = false; + this.thickness = 3; + this.color = 0x000000; + this.quality = 1; + this.zOrder = 50; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterPixelate.js b/src/fx/filters/FilterPixelate.js new file mode 100644 index 0000000..823bcef --- /dev/null +++ b/src/fx/filters/FilterPixelate.js @@ -0,0 +1,23 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterPixelate extends PIXI.filters.PixelateFilter { + constructor(params) { + super(); + this.enabled = false; + this.animated = {}; + this.sizeX = 5; + this.sizeY = 5; + this.zOrder = 20; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + handleTransform() { + this.size.x = this.sizeX * this.targetPlaceable.worldTransform.a; + this.size.y = this.sizeY * this.targetPlaceable.worldTransform.a; + } +} diff --git a/src/fx/filters/FilterPolymorph.js b/src/fx/filters/FilterPolymorph.js new file mode 100644 index 0000000..ceee146 --- /dev/null +++ b/src/fx/filters/FilterPolymorph.js @@ -0,0 +1,144 @@ +import { polymorph } from "../glsl/fragmentshaders/polymorph.js"; +import { customVertex2DSampler } from "../glsl/vertexshaders/customvertex2DSampler.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; +import { fixPath } from "../../module.js"; + +export class FilterPolymorph extends CustomFilter { + constructor(params) { + let { imagePath, progress, magnify, type } = Object.assign({}, FilterPolymorph.defaults, params); + + const targetSpriteMatrix = new PIXI.Matrix(); + + // using specific vertex shader and fragment shader + super(customVertex2DSampler, polymorph); + + // vertex uniforms + this.uniforms.targetUVMatrix = targetSpriteMatrix; + + // fragment uniforms + this.uniforms.inputClampTarget = new Float32Array([0, 0, 0, 0]); + + // to store sprite matrix from the filter manager (and send to vertex) + this.targetSpriteMatrix = targetSpriteMatrix; + + Object.assign(this, { + imagePath: fixPath(imagePath), + progress, + magnify, + type, + }); + + this.zOrder = 1; + this.autoFit = false; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + setTMParams(params) { + super.setTMParams(params); + if (!this.dummy && "imagePath" in params) { + this.assignTexture(); + } + } + + get progress() { + return this.uniforms.progress * 100; + } + + set progress(value) { + this.uniforms.progress = Math.min(Math.max(value * 0.01, 0), 1); + } + + get magnify() { + return this.uniforms.magnify; + } + + set magnify(value) { + this.uniforms.magnify = Math.min(Math.max(value, 0.1), 100); + } + + get type() { + return this.uniforms.type; + } + + set type(value) { + this.uniforms.type = Math.floor(value); + } + + get uSamplerTarget() { + return this.uniforms.uSamplerTarget; + } + + set uSamplerTarget(value) { + this.uniforms.uSamplerTarget = value; + } + + _setTargetSpriteSize() { + const sprite = this.targetSprite; + let ratioW = this.placeableImg._texture.baseTexture.realWidth / sprite.texture.baseTexture.realWidth; + sprite.width = sprite.texture.baseTexture.realWidth * ratioW; + sprite.height = sprite.texture.baseTexture.realHeight * ratioW; + sprite.anchor.set(0.5); + } + + assignTexture() { + if (this.hasOwnProperty("imagePath")) { + let tex = PIXI.Texture.from(this.imagePath); + let sprite = new PIXI.Sprite(tex); + + sprite.renderable = false; + this.targetSprite = sprite; + + // We may need to wait for the texture to be loaded before accessing it's width and height + // In such a case register an update listener which should be called when the texture is loaded/becomes valid + if (tex.valid) { + this._setTargetSpriteSize(); + } else { + tex.on("update", () => { + this._setTargetSpriteSize(); + }); + } + + this.uSamplerTarget = sprite._texture; + this.placeableImg.addChild(sprite); + } + } + + // override + apply(filterManager, input, output, clear) { + const targetSprite = this.targetSprite; + const tex = targetSprite._texture; + + if (tex.valid) { + if (!tex.uvMatrix) tex.uvMatrix = new PIXI.TextureMatrix(tex, 0.0); + tex.uvMatrix.update(); + + this.uniforms.uSamplerTarget = tex; + this.uniforms.targetUVMatrix = filterManager + .calculateSpriteMatrix(this.targetSpriteMatrix, targetSprite) + .prepend(tex.uvMatrix.mapCoord); + this.uniforms.inputClampTarget = tex.uvMatrix.uClampFrame; + } + + super.apply(filterManager, input, output, clear); + } + + // override + destroy() { + super.destroy(); + if (this.placeableImg) this.placeableImg.removeChild(this.targetSprite); + this.targetSprite.destroy({ children: true, texture: false, baseTexture: false }); + } +} + +FilterPolymorph.defaults = { + progress: 0, + magnify: 1, + type: 1, +}; diff --git a/src/fx/filters/FilterRGBSplit.js b/src/fx/filters/FilterRGBSplit.js new file mode 100644 index 0000000..78a95c2 --- /dev/null +++ b/src/fx/filters/FilterRGBSplit.js @@ -0,0 +1,66 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterRGBSplit extends PIXI.filters.RGBSplitFilter { + constructor(params) { + super(); + this.red = new Float32Array([-10, 0]); + this.green = new Float32Array([0, 10]); + this.blue = new Float32Array([0, 0]); + this.zOrder = 340; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get redX() { + return this.uniforms.red[0]; + } + + set redX(value) { + this.uniforms.red[0] = value; + } + + get redY() { + return this.uniforms.red[1]; + } + + set redY(value) { + this.uniforms.red[1] = value; + } + + get greenX() { + return this.uniforms.green[0]; + } + + set greenX(value) { + this.uniforms.green[0] = value; + } + + get greenY() { + return this.uniforms.green[1]; + } + + set greenY(value) { + this.uniforms.green[1] = value; + } + + get blueX() { + return this.uniforms.blue[0]; + } + + set blueX(value) { + this.uniforms.blue[0] = value; + } + + get blueY() { + return this.uniforms.blue[1]; + } + + set blueY(value) { + this.uniforms.blue[1] = value; + } +} diff --git a/src/fx/filters/FilterRays.js b/src/fx/filters/FilterRays.js new file mode 100644 index 0000000..1469c4a --- /dev/null +++ b/src/fx/filters/FilterRays.js @@ -0,0 +1,130 @@ +import { cosmicRayFrag } from "../glsl/fragmentshaders/cosmicray.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterRays extends CustomFilter { + constructor(params) { + let { time, color, divisor, alpha, anchorX, anchorY, dimX, dimY, alphaDiscard } = Object.assign( + {}, + FilterRays.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, cosmicRayFrag); + + this.uniforms.color = new Float32Array([1.0, 0.4, 0.1, 0.55]); + this.uniforms.anchor = new Float32Array([0.5, 0.5]); + this.uniforms.dimensions = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + divisor, + alpha, + anchorX, + anchorY, + dimX, + dimY, + alphaDiscard, + }); + + this.zOrder = 120; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get divisor() { + return this.uniforms.divisor; + } + + set divisor(value) { + this.uniforms.divisor = value; + } + + get alpha() { + return this.uniforms.color[3]; + } + + set alpha(value) { + if (value >= 0 && value <= 1) { + this.uniforms.color[3] = value; + } + } + + get anchorX() { + return this.uniforms.anchor[0]; + } + + set anchorX(value) { + this.uniforms.anchor[0] = value; + } + + get anchorY() { + return this.uniforms.anchor[1]; + } + + set anchorY(value) { + this.uniforms.anchor[1] = value; + } + + get dimX() { + return this.uniforms.dimensions[0]; + } + + set dimX(value) { + this.uniforms.dimensions[0] = value; + } + + get dimY() { + return this.uniforms.dimensions[1]; + } + + set dimY(value) { + this.uniforms.dimensions[1] = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } +} + +FilterRays.defaults = { + time: 0.0, + color: 0xff8010, + divisor: 16, + alpha: 0.55, + anchorX: 0.5, + anchorY: 0.5, + dimX: 100, + dimY: 100, + alphaDiscard: false, +}; diff --git a/src/fx/filters/FilterRemoveShadow.js b/src/fx/filters/FilterRemoveShadow.js new file mode 100644 index 0000000..7d7e996 --- /dev/null +++ b/src/fx/filters/FilterRemoveShadow.js @@ -0,0 +1,36 @@ +import { removeShadowFrag } from "../glsl/fragmentshaders/removeshadow.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterRemoveShadow extends CustomFilter { + constructor(params) { + let { alphaTolerance } = Object.assign({}, FilterRemoveShadow.defaults, params); + + // using the default vertex shader and the specific fragment shader + super(undefined, removeShadowFrag); + + Object.assign(this, { + alphaTolerance, + }); + + this.zOrder = 10; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get alphaTolerance() { + return this.uniforms.alphaTolerance; + } + set alphaTolerance(value) { + this.uniforms.alphaTolerance = value; + } +} + +FilterRemoveShadow.defaults = { + alphaTolerance: 0.8, +}; diff --git a/src/fx/filters/FilterReplaceColor.js b/src/fx/filters/FilterReplaceColor.js new file mode 100644 index 0000000..679a00e --- /dev/null +++ b/src/fx/filters/FilterReplaceColor.js @@ -0,0 +1,18 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterReplaceColor extends PIXI.filters.ColorReplaceFilter { + constructor(params) { + super(); + this.originalColor = [1, 0, 0]; + this.newColor = [0, 1, 0]; + this.epsilon = 0.7; + this.zOrder = 100; + this.animating = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } +} diff --git a/src/fx/filters/FilterShockWave.js b/src/fx/filters/FilterShockWave.js new file mode 100644 index 0000000..8f7f04a --- /dev/null +++ b/src/fx/filters/FilterShockWave.js @@ -0,0 +1,29 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterShockwave extends PIXI.filters.ShockwaveFilter { + constructor(params) { + super(); + this.enabled = false; + + this.time = 0; + this.amplitude = 5; + this.wavelength = 100; + this.speed = 50.0; + this.brightness = 1.5; + this.radius = 200; + + this.zOrder = 220; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + handleTransform(state) { + this.center[0] = 0.5 * state.sourceFrame.width; + this.center[1] = 0.5 * state.sourceFrame.height; + } +} diff --git a/src/fx/filters/FilterSmoke.js b/src/fx/filters/FilterSmoke.js new file mode 100644 index 0000000..4d82dff --- /dev/null +++ b/src/fx/filters/FilterSmoke.js @@ -0,0 +1,81 @@ +import { innerSmoke } from "../glsl/fragmentshaders/smoke.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterSmoke extends CustomFilter { + constructor(params) { + let { time, color, blend, dimX, dimY } = Object.assign({}, FilterSmoke.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, innerSmoke); + + this.uniforms.color = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.scale = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + blend, + dimX, + dimY, + }); + + this.zOrder = 200; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get dimX() { + return this.uniforms.scale[0]; + } + + set dimX(value) { + this.uniforms.scale[0] = value; + } + + get dimY() { + return this.uniforms.scale[1]; + } + + set dimY(value) { + this.uniforms.scale[1] = value; + } +} + +FilterSmoke.defaults = { + time: 0, + color: 0xffffff, + blend: 13, + dimX: 1, + dimY: 1, +}; diff --git a/src/fx/filters/FilterSolarRipples.js b/src/fx/filters/FilterSolarRipples.js new file mode 100644 index 0000000..218737b --- /dev/null +++ b/src/fx/filters/FilterSolarRipples.js @@ -0,0 +1,90 @@ +import { solarRipples } from "../glsl/fragmentshaders/ripples.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterSolarRipples extends CustomFilter { + constructor(params) { + let { time, color, amplitude, intensity, alphaDiscard, _octaves } = Object.assign( + {}, + FilterSolarRipples.defaults, + params + ); + + if (typeof _octaves !== "number") _octaves = FilterSolarRipples.defaults._octave; + let fragment = solarRipples.replace(`#define OCTAVES 3`, `#define OCTAVES ${_octaves}`); + + // using specific vertex shader and fragment shader + super(customVertex2D, fragment); + + this.uniforms.color = new Float32Array([0.75, 0.75, 0.75]); + + Object.assign(this, { + time, + color, + amplitude, + intensity, + alphaDiscard, + }); + + this.zOrder = 250; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get amplitude() { + return this.uniforms.amplitude; + } + + set amplitude(value) { + this.uniforms.amplitude = value; + } + + get intensity() { + return this.uniforms.intensity; + } + + set intensity(value) { + this.uniforms.intensity = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } +} + +FilterSolarRipples.defaults = { + time: 0.0, + color: 0xbbbbbb, + amplitude: 1, + intensity: 0.001, + alphaDiscard: false, + _octave: 3, +}; diff --git a/src/fx/filters/FilterSpiderWeb.js b/src/fx/filters/FilterSpiderWeb.js new file mode 100644 index 0000000..b91a62b --- /dev/null +++ b/src/fx/filters/FilterSpiderWeb.js @@ -0,0 +1,137 @@ +import { spiderWeb } from "../glsl/fragmentshaders/spiderweb.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterSpiderWeb extends CustomFilter { + constructor(params) { + let { time, anchorX, anchorY, color, thickness, div1, div2, tear, amplitude, alphaDiscard } = Object.assign( + {}, + FilterSpiderWeb.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, spiderWeb); + + this.uniforms.anchor = new Float32Array([0.5, -1.0]); + this.uniforms.color = new Float32Array([0.75, 0.75, 0.75]); + + Object.assign(this, { + time, + anchorX, + anchorY, + color, + thickness, + div1, + div2, + tear, + amplitude, + alphaDiscard, + }); + + this.zOrder = 260; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get anchorX() { + return this.uniforms.anchor[0]; + } + + set anchorX(value) { + this.uniforms.anchor[0] = 0.5; + } + + get anchorY() { + return this.uniforms.anchor[1]; + } + + set anchorY(value) { + this.uniforms.anchor[1] = 0.5; + } + + get thickness() { + return this.uniforms.thickness; + } + + set thickness(value) { + this.uniforms.thickness = value; + } + + get tear() { + return this.uniforms.tear; + } + + set tear(value) { + this.uniforms.tear = value; + } + + get amplitude() { + return this.uniforms.amplitude; + } + + set amplitude(value) { + this.uniforms.amplitude = value; + } + + get div1() { + return this.uniforms.div1; + } + + set div1(value) { + this.uniforms.div1 = value; + } + + get div2() { + return this.uniforms.div2; + } + + set div2(value) { + this.uniforms.div2 = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } +} + +FilterSpiderWeb.defaults = { + time: 0.0, + anchorX: 0.5, + anchorY: 0.5, + color: 0xbbbbbb, + thickness: 1, + div1: 10, + div2: 10, + tear: 0.54, + amplitude: 0.8, + alphaDiscard: false, +}; diff --git a/src/fx/filters/FilterSplash.js b/src/fx/filters/FilterSplash.js new file mode 100644 index 0000000..7b9745f --- /dev/null +++ b/src/fx/filters/FilterSplash.js @@ -0,0 +1,157 @@ +import { splash } from "../glsl/fragmentshaders/splash.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterSplash extends CustomFilter { + constructor(params) { + let { time, seed, spread, splashFactor, color, dimX, dimY, blend, cut, textureAlphaBlend, anchorX, anchorY } = + Object.assign({}, FilterSplash.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, splash); + + this.uniforms.color = new Float32Array([1.0, 0.05, 0.05]); + this.uniforms.dimensions = new Float32Array([1.0, 1.0]); + this.uniforms.anchor = new Float32Array([0.0, 0.0]); + + Object.assign(this, { + time, + seed, + spread, + splashFactor, + color, + dimX, + dimY, + blend, + cut, + textureAlphaBlend, + anchorX, + anchorY, + }); + + this.zOrder = 5; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get seed() { + return this.uniforms.seed; + } + + set seed(value) { + this.uniforms.seed = value; + } + + get spread() { + return this.uniforms.spread; + } + + set spread(value) { + this.uniforms.spread = value; + } + + get splashFactor() { + return this.uniforms.splashFactor; + } + + set splashFactor(value) { + this.uniforms.splashFactor = value; + } + + get dimX() { + return this.uniforms.dimensions[0]; + } + + set dimX(value) { + this.uniforms.dimensions[0] = value; + } + + get dimY() { + return this.uniforms.dimensions[1]; + } + + set dimY(value) { + this.uniforms.dimensions[1] = value; + } + + get anchorY() { + return this.uniforms.anchor[1] + 0.5; + } + + set anchorY(value) { + this.uniforms.anchor[1] = value - 0.5; + } + + get anchorX() { + return this.uniforms.anchor[0] + 0.5; + } + + set anchorX(value) { + this.uniforms.anchor[0] = value - 0.5; + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get cut() { + return this.uniforms.cut; + } + + set cut(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.cut = value; + } + } + + get textureAlphaBlend() { + return this.uniforms.textureAlphaBlend; + } + + set textureAlphaBlend(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.textureAlphaBlend = value; + } + } +} + +FilterSplash.defaults = { + time: Math.random() * 2000, + color: 0xf00505, + seed: 0.1, + spread: 5, + splashFactor: 2, + dimX: 1, + dimY: 1, + blend: 8, + cut: false, + textureAlphaBlend: false, + anchorX: 0.5, + anchorY: 0.5, +}; diff --git a/src/fx/filters/FilterSprite.js b/src/fx/filters/FilterSprite.js new file mode 100644 index 0000000..66ff5df --- /dev/null +++ b/src/fx/filters/FilterSprite.js @@ -0,0 +1,407 @@ +import { sprite } from "../glsl/fragmentshaders/sprite.js"; +import { customVertex2DSampler } from "../glsl/vertexshaders/customvertex2DSampler.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; +import { fixPath } from "../../module.js"; + +export class FilterSprite extends CustomFilter { + tex = null; + + constructor(params) { + let { + imagePath, + color, + colorize, + inverse, + alpha, + alphaDiscard, + repeat, + top, + rotation, + twRadiusPercent, + twAngle, + twRotation, + bpRadiusPercent, + bpStrength, + scale, + scaleX, + scaleY, + translationX, + translationY, + play, + loop, + maintainAspectRatio, + maintainScale, + } = Object.assign({}, FilterSprite.defaults, params); + + const targetSpriteMatrix = new PIXI.Matrix(); + + // using specific vertex shader and fragment shader + super(customVertex2DSampler, sprite); + + // vertex uniforms + this.uniforms.targetUVMatrix = targetSpriteMatrix; + + // fragment uniforms + this.uniforms.inputClampTarget = new Float32Array([0, 0, 0, 0]); + this.uniforms.color = new Float32Array([0.0, 0.0, 0.0]); + this.uniforms.scale = new Float32Array([1.0, 1.0]); + this.uniforms.translation = new Float32Array([0.0, 0.0]); + + // to store sprite matrix from the filter manager (and send to vertex) + this.targetSpriteMatrix = targetSpriteMatrix; + + Object.assign(this, { + imagePath: fixPath(imagePath), + color, + colorize, + inverse, + alpha, + alphaDiscard, + repeat, + top, + rotation, + twRadiusPercent, + twAngle, + twRotation, + bpRadiusPercent, + bpStrength, + scale, + scaleX, + scaleY, + translationX, + translationY, + play, + loop, + maintainAspectRatio, + maintainScale, + }); + + this.zOrder = 0; + this.autoFit = false; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + setTMParams(params) { + super.setTMParams(params); + if (!this.dummy && "imagePath" in params) { + this.assignTexture(); + } + } + + _play = true; + _loop = true; + _maintainAspectRatio = false; + _maintainScale = false; + + get play() { + return this._play; + } + + set play(value) { + if (!(value == null) && typeof value === "boolean") { + this._play = value; + this._playVideo(this._play); + } + } + + get loop() { + return this._loop; + } + + set loop(value) { + if (!(value == null) && typeof value === "boolean") { + this._loop = value; + this._playVideo(this._play); + } + } + + get maintainAspectRatio() { + return this._maintainAspectRatio; + } + + set maintainAspectRatio(value) { + if (!(value == null) && typeof value === "boolean") { + this._maintainAspectRatio = value; + } + } + + get maintainScale() { + return this._maintainScale; + } + + set maintainScale(value) { + if (!(value == null) && typeof value === "boolean") { + this._maintainScale = value; + } + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get colorize() { + return this.uniforms.colorize; + } + + set colorize(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.colorize = value; + } + } + + get inverse() { + return this.uniforms.inverse; + } + + set inverse(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.inverse = value; + } + } + + get alpha() { + return this.uniforms.alpha; + } + + set alpha(value) { + this.uniforms.alpha = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } + + get repeat() { + return this.uniforms.repeat; + } + + set repeat(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.repeat = value; + } + } + + get top() { + return this.uniforms.top; + } + + set top(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.top = value; + } + } + + get rotation() { + return this.uniforms.rotation; + } + + set rotation(value) { + this.uniforms.rotation = value; + } + + get twRadiusPercent() { + return this.uniforms.twRadius * 200; + } + + set twRadiusPercent(value) { + this.uniforms.twRadius = value / 200; + } + + get twAngle() { + return this.uniforms.twAngle; + } + + set twAngle(value) { + this.uniforms.twAngle = value; + } + + get twRotation() { + return this.uniforms.twAngle * (180 / Math.PI); + } + + set twRotation(value) { + this.uniforms.twAngle = value * (Math.PI / 180); + } + + get bpRadiusPercent() { + return this.uniforms.bpRadius * 200; + } + + set bpRadiusPercent(value) { + this.uniforms.bpRadius = value / 200; + } + + get bpStrength() { + return this.uniforms.bpStrength; + } + + set bpStrength(value) { + this.uniforms.bpStrength = value; + } + + get scale() { + // a little hack (we get only x) + return this.uniforms.scale[0]; + } + + set scale(value) { + this.uniforms.scale[1] = this.uniforms.scale[0] = value; + } + + get scaleX() { + return this.uniforms.scale[0]; + } + + set scaleX(value) { + this.uniforms.scale[0] = value; + } + + get scaleY() { + return this.uniforms.scale[1]; + } + + set scaleY(value) { + this.uniforms.scale[1] = value; + } + + get translationX() { + return this.uniforms.translation[0]; + } + + set translationX(value) { + this.uniforms.translation[0] = value; + } + + get translationY() { + return this.uniforms.translation[1]; + } + + set translationY(value) { + this.uniforms.translation[1] = value; + } + + get uSamplerTarget() { + return this.uniforms.uSamplerTarget; + } + + set uSamplerTarget(value) { + this.uniforms.uSamplerTarget = value; + } + + async _playVideo(value) { + // Play if baseTexture resource is a video + if (this.tex) { + const source = getProperty(this.tex, "baseTexture.resource.source"); + if (source && source.tagName === "VIDEO") { + if (isNaN(source.duration)) { + await new Promise((resolve) => { + source.onloadedmetadata = () => resolve(); + }); + } + if (value) game.video.play(source, { loop: this._loop, volume: 0 }); + else game.video.stop(source); + } + } + } + + assignTexture() { + if (this.hasOwnProperty("imagePath")) { + // Destroy the previous sprite + if (this.targetSprite && !this.targetSprite.destroyed) + this.targetSprite.destroy({ children: true, texture: false, baseTexture: false }); + this.tex = PIXI.Texture.from(this.imagePath); + + let sprite = new PIXI.Sprite(this.tex); + + sprite.renderable = false; + if (this.placeableImg._texture) { + sprite.width = this.placeableImg._texture.baseTexture.realWidth; + sprite.height = this.placeableImg._texture.baseTexture.realHeight; + sprite.anchor.set(0.5); + } else { + sprite.width = this.placeableImg.width; + sprite.height = this.placeableImg.height; + } + + this.targetSprite = sprite; + this.uSamplerTarget = sprite._texture; + this.placeableImg.addChild(sprite); + + this._playVideo(this._play); + } + } + + // override + apply(filterManager, input, output, clear) { + const targetSprite = this.targetSprite; + const tex = targetSprite._texture; + + if (tex.valid) { + if (!tex.uvMatrix) tex.uvMatrix = new PIXI.TextureMatrix(tex, 0.0); + tex.uvMatrix.update(); + + this.uniforms.uSamplerTarget = tex; + if (this.maintainScale) { + let pScale = targetSprite.parent.scale; + targetSprite.scale.set(1 / pScale.x, 1 / pScale.y); + } + + let w = targetSprite.worldTransform; + if (this.maintainAspectRatio) { + let scale = Math.min(w.a, w.d); + w.set(scale, w.b, w.c, scale, w.tx, w.ty); + } + + this.uniforms.targetUVMatrix = filterManager.calculateSpriteMatrix(this.targetSpriteMatrix, targetSprite); + this.uniforms.inputClampTarget = tex.uvMatrix.uClampFrame; + } + + super.apply(filterManager, input, output, clear); + } + + // override + destroy() { + super.destroy(); + if (!this.targetSprite.destroyed) this.targetSprite.destroy({ children: true, texture: false, baseTexture: false }); + } +} + +FilterSprite.defaults = { + color: 0x000000, + colorize: false, + inverse: false, + alpha: 1, + alphaDiscard: false, + repeat: false, + top: false, + rotation: 0.0, + twRadiusPercent: 0, + twAngle: 0, + bpRadiusPercent: 0, + bpStrength: 0, + scaleX: 1, + scaleY: 1, + translationX: 0, + translationY: 0, + play: true, + loop: true, + maintainAspectRatio: false, + maintainScale: false, +}; diff --git a/src/fx/filters/FilterSpriteMask.js b/src/fx/filters/FilterSpriteMask.js new file mode 100644 index 0000000..fccc72b --- /dev/null +++ b/src/fx/filters/FilterSpriteMask.js @@ -0,0 +1,344 @@ +import { spritemask } from "../glsl/fragmentshaders/spritemask.js"; +import { customVertex2DSampler } from "../glsl/vertexshaders/customvertex2DSampler.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; +import { fixPath } from "../../module.js"; + +export class FilterSpriteMask extends CustomFilter { + tex = null; + + constructor(params) { + let { + imagePath, + alpha, + repeat, + rotation, + twRadiusPercent, + twAngle, + twRotation, + bpRadiusPercent, + bpStrength, + scale, + scaleX, + scaleY, + translationX, + translationY, + play, + loop, + maintainAspectRatio, + maintainScale, + } = Object.assign({}, FilterSpriteMask.defaults, params); + + const targetSpriteMatrix = new PIXI.Matrix(); + + // using specific vertex shader and fragment shader + super(customVertex2DSampler, spritemask); + + // vertex uniforms + this.uniforms.targetUVMatrix = targetSpriteMatrix; + + // fragment uniforms + this.uniforms.inputClampTarget = new Float32Array([0, 0, 0, 0]); + this.uniforms.color = new Float32Array([0.0, 0.0, 0.0]); + this.uniforms.scale = new Float32Array([1.0, 1.0]); + this.uniforms.translation = new Float32Array([0.0, 0.0]); + + // to store sprite matrix from the filter manager (and send to vertex) + this.targetSpriteMatrix = targetSpriteMatrix; + + Object.assign(this, { + imagePath: fixPath(imagePath), + alpha, + repeat, + rotation, + twRadiusPercent, + twAngle, + twRotation, + bpRadiusPercent, + bpStrength, + scale, + scaleX, + scaleY, + translationX, + translationY, + play, + loop, + maintainAspectRatio, + maintainScale, + }); + + this.zOrder = 0; + this.autoFit = false; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + setTMParams(params) { + super.setTMParams(params); + if (!this.dummy && "imagePath" in params) { + this.assignTexture(); + } + } + + _play = true; + _loop = true; + _maintainAspectRatio = false; + _maintainScale = false; + + get play() { + return this._play; + } + + set play(value) { + if (!(value == null) && typeof value === "boolean") { + this._play = value; + this._playVideo(this._play); + } + } + + get loop() { + return this._loop; + } + + set loop(value) { + if (!(value == null) && typeof value === "boolean") { + this._loop = value; + this._playVideo(this._play); + } + } + + get maintainAspectRatio() { + return this._maintainAspectRatio; + } + + set maintainAspectRatio(value) { + if (!(value == null) && typeof value === "boolean") { + this._maintainAspectRatio = value; + } + } + + get maintainScale() { + return this._maintainScale; + } + + set maintainScale(value) { + if (!(value == null) && typeof value === "boolean") { + this._maintainScale = value; + } + } + + get alpha() { + return this.uniforms.alpha; + } + + set alpha(value) { + this.uniforms.alpha = value; + } + + get repeat() { + return this.uniforms.repeat; + } + + set repeat(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.repeat = value; + } + } + + get rotation() { + return this.uniforms.rotation; + } + + set rotation(value) { + this.uniforms.rotation = value; + } + + get twRadiusPercent() { + return this.uniforms.twRadius * 200; + } + + set twRadiusPercent(value) { + this.uniforms.twRadius = value / 200; + } + + get twAngle() { + return this.uniforms.twAngle; + } + + set twAngle(value) { + this.uniforms.twAngle = value; + } + + get twRotation() { + return this.uniforms.twAngle * (180 / Math.PI); + } + + set twRotation(value) { + this.uniforms.twAngle = value * (Math.PI / 180); + } + + get bpRadiusPercent() { + return this.uniforms.bpRadius * 200; + } + + set bpRadiusPercent(value) { + this.uniforms.bpRadius = value / 200; + } + + get bpStrength() { + return this.uniforms.bpStrength; + } + + set bpStrength(value) { + this.uniforms.bpStrength = value; + } + + get scale() { + // a little hack (we get only x) + return this.uniforms.scale[0]; + } + + set scale(value) { + this.uniforms.scale[1] = this.uniforms.scale[0] = value; + } + + get scaleX() { + return this.uniforms.scale[0]; + } + + set scaleX(value) { + this.uniforms.scale[0] = value; + } + + get scaleY() { + return this.uniforms.scale[1]; + } + + set scaleY(value) { + this.uniforms.scale[1] = value; + } + + get translationX() { + return this.uniforms.translation[0]; + } + + set translationX(value) { + this.uniforms.translation[0] = value; + } + + get translationY() { + return this.uniforms.translation[1]; + } + + set translationY(value) { + this.uniforms.translation[1] = value; + } + + get uSamplerTarget() { + return this.uniforms.uSamplerTarget; + } + + set uSamplerTarget(value) { + this.uniforms.uSamplerTarget = value; + } + + async _playVideo(value) { + // Play if baseTexture resource is a video + if (this.tex) { + const source = getProperty(this.tex, "baseTexture.resource.source"); + if (source && source.tagName === "VIDEO") { + if (isNaN(source.duration)) { + await new Promise((resolve) => { + source.onloadedmetadata = () => resolve(); + }); + } + if (value) game.video.play(source, { loop: this._loop, volume: 0 }); + else game.video.stop(source); + } + } + } + + assignTexture() { + if (this.hasOwnProperty("imagePath")) { + // Destroy the previous sprite + if (this.targetSprite && !this.targetSprite.destroyed) + this.targetSprite.destroy({ children: true, texture: false, baseTexture: false }); + this.tex = PIXI.Texture.from(this.imagePath); + + let sprite = new PIXI.Sprite(this.tex); + + sprite.renderable = false; + if (this.placeableImg._texture) { + sprite.width = this.placeableImg._texture.baseTexture.realWidth; + sprite.height = this.placeableImg._texture.baseTexture.realHeight; + sprite.anchor.set(0.5); + } else { + sprite.width = this.placeableImg.width; + sprite.height = this.placeableImg.height; + } + + this.targetSprite = sprite; + this.uSamplerTarget = sprite._texture; + this.placeableImg.addChild(sprite); + + this._playVideo(this._play); + } + } + + // override + apply(filterManager, input, output, clear) { + const targetSprite = this.targetSprite; + const tex = targetSprite._texture; + + if (tex.valid) { + if (!tex.uvMatrix) tex.uvMatrix = new PIXI.TextureMatrix(tex, 0.0); + tex.uvMatrix.update(); + + this.uniforms.uSamplerTarget = tex; + if (this.maintainScale) { + let pScale = targetSprite.parent.scale; + targetSprite.scale.set(1 / pScale.x, 1 / pScale.y); + } + + let w = targetSprite.worldTransform; + if (this.maintainAspectRatio) { + let scale = Math.min(w.a, w.d); + w.set(scale, w.b, w.c, scale, w.tx, w.ty); + } + + this.uniforms.targetUVMatrix = filterManager.calculateSpriteMatrix(this.targetSpriteMatrix, targetSprite); + this.uniforms.inputClampTarget = tex.uvMatrix.uClampFrame; + } + + super.apply(filterManager, input, output, clear); + } + + // override + destroy() { + super.destroy(); + if (!this.targetSprite.destroyed) this.targetSprite.destroy({ children: true, texture: false, baseTexture: false }); + } +} + +FilterSpriteMask.defaults = { + alpha: 1, + repeat: false, + rotation: 0.0, + twRadiusPercent: 0, + twAngle: 0, + bpRadiusPercent: 0, + bpStrength: 0, + scaleX: 1, + scaleY: 1, + translationX: 0, + translationY: 0, + play: true, + loop: true, + maintainAspectRatio: false, + maintainScale: false, +}; diff --git a/src/fx/filters/FilterTransform.js b/src/fx/filters/FilterTransform.js new file mode 100644 index 0000000..8d7ea95 --- /dev/null +++ b/src/fx/filters/FilterTransform.js @@ -0,0 +1,175 @@ +import { matrix } from "../glsl/fragmentshaders/matrix.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterTransform extends CustomFilter { + constructor(params) { + let { + rotation, + twRadiusPercent, + twAngle, + twRotation, + bpRadiusPercent, + bpStrength, + scale, + scaleX, + scaleY, + pivotX, + pivotY, + translationX, + translationY, + } = Object.assign({}, FilterTransform.defaults, params); + + super(customVertex2D, matrix); + + this.uniforms.scale = new Float32Array([1.0, 1.0]); + this.uniforms.pivot = new Float32Array([0.5, 0.5]); + this.uniforms.translation = new Float32Array([0.0, 0.0]); + + Object.assign(this, { + rotation, + twRadiusPercent, + twAngle, + twRotation, + bpRadiusPercent, + bpStrength, + scale, + scaleX, + scaleY, + pivotX, + pivotY, + translationX, + translationY, + }); + + this.zOrder = 1000; + this.autoFit = false; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get rotation() { + return this.uniforms.rotation; + } + + set rotation(value) { + this.uniforms.rotation = value; + } + + get twRadiusPercent() { + return this.uniforms.twRadius * 200; + } + + set twRadiusPercent(value) { + this.uniforms.twRadius = value / 200; + } + + get twAngle() { + return this.uniforms.twAngle; + } + + set twAngle(value) { + this.uniforms.twAngle = value; + } + + get twRotation() { + return this.uniforms.twAngle * (180 / Math.PI); + } + + set twRotation(value) { + this.uniforms.twAngle = value * (Math.PI / 180); + } + + get bpRadiusPercent() { + return this.uniforms.bpRadius * 200; + } + + set bpRadiusPercent(value) { + this.uniforms.bpRadius = value / 200; + } + + get bpStrength() { + return this.uniforms.bpStrength; + } + + set bpStrength(value) { + this.uniforms.bpStrength = value; + } + + get scale() { + // a little hack (we get only x) + return this.uniforms.scale[0]; + } + + set scale(value) { + this.uniforms.scale[1] = this.uniforms.scale[0] = value; + } + + get scaleX() { + return this.uniforms.scale[0]; + } + + set scaleX(value) { + this.uniforms.scale[0] = value; + } + + get scaleY() { + return this.uniforms.scale[1]; + } + + set scaleY(value) { + this.uniforms.scale[1] = value; + } + + get pivotX() { + return this.uniforms.pivot[0]; + } + + set pivotX(value) { + this.uniforms.pivot[0] = value; + } + + get pivotY() { + return this.uniforms.pivot[1]; + } + + set pivotY(value) { + this.uniforms.pivot[1] = value; + } + + get translationX() { + return this.uniforms.translation[0]; + } + + set translationX(value) { + this.uniforms.translation[0] = value; + } + + get translationY() { + return this.uniforms.translation[1]; + } + + set translationY(value) { + this.uniforms.translation[1] = value; + } +} + +FilterTransform.defaults = { + rotation: 0.0, + twRadiusPercent: 0, + twAngle: 0, + bpRadiusPercent: 0, + bpStrength: 0, + scaleX: 1, + scaleY: 1, + pivotX: 0.5, + pivotY: 0.5, + translationX: 0, + translationY: 0, +}; diff --git a/src/fx/filters/FilterTwist.js b/src/fx/filters/FilterTwist.js new file mode 100644 index 0000000..3dd56bc --- /dev/null +++ b/src/fx/filters/FilterTwist.js @@ -0,0 +1,30 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterTwist extends PIXI.filters.TwistFilter { + constructor(params) { + super(); + this.enabled = false; + this.radiusPercent = 50; + this.angle = 4; + this.zOrder = 240; + this.animated = {}; + this.offset = [0, 0]; + this.autoFit = false; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + handleTransform() { + this.offset[0] = this.placeableImg.worldTransform.tx; + this.offset[1] = this.placeableImg.worldTransform.ty; + this.radius = + (Math.max(this.placeableImg.width, this.placeableImg.height) * + this.targetPlaceable.worldTransform.a * + this.radiusPercent) / + 200; + } +} diff --git a/src/fx/filters/FilterWaves.js b/src/fx/filters/FilterWaves.js new file mode 100644 index 0000000..6b6318c --- /dev/null +++ b/src/fx/filters/FilterWaves.js @@ -0,0 +1,127 @@ +import { magicWaves } from "../glsl/fragmentshaders/waves.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterWaves extends CustomFilter { + constructor(params) { + let { time, color, inward, frequency, strength, minIntensity, maxIntensity, anchorX, anchorY } = Object.assign( + {}, + FilterWaves.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, magicWaves); + + this.uniforms.color = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.anchor = new Float32Array([0.5, 0.5]); + + Object.assign(this, { + time, + color, + inward, + frequency, + strength, + minIntensity, + maxIntensity, + anchorX, + anchorY, + }); + + this.zOrder = 280; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get inward() { + return this.uniforms.inward; + } + + set inward(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.inward = value; + } + } + + get anchorX() { + return this.uniforms.anchor[0]; + } + + set anchorX(value) { + this.uniforms.anchor[0] = value; + } + + get anchorY() { + return this.uniforms.anchor[1]; + } + + set anchorY(value) { + this.uniforms.anchor[1] = value; + } + + get frequency() { + return this.uniforms.frequency; + } + + set frequency(value) { + this.uniforms.frequency = value; + } + + get strength() { + return this.uniforms.strength; + } + + set strength(value) { + this.uniforms.strength = value; + } + + get minIntensity() { + return this.uniforms.minIntensity; + } + + set minIntensity(value) { + this.uniforms.minIntensity = value; + } + + get maxIntensity() { + return this.uniforms.maxIntensity; + } + + set maxIntensity(value) { + this.uniforms.maxIntensity = value; + } +} + +FilterWaves.defaults = { + time: 0, + color: 0xffffff, + inward: false, + frequency: 35, + strength: 0.01, + minIntensity: 1.2, + maxIntensity: 3.5, + anchorX: 0.5, + anchorY: 0.5, +}; diff --git a/src/fx/filters/FilterXFire.js b/src/fx/filters/FilterXFire.js new file mode 100644 index 0000000..fa37a20 --- /dev/null +++ b/src/fx/filters/FilterXFire.js @@ -0,0 +1,207 @@ +import { burnXFire } from "../glsl/fragmentshaders/xfire.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterXFire extends CustomFilter { + constructor(params) { + let { + time, + color, + color1, + color2, + color3, + color4, + amplitude, + dispersion, + blend, + scaleX, + scaleY, + alphaDiscard, + discardThreshold, + chromatic, + inlay, + } = Object.assign({}, FilterXFire.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, burnXFire); + + this.uniforms.color = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.color1 = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.color2 = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.color3 = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.color4 = new Float32Array([1.0, 1.0, 1.0]); + this.uniforms.scale = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + color1, + color2, + color3, + color4, + amplitude, + dispersion, + blend, + scaleX, + scaleY, + alphaDiscard, + discardThreshold, + chromatic, + inlay, + }); + + this.zOrder = 145; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get color1() { + return PIXI.utils.rgb2hex(this.uniforms.color1); + } + + set color1(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color1); + } + + get color2() { + return PIXI.utils.rgb2hex(this.uniforms.color2); + } + + set color2(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color2); + } + + get color3() { + return PIXI.utils.rgb2hex(this.uniforms.color3); + } + + set color3(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color3); + } + + get color4() { + return PIXI.utils.rgb2hex(this.uniforms.color4); + } + + set color4(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color4); + } + + get amplitude() { + return this.uniforms.amplitude; + } + + set amplitude(value) { + this.uniforms.amplitude = value; + } + + get dispersion() { + return this.uniforms.dispersion; + } + + set dispersion(value) { + this.uniforms.dispersion = value; + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get scaleX() { + return this.uniforms.scale[0]; + } + + set scaleX(value) { + this.uniforms.scale[0] = value; + } + + get scaleY() { + return this.uniforms.scale[1]; + } + + set scaleY(value) { + this.uniforms.scale[1] = value; + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } + + get discardThreshold() { + return this.uniforms.discardThreshold; + } + + set discardThreshold(value) { + this.uniforms.discardThreshold = value; + } + + get chromatic() { + return this.uniforms.chromatic; + } + + set chromatic(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.chromatic = value; + } + } + + get inlay() { + return this.uniforms.inlay; + } + + set inlay(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.inlay = value; + } + } +} + +FilterXFire.defaults = { + time: 0, + color: 0x000000, + color1: 0x250000, + color2: 0xb20000, + color3: 0x330000, + color4: 0xffe500, + amplitude: 1, + dispersion: 0.25, + blend: 2, + scaleX: 1, + scaleY: 1, + discardThreshold: 0.1, + alphaDiscard: false, + chromatic: false, + inlay: false, +}; diff --git a/src/fx/filters/FilterXFog.js b/src/fx/filters/FilterXFog.js new file mode 100644 index 0000000..49b43fd --- /dev/null +++ b/src/fx/filters/FilterXFog.js @@ -0,0 +1,61 @@ +import { xFog } from "../glsl/fragmentshaders/xfog.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; + +export class FilterXFog extends CustomFilter { + constructor(params) { + let { time, color, alphaDiscard } = Object.assign({}, FilterXFog.defaults, params); + + // specific vertex and fragment shaders + super(customVertex2D, xFog); + + this.uniforms.color = new Float32Array([1.0, 0.4, 0.1, 0.55]); + + Object.assign(this, { + time, + color, + alphaDiscard, + }); + + this.zOrder = 230; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get alphaDiscard() { + return this.uniforms.alphaDiscard; + } + + set alphaDiscard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.alphaDiscard = value; + } + } +} + +FilterXFog.defaults = { + time: 0.0, + color: 0xffffff, + alphaDiscard: false, +}; diff --git a/src/fx/filters/FilterXRays.js b/src/fx/filters/FilterXRays.js new file mode 100644 index 0000000..c39ef09 --- /dev/null +++ b/src/fx/filters/FilterXRays.js @@ -0,0 +1,126 @@ +import { xRay } from "../glsl/fragmentshaders/xray.js"; +import { customVertex2D } from "../glsl/vertexshaders/customvertex2D.js"; +import { CustomFilter } from "./CustomFilter.js"; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterXRays extends CustomFilter { + constructor(params) { + let { time, color, divisor, intensity, blend, anchorX, anchorY, dimX, dimY } = Object.assign( + {}, + FilterXRays.defaults, + params + ); + + // using specific vertex shader and fragment shader + super(customVertex2D, xRay); + + this.uniforms.color = new Float32Array([1.0, 0.4, 0.1]); + this.uniforms.anchor = new Float32Array([0.5, -1.0]); + this.uniforms.dimensions = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, + color, + divisor, + intensity, + blend, + anchorX, + anchorY, + dimX, + dimY, + }); + + this.zOrder = 130; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + new PIXI.Color(value).toRgbArray(this.uniforms.color); + } + + get divisor() { + return this.uniforms.divisor; + } + + set divisor(value) { + this.uniforms.divisor = value; + } + + get intensity() { + return this.uniforms.intensity; + } + + set intensity(value) { + this.uniforms.intensity = value; + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get anchorX() { + return this.uniforms.anchor[0]; + } + + set anchorX(value) { + this.uniforms.anchor[0] = value; + } + + get anchorY() { + return this.uniforms.anchor[1]; + } + + set anchorY(value) { + this.uniforms.anchor[1] = value; + } + + get dimX() { + return this.uniforms.dimensions[0]; + } + + set dimX(value) { + this.uniforms.dimensions[0] = value; + } + + get dimY() { + return this.uniforms.dimensions[1]; + } + + set dimY(value) { + this.uniforms.dimensions[1] = value; + } +} + +FilterXRays.defaults = { + time: 0.0, + color: 0xff8010, + divisor: 40, + intensity: 0.1, + blend: 8, + anchorX: 0.5, + anchorY: -1.0, + dimX: 1, + dimY: 1, +}; diff --git a/src/fx/filters/FilterZoomBlur.js b/src/fx/filters/FilterZoomBlur.js new file mode 100644 index 0000000..deaae8c --- /dev/null +++ b/src/fx/filters/FilterZoomBlur.js @@ -0,0 +1,34 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterZoomBlur extends PIXI.filters.ZoomBlurFilter { + constructor(params) { + super(); + this.enabled = false; + this.strength = 0.1; + this.radiusPercent = 50; + this.innerRadiusPercent = 10; + this.zOrder = 300; + this.animated = {}; + this.setTMParams(params); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } + } + + handleTransform(state) { + this.center[0] = 0.5 * state.sourceFrame.width; + this.center[1] = 0.5 * state.sourceFrame.height; + this.radius = + (Math.max(this.placeableImg.width, this.placeableImg.height) * + this.targetPlaceable.worldTransform.a * + this.radiusPercent) / + 200; + this.innerRadius = + (Math.max(this.placeableImg.width, this.placeableImg.height) * + this.targetPlaceable.worldTransform.a * + this.innerRadiusPercent) / + 200; + } +} diff --git a/src/fx/filters/proto/FilterProto.js b/src/fx/filters/proto/FilterProto.js new file mode 100644 index 0000000..5c63e77 --- /dev/null +++ b/src/fx/filters/proto/FilterProto.js @@ -0,0 +1,177 @@ +import { getPlaceableById, getMinPadding, PlaceableType } from "../../../module.js"; +import "../../../scripts/proto/PlaceableObjectProto.js"; + +PIXI.Filter.prototype.setTMParams = function (params) { + this.autoDisable = false; + this.autoDestroy = false; + this.gridPadding = 0; + this.boundsPadding = new PIXI.Point(0, 0); + this.currentPadding = 0; + this.recalculatePadding = true; + this.dummy = false; + foundry.utils.mergeObject(this, params); + if (!this.dummy) { + this.rawPadding = this.rawPadding ?? this.padding ?? 0; + this.originalPadding = Math.max(this.rawPadding, getMinPadding()); + this.assignPlaceable(); + this.activateTransform(); + Object.defineProperty(this, "padding", { + get: function () { + if (this.recalculatePadding) this.calculatePadding(); + return this.currentPadding; + }, + set: function (padding) { + this.rawPadding = padding; + this.originalPadding = Math.max(padding, getMinPadding()); + }, + }); + } else { + this.apply = function (filterManager, input, output, clear) { + filterManager.applyFilter(this, input, output, clear); + }; + } +}; + +PIXI.Filter.prototype.getPlaceable = function () { + return getPlaceableById(this.placeableId, this.placeableType); +}; + +PIXI.Filter.prototype.getPlaceableType = function () { + return this.placeableType; +}; + +PIXI.Filter.prototype.calculatePadding = function () { + const target = this.placeableImg; + let width; + let height; + + { + const ang = !this.sticky && this.placeableType !== PlaceableType.TOKEN ? target.rotation : 0; + const sin = Math.sin(ang); + const cos = Math.cos(ang); + width = Math.abs(target.width * cos) + Math.abs(target.height * sin); + height = Math.abs(target.width * sin) + Math.abs(target.height * cos); + } + + if (this.gridPadding > 0) { + const gridSize = canvas.dimensions.size; + this.boundsPadding.x = this.boundsPadding.y = (this.gridPadding - 1) * gridSize; + this.boundsPadding.x += (gridSize - 1 - ((width + gridSize - 1) % gridSize)) / 2; + this.boundsPadding.y += (gridSize - 1 - ((height + gridSize - 1) % gridSize)) / 2; + } else { + this.boundsPadding.x = this.boundsPadding.y = this.rawPadding; + } + + { + const ang = this.sticky ? target.rotation : 0; + const sin = Math.sin(ang); + const cos = Math.cos(ang); + this.currentPadding = + Math.max( + Math.abs(this.boundsPadding.x * cos) + Math.abs(this.boundsPadding.y * sin), + Math.abs(this.boundsPadding.x * sin) + Math.abs(this.boundsPadding.y * cos) + ) + + (this.originalPadding - this.rawPadding); + } + + this.boundsPadding.x += (width - target.width) / 2; + this.boundsPadding.y += (height - target.height) / 2; + + const scale = this.targetPlaceable.worldTransform.a; + + this.boundsPadding.x *= scale; + this.boundsPadding.y *= scale; + this.currentPadding *= scale; +}; + +PIXI.Filter.prototype.assignPlaceable = function () { + this.targetPlaceable = this.getPlaceable(); + this.targetPlaceable != null + ? (this.placeableImg = this.targetPlaceable._TMFXgetSprite()) + : (this.placeableImg = null); +}; + +PIXI.Filter.prototype.activateTransform = function () { + this.preComputation = this.filterTransform; + this.filterTransform(); + + const apply = this.apply; + this.apply = function (filterManager, input, output, clear, state) { + if ("handleTransform" in this) { + this.handleTransform(state); + } + return apply.apply(this, arguments); + }; +}; + +PIXI.Filter.prototype.filterTransform = function () { + if (this.hasOwnProperty("zIndex")) { + this.targetPlaceable.zIndex = this.zIndex; + } +}; + +PIXI.Filter.prototype.normalizeTMParams = function () { + if (this.hasOwnProperty("animated") && !(this.animated == null)) { + // Normalize animations properties + Object.keys(this.animated).forEach((effect) => { + if (this.animated[effect].active == null || typeof this.animated[effect].active != "boolean") { + this.animated[effect].active = true; + } + if ( + this.animated[effect].loops == null || + typeof this.animated[effect].loops != "number" || + this.animated[effect].loops <= 0 + ) { + this.animated[effect].loops = Infinity; + } + if ( + this.animated[effect].loopDuration == null || + typeof this.animated[effect].loopDuration != "number" || + this.animated[effect].loopDuration <= 0 + ) { + this.animated[effect].loopDuration = 3000; + } + if (this.animated[effect].clockWise == null || typeof this.animated[effect].clockWise != "boolean") { + this.animated[effect].clockWise = true; + } + if ( + this.animated[effect].pauseBetweenDuration == null || + typeof this.animated[effect].pauseBetweenDuration != "number" || + this.animated[effect].pauseBetweenDuration <= 0 + ) { + this.animated[effect].pauseBetweenDuration = 0; + } + if ( + this.animated[effect].syncShift == null || + typeof this.animated[effect].syncShift != "number" || + this.animated[effect].syncShift < 0 + ) { + this.animated[effect].syncShift = 0; + } + if (this.animated[effect].val1 == null || typeof this.animated[effect].val1 != "number") { + this.animated[effect].val1 = 0; + } + if (this.animated[effect].val2 == null || typeof this.animated[effect].val2 != "number") { + this.animated[effect].val2 = 0; + } + if (this.anime[this.animated[effect].animType] === undefined) { + this.animated[effect].animType = null; + } + if (this.animated[effect].speed == null || typeof this.animated[effect].speed != "number") { + this.animated[effect].speed = 0; + } + if (this.animated[effect].chaosFactor == null || typeof this.animated[effect].chaosFactor != "number") { + this.animated[effect].chaosFactor = 0.25; + } + if (this.animated[effect].wantInteger == null || typeof this.animated[effect].wantInteger != "boolean") { + this.animated[effect].wantInteger = false; + } + + if (!this.anime.hasInternals(effect)) { + this.anime.initInternals(effect); + } + + this.anime.animated = this.animated; + }); + } +}; diff --git a/tokenmagic/fx/glsl/fragmentshaders/cosmicray.js b/src/fx/glsl/fragmentshaders/cosmicray.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/cosmicray.js rename to src/fx/glsl/fragmentshaders/cosmicray.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/ddtint.js b/src/fx/glsl/fragmentshaders/ddtint.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/ddtint.js rename to src/fx/glsl/fragmentshaders/ddtint.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/dropshadow.js b/src/fx/glsl/fragmentshaders/dropshadow.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/dropshadow.js rename to src/fx/glsl/fragmentshaders/dropshadow.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/electricity.js b/src/fx/glsl/fragmentshaders/electricity.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/electricity.js rename to src/fx/glsl/fragmentshaders/electricity.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/fire.js b/src/fx/glsl/fragmentshaders/fire.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/fire.js rename to src/fx/glsl/fragmentshaders/fire.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/flood.js b/src/fx/glsl/fragmentshaders/flood.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/flood.js rename to src/fx/glsl/fragmentshaders/flood.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/fog.js b/src/fx/glsl/fragmentshaders/fog.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/fog.js rename to src/fx/glsl/fragmentshaders/fog.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/forcefield.js b/src/fx/glsl/fragmentshaders/forcefield.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/forcefield.js rename to src/fx/glsl/fragmentshaders/forcefield.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/fumes.js b/src/fx/glsl/fragmentshaders/fumes.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/fumes.js rename to src/fx/glsl/fragmentshaders/fumes.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/globes.js b/src/fx/glsl/fragmentshaders/globes.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/globes.js rename to src/fx/glsl/fragmentshaders/globes.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/liquid.js b/src/fx/glsl/fragmentshaders/liquid.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/liquid.js rename to src/fx/glsl/fragmentshaders/liquid.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/magicglow.js b/src/fx/glsl/fragmentshaders/magicglow.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/magicglow.js rename to src/fx/glsl/fragmentshaders/magicglow.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/matrix.js b/src/fx/glsl/fragmentshaders/matrix.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/matrix.js rename to src/fx/glsl/fragmentshaders/matrix.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js b/src/fx/glsl/fragmentshaders/mirrorimages.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js rename to src/fx/glsl/fragmentshaders/mirrorimages.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/polymorph.js b/src/fx/glsl/fragmentshaders/polymorph.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/polymorph.js rename to src/fx/glsl/fragmentshaders/polymorph.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/removeshadow.js b/src/fx/glsl/fragmentshaders/removeshadow.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/removeshadow.js rename to src/fx/glsl/fragmentshaders/removeshadow.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/ripples.js b/src/fx/glsl/fragmentshaders/ripples.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/ripples.js rename to src/fx/glsl/fragmentshaders/ripples.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/smoke.js b/src/fx/glsl/fragmentshaders/smoke.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/smoke.js rename to src/fx/glsl/fragmentshaders/smoke.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/spiderweb.js b/src/fx/glsl/fragmentshaders/spiderweb.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/spiderweb.js rename to src/fx/glsl/fragmentshaders/spiderweb.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/splash.js b/src/fx/glsl/fragmentshaders/splash.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/splash.js rename to src/fx/glsl/fragmentshaders/splash.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/sprite.js b/src/fx/glsl/fragmentshaders/sprite.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/sprite.js rename to src/fx/glsl/fragmentshaders/sprite.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/spritemask.js b/src/fx/glsl/fragmentshaders/spritemask.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/spritemask.js rename to src/fx/glsl/fragmentshaders/spritemask.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/waves.js b/src/fx/glsl/fragmentshaders/waves.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/waves.js rename to src/fx/glsl/fragmentshaders/waves.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/xfire.js b/src/fx/glsl/fragmentshaders/xfire.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/xfire.js rename to src/fx/glsl/fragmentshaders/xfire.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/xfog.js b/src/fx/glsl/fragmentshaders/xfog.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/xfog.js rename to src/fx/glsl/fragmentshaders/xfog.js diff --git a/tokenmagic/fx/glsl/fragmentshaders/xray.js b/src/fx/glsl/fragmentshaders/xray.js similarity index 100% rename from tokenmagic/fx/glsl/fragmentshaders/xray.js rename to src/fx/glsl/fragmentshaders/xray.js diff --git a/tokenmagic/fx/glsl/vertexshaders/customvertex2D.js b/src/fx/glsl/vertexshaders/customvertex2D.js similarity index 100% rename from tokenmagic/fx/glsl/vertexshaders/customvertex2D.js rename to src/fx/glsl/vertexshaders/customvertex2D.js diff --git a/tokenmagic/fx/glsl/vertexshaders/customvertex2DSampler.js b/src/fx/glsl/vertexshaders/customvertex2DSampler.js similarity index 100% rename from tokenmagic/fx/glsl/vertexshaders/customvertex2DSampler.js rename to src/fx/glsl/vertexshaders/customvertex2DSampler.js diff --git a/src/fx/presets/defaultpresets.js b/src/fx/presets/defaultpresets.js new file mode 100644 index 0000000..0f986d8 --- /dev/null +++ b/src/fx/presets/defaultpresets.js @@ -0,0 +1,2677 @@ +export const PresetsLibrary = { + MAIN: "tmfx-main", + TEMPLATE: "tmfx-template", +}; + +export var presets = []; + +let params = [ + { + filterType: "bevel", + filterId: "bevel", + rotation: 0, + thickness: 5, + lightColor: 0xff0000, + lightAlpha: 0.8, + shadowColor: 0x00ff00, + shadowAlpha: 0.5, + animated: { + rotation: { + active: true, + clockWise: true, + loopDuration: 1600, + animType: "syncRotation", + }, + }, + }, +]; + +var presetObject = {}; +presetObject.name = "bevel"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "adjustment", + filterId: "adjustment", + saturation: 1.5, + brightness: 1.5, + contrast: 2, + gamma: 2, + red: 4, + green: 0.25, + blue: 0.25, + alpha: 1, + animated: { + alpha: { + active: true, + loopDuration: 5000, + animType: "syncCosOscillation", + val1: 0.15, + val2: 1, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "adjustment"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "shadow", + filterId: "dropshadow", + rotation: 35, + blur: 2, + quality: 5, + distance: 20, + alpha: 0.7, + padding: 10, + shadowOnly: false, + color: 0x000000, + animated: { + blur: { + active: true, + loopDuration: 1500, + animType: "syncCosOscillation", + val1: 2, + val2: 3, + }, + rotation: { + active: true, + loopDuration: 150, + animType: "syncSinOscillation", + val1: 33, + val2: 35, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "dropshadow"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "outline", + filterId: "outline", + padding: 10, + color: 0xee6035, + thickness: 1, + quality: 5, + animated: { + thickness: { + active: true, + loopDuration: 800, + animType: "syncCosOscillation", + val1: 1, + val2: 6, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "outline"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "glow", + filterId: "glow", + outerStrength: 7, + innerStrength: 0, + color: 0x006000, + quality: 0.5, + padding: 10, + animated: { + color: { + active: true, + loopDuration: 3000, + animType: "colorOscillation", + val1: 0x003000, + val2: 0x00ff00, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "glow"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "xbloom", + filterId: "bloom", + threshold: 0.35, + bloomScale: 0, + brightness: 1, + blur: 0.1, + padding: 10, + quality: 15, + blendMode: 0, + animated: { + bloomScale: { + active: true, + loopDuration: 2000, + animType: "syncCosOscillation", + val1: 0, + val2: 2.1, + }, + threshold: { + active: false, + loopDuration: 1000, + animType: "syncCosOscillation", + val1: 0.0, + val2: 1.9, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "bloom"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "distortion", + filterId: "distortion", + maskPath: "modules/tokenmagic/fx/assets/distortion-1.png", + maskSpriteScaleX: 5, + maskSpriteScaleY: 5, + padding: 20, + animated: { + maskSpriteX: { active: true, speed: 0.05, animType: "move" }, + maskSpriteY: { active: true, speed: 0.07, animType: "move" }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "distortion"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "oldfilm", + filterId: "oldfilm", + sepia: 0.6, + noise: 0.2, + noiseSize: 1.0, + scratch: 0.8, + scratchDensity: 0.5, + scratchWidth: 1.2, + vignetting: 0.9, + vignettingAlpha: 0.6, + vignettingBlur: 0.2, + animated: { + seed: { + active: true, + animType: "randomNumber", + val1: 0, + val2: 1, + }, + vignetting: { + active: true, + animType: "syncCosOscillation", + loopDuration: 2000, + val1: 0.2, + val2: 0.4, + }, + }, + }, + { + filterType: "outline", + filterId: "oldfilm", + color: 0x000000, + thickness: 0, + }, +]; + +presetObject = new Object(); +presetObject.name = "oldfilm"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "twist", + filterId: "twist", + radiusPercent: 120, + angle: 0, + animated: { + angle: { + active: true, + animType: "sinOscillation", + loopDuration: 10000, + val1: -0.6 * Math.PI, + val2: +0.6 * Math.PI, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "twist"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "bulgepinch", + filterId: "bulge", + padding: 150, + strength: 0, + zIndex: 2, + radiusPercent: 200, + animated: { + strength: { + active: true, + animType: "cosOscillation", + loopDuration: 2000, + val1: 0, + val2: 0.45, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "bulge"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "blur", + filterId: "blur", + padding: 10, + quality: 4.0, + blur: 0, + blurX: 0, + blurY: 0, + animated: { + blurX: { + active: true, + animType: "syncCosOscillation", + loopDuration: 500, + val1: 0, + val2: 6, + }, + blurY: { + active: true, + animType: "syncCosOscillation", + loopDuration: 750, + val1: 0, + val2: 6, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "blur"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "zoomblur", + filterId: "zoomblur", + strength: 0.15, + innerRadiusPercent: 65, + radiusPercent: 100, + padding: 30, + animated: { + innerRadiusPercent: { + active: true, + animType: "sinOscillation", + loopDuration: 500, + val1: 65, + val2: 75, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "zoomblur"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "shockwave", + filterId: "shockwave", + time: 0, + amplitude: 8, + wavelength: 75, + radius: 500, + brightness: 1.5, + speed: 25, + padding: 0, + animated: { + time: { + animType: "cosOscillation", + active: true, + loopDuration: 1800, + val1: 0, + val2: 10, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "shockwave"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "zapshadow", + filterId: "zapshadow", + alphaTolerance: 0.45, + }, +]; + +presetObject = new Object(); +presetObject.name = "zapshadow"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "ray", + filterId: "rays", + time: 0, + color: 0xcf8000, + alpha: 0.5, + divisor: 32, + anchorX: 0, + anchorY: 0, + animated: { + time: { + active: true, + speed: 0.0005, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "rays"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "fog", + filterId: "fog", + color: 0x000000, + density: 0.65, + time: 0, + dimX: 1, + dimY: 1, + animated: { + time: { + active: true, + speed: 2.2, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "fog"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "fumes", + filterId: "fumes", + color: 0x808080, + time: 0, + blend: 8, + animated: { + time: { + active: true, + speed: 0.001, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "fumes"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "electric", + filterId: "electric", + color: 0xffffff, + time: 0, + blend: 1, + intensity: 5, + animated: { + time: { + active: true, + speed: 0.002, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "electric"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "fire", + filterId: "fire", + intensity: 1, + color: 0xffffff, + amplitude: 1, + time: 0, + blend: 2, + fireBlend: 1, + animated: { + time: { + active: true, + speed: -0.0024, + animType: "move", + }, + intensity: { + active: true, + loopDuration: 15000, + val1: 0.8, + val2: 2, + animType: "syncCosOscillation", + }, + amplitude: { + active: true, + loopDuration: 4400, + val1: 1, + val2: 1.4, + animType: "syncCosOscillation", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "fire"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "wave", + filterId: "waves", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.015, + frequency: 120, + color: 0xffffff, + maxIntensity: 2.5, + minIntensity: 0.9, + padding: 10, + animated: { + time: { + active: true, + speed: 0.0085, + animType: "move", + }, + anchorX: { + active: false, + val1: 0.15, + val2: 0.85, + animType: "syncChaoticOscillation", + loopDuration: 20000, + }, + anchorY: { + active: false, + val1: 0.15, + val2: 0.85, + animType: "syncSinOscillation", + loopDuration: 20000, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "waves"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "flood", + filterId: "flood", + time: 0, + color: 0x0020bb, + billowy: 0.43, + tintIntensity: 0.72, + glint: 0.31, + scale: 70, + padding: 10, + animated: { + time: { + active: true, + speed: 0.0006, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "flood"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "smoke", + filterId: "smoke", + color: 0x5099dd, + time: 0, + blend: 2, + dimX: 0.1, + dimY: 1, + animated: { + time: { + active: true, + speed: 0.009, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "smoke"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "images", + filterId: "images", + time: 0, + nbImage: 4, + alphaImg: 1.0, + alphaChr: 0.0, + blend: 4, + ampX: 0.1, + ampY: 0.1, + animated: { + time: { + active: true, + speed: 0.001, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "images"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "images", + filterId: "chaos-images", + time: 0, + nbImage: 4, + alphaImg: 1.0, + alphaChr: 0.0, + blend: 4, + ampX: 0.1, + ampY: 0.1, + padding: 80, + animated: { + time: { + active: true, + speed: 0.001, + animType: "move", + }, + ampX: { + active: true, + val1: 0.0, + val2: 0.3, + chaosFactor: 0.03, + animType: "syncChaoticOscillation", + loopDuration: 2000, + }, + ampY: { + active: true, + val1: 0.0, + val2: 0.3, + chaosFactor: 0.04, + animType: "syncChaoticOscillation", + loopDuration: 1650, + }, + alphaChr: { + active: true, + animType: "randomNumberPerLoop", + val1: 0.0, + val2: 1, + loopDuration: 250, + }, + alphaImg: { + active: true, + animType: "randomNumberPerLoop", + val1: 0.8, + val2: 1, + loopDuration: 250, + }, + nbImage: { + active: true, + val1: 1, + val2: 9, + animType: "syncSinOscillation", + loopDuration: 1400, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "chaos-images"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "images", + filterId: "spectral-images", + time: 0, + blend: 4, + nbImage: 4, + padding: 100, + alphaImg: 0.5, + alphaChr: 0.0, + ampX: 0.1, + ampY: 0.1, + animated: { + time: { + speed: 0.001, + animType: "move", + }, + ampX: { + val1: 0, + val2: 0.22, + animType: "syncCosOscillation", + loopDuration: 2500, + }, + ampY: { + val1: 0, + val2: 0.24, + animType: "syncCosOscillation", + loopDuration: 2500, + pauseBetweenDuration: 2500, + }, + alphaChr: { + val1: 1, + val2: 0, + animType: "syncCosOscillation", + loopDuration: 2500, + }, + alphaImg: { + val1: 0.2, + val2: 0.8, + animType: "syncSinOscillation", + loopDuration: 2500, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "spectral-images"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "hexa-field", + shieldType: 2, + gridPadding: 1.5, + color: 0xcc00cc, + time: 0, + blend: 3, + intensity: 1, + lightAlpha: 0.5, + lightSize: 0.5, + scale: 1, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "hexa-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "fire-field", + shieldType: 1, + gridPadding: 2, + color: 0xe58550, + time: 0, + blend: 2, + intensity: 1.15, + lightAlpha: 2, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "fire-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "smoke-field", + shieldType: 3, + gridPadding: 1.5, + color: 0x60cc70, + time: 0, + blend: 2, + intensity: 0.9, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "smoke-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "earth-field", + shieldType: 4, + gridPadding: 2, + color: 0xbb9070, + time: 0, + blend: 1, + intensity: 1.25, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "earth-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "earth-field-top", + shieldType: 5, + gridPadding: 3, + color: 0xaaaaaa, + time: 0, + blend: 5, + intensity: 1.9, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + zIndex: 5, + chromatic: true, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "earth-field-top"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "air-field", + shieldType: 6, + gridPadding: 1.2, + color: 0x7090aa, + time: 0, + blend: 14, + intensity: 1, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "air-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "magic-field", + shieldType: 7, + gridPadding: 1, + color: 0xffffff, + time: 0, + blend: 10, + intensity: 0.8, + lightAlpha: 1, + lightSize: 0.45, + scale: 1, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "magic-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "chromatic-field", + shieldType: 8, + gridPadding: 2, + color: 0xaaaaaa, + time: 0, + blend: 0, + intensity: 1, + lightAlpha: 0, + lightSize: 0, + scale: 1, + radius: 1, + chromatic: true, + animated: { + time: { + active: true, + speed: 0.0045, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "chromatic-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "water-field", + shieldType: 9, + gridPadding: 1.2, + color: 0x20bbee, + time: 0, + blend: 4, + intensity: 1, + lightAlpha: 0.7, + lightSize: 0.5, + scale: 0.6, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "water-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "evil-field", + shieldType: 9, + gridPadding: 2, + color: 0xff3010, + time: 0, + blend: 5, + intensity: 1, + lightAlpha: 4, + lightSize: 0.8, + scale: 0.5, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0012, + animType: "move", + }, + lightSize: { + val1: 0.4, + val2: 1.5, + animType: "syncCosOscillation", + loopDuration: 5000, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "evil-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "grid-field", + shieldType: 11, + gridPadding: 2, + color: 0x00cccc, + time: 0, + blend: 2, + intensity: 1, + lightAlpha: 1, + lightSize: 0.3, + scale: 0.5, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0009, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "grid-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "warp-field", + shieldType: 12, + gridPadding: 2, + color: 0xffffff, + time: 0, + blend: 2, + intensity: 1, + lightAlpha: 0.8, + lightSize: 0.5, + scale: 0.9, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0009, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "warp-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "field", + filterId: "color-field", + shieldType: 13, + gridPadding: 2, + color: 0x00cc00, + time: 0, + blend: 14, + intensity: 1, + lightAlpha: 0, + lightSize: 0, + scale: 1, + radius: 1, + chromatic: false, + animated: { + time: { + active: true, + speed: 0.0009, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "color-field"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "xray", + filterId: "sunburst", + time: 0, + color: 0xffbb00, + blend: 9, + dimX: 1, + dimY: 1, + anchorX: 0, + anchorY: 0, + divisor: 36, + intensity: 4, + animated: { + time: { + active: true, + speed: 0.0012, + animType: "move", + }, + anchorX: { + animType: "syncCosOscillation", + loopDuration: 6000, + val1: 0.4, + val2: 0.6, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "sunburst"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "xray", + filterId: "clover", + time: 0, + color: 0x00ff00, + blend: 9, + dimX: 0.05, + dimY: 0.05, + anchorX: 0.5, + anchorY: 0.5, + divisor: 4, + intensity: 1, + animated: { + time: { + active: true, + speed: 0.0012, + animType: "move", + }, + anchorX: { + animType: "syncCosOscillation", + loopDuration: 6000, + val1: 0.4, + val2: 0.6, + }, + anchorY: { + animType: "syncSinOscillation", + loopDuration: 6000, + val1: 0.4, + val2: 0.6, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "clover"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "xray", + filterId: "scan", + time: 0, + color: 0xffffff, + blend: 5, + dimX: 20, + dimY: 20, + anchorX: 0.5, + anchorY: 0, + divisor: 8, + intensity: 1, + animated: { + time: { + active: true, + speed: 0.0005, + animType: "move", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "scan"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "xray", + filterId: "blue-rays", + time: 0, + color: 0x1030ff, + blend: 9, + dimX: 1, + dimY: 1, + anchorX: 0, + anchorY: 0, + divisor: 24, + intensity: 1, + animated: { + time: { + active: true, + speed: 0.0002, + animType: "move", + }, + anchorX: { + animType: "syncCosOscillation", + loopDuration: 18000, + val1: 0.05, + val2: 0.95, + }, + anchorY: { + animType: "syncSinOscillation", + loopDuration: 18000, + val1: 0.05, + val2: 0.95, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "blue-rays"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "liquid", + filterId: "spectral-body", + color: 0x20aaee, + time: 0, + blend: 8, + intensity: 4, + spectral: true, + scale: 0.9, + animated: { + time: { + active: true, + speed: 0.001, + animType: "move", + }, + color: { + active: true, + loopDuration: 6000, + animType: "colorOscillation", + val1: 0xffffff, + val2: 0x00aaff, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "spectral-body"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "liquid", + filterId: "mantle-of-madness", + color: 0x0090ff, + time: 0, + blend: 5, + intensity: 0.0001, + spectral: false, + scale: 7, + animated: { + time: { + active: true, + speed: 0.0015, + animType: "move", + }, + intensity: { + active: true, + animType: "syncCosOscillation", + loopDuration: 30000, + val1: 0.0001, + val2: 4, + }, + scale: { + active: true, + animType: "syncCosOscillation", + loopDuration: 30000, + val1: 7, + val2: 1, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "mantle-of-madness"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "wave", + filterId: "drift-in-plans", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.035, + frequency: 80, + color: 0xffffff, + maxIntensity: 1.5, + minIntensity: 0.5, + padding: 10, + animated: { + time: { + active: true, + speed: 0.0085, + animType: "move", + }, + anchorX: { + active: true, + val1: 0.35, + val2: 0.65, + animType: "syncCosOscillation", + loopDuration: 10000, + }, + anchorY: { + active: true, + val1: 0.35, + val2: 0.65, + animType: "syncSinOscillation", + loopDuration: 10000, + }, + }, + }, + { + filterType: "liquid", + filterId: "drift-in-plans", + color: 0xff0000, + time: 0, + blend: 6, + intensity: 5, + spectral: false, + scale: 2.5, + animated: { + time: { + active: true, + speed: 0.0018, + animType: "move", + }, + color: { + active: true, + loopDuration: 9000, + animType: "colorOscillation", + val1: 0xff0000, + val2: 0xffffff, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "drift-in-plans"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "zapshadow", + filterId: "fire-aura", + alphaTolerance: 0.5, + }, + { + filterType: "xglow", + filterId: "fire-aura", + auraType: 2, + color: 0x903010, + thickness: 9.8, + scale: 4, + time: 0, + auraIntensity: 2, + subAuraIntensity: 1.5, + threshold: 0.4, + discard: true, + animated: { + time: { + active: true, + speed: 0.0027, + animType: "move", + }, + thickness: { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 2, + val2: 5, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "fire-aura"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "zapshadow", + filterId: "glacial-aura", + alphaTolerance: 0.5, + }, + { + filterType: "xglow", + filterId: "glacial-aura", + auraType: 1, + color: 0x5099dd, + thickness: 4.5, + scale: 3, + time: 0, + auraIntensity: 0.8, + subAuraIntensity: 0.25, + threshold: 0.5, + discard: false, + animated: { + time: { + active: true, + speed: 0.0018, + animType: "move", + }, + thickness: { + val1: 2, + val2: 4.7, + animType: "cosOscillation", + loopDuration: 3000, + }, + subAuraIntensity: { + val1: 0.45, + val2: 0.65, + animType: "cosOscillation", + loopDuration: 6000, + }, + auraIntensity: { + val1: 0.9, + val2: 2.2, + animType: "cosOscillation", + loopDuration: 3000, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "glacial-aura"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "zapshadow", + filterId: "anti-aura", + alphaTolerance: 0.5, + }, + { + filterType: "xglow", + filterId: "anti-aura", + auraType: 2, + color: 0x050505, + thickness: 2.7, + scale: 7, + time: 0, + auraIntensity: 5, + subAuraIntensity: 2, + threshold: 0.08, + discard: false, + animated: { + time: { + active: true, + speed: 0.0012, + animType: "move", + }, + auraIntensity: { + active: true, + loopDuration: 3000, + animType: "syncCosOscillation", + val1: 5, + val2: 0, + }, + subAuraIntensity: { + active: true, + loopDuration: 3000, + animType: "syncCosOscillation", + val1: 2, + val2: 0, + }, + color: { + active: true, + loopDuration: 6000, + animType: "syncColorOscillation", + val1: 0x050505, + val2: 0x200000, + }, + threshold: { + active: true, + loopDuration: 1500, + animType: "syncCosOscillation", + val1: 0.02, + val2: 0.5, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "anti-aura"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "fire", + filterId: "pure-fire-aura", + intensity: 1, + color: 0xffffff, + amplitude: 1, + time: 0, + blend: 2, + fireBlend: 1, + animated: { + time: { + active: true, + speed: -0.0024, + animType: "move", + }, + intensity: { + active: true, + loopDuration: 15000, + val1: 0.8, + val2: 2, + animType: "syncCosOscillation", + }, + amplitude: { + active: true, + loopDuration: 4400, + val1: 1, + val2: 1.4, + animType: "syncCosOscillation", + }, + }, + }, + { + filterType: "zapshadow", + filterId: "pure-fire-aura", + alphaTolerance: 0.5, + }, + { + filterType: "xglow", + filterId: "pure-fire-aura", + auraType: 2, + color: 0x903010, + thickness: 9.8, + scale: 4, + time: 0, + auraIntensity: 2, + subAuraIntensity: 1.5, + threshold: 0.4, + discard: true, + animated: { + time: { + active: true, + speed: 0.0027, + animType: "move", + }, + thickness: { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 2, + val2: 5, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "pure-fire-aura"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "zapshadow", + filterId: "pure-fire-aura-2", + alphaTolerance: 0.5, + }, + { + filterType: "xglow", + filterId: "pure-fire-aura-2", + auraType: 2, + color: 0x903010, + thickness: 9.8, + scale: 4, + time: 0, + auraIntensity: 1, + subAuraIntensity: 0.3, + threshold: 0.5, + discard: true, + animated: { + time: { + active: true, + speed: 0.0027, + animType: "move", + }, + thickness: { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 2, + val2: 3.6, + }, + }, + }, + { + filterType: "fire", + filterId: "pure-fire-aura-2", + intensity: 1, + color: 0xffffff, + amplitude: 1, + time: 0, + blend: 2, + fireBlend: 1, + animated: { + time: { + active: true, + speed: -0.0024, + animType: "move", + }, + intensity: { + active: true, + loopDuration: 15000, + val1: 0.8, + val2: 3, + animType: "syncCosOscillation", + }, + amplitude: { + active: true, + loopDuration: 4400, + val1: 1, + val2: 1.6, + animType: "syncCosOscillation", + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "pure-fire-aura-2"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "zapshadow", + filterId: "pure-ice-aura", + alphaTolerance: 0.5, + }, + { + filterType: "xglow", + filterId: "pure-ice-aura", + auraType: 1, + color: 0x5099dd, + thickness: 4.5, + scale: 10, + time: 0, + auraIntensity: 0.25, + subAuraIntensity: 1, + threshold: 0.5, + discard: false, + animated: { + time: { + active: true, + speed: 0.0018, + animType: "move", + }, + thickness: { + val1: 2, + val2: 3.3, + animType: "cosOscillation", + loopDuration: 3000, + }, + subAuraIntensity: { + val1: 0.45, + val2: 0.65, + animType: "cosOscillation", + loopDuration: 6000, + }, + auraIntensity: { + val1: 0.9, + val2: 2.2, + animType: "cosOscillation", + loopDuration: 3000, + }, + }, + }, + { + filterType: "smoke", + filterId: "pure-ice-aura", + color: 0x80ccff, + time: 0, + blend: 2, + dimX: 0.3, + dimY: 1, + animated: { + time: { + active: true, + speed: -0.006, + animType: "move", + }, + dimX: { + val1: 0.4, + val2: 0.2, + animType: "cosOscillation", + loopDuration: 3000, + }, + }, + }, +]; + +presetObject = new Object(); +presetObject.name = "pure-ice-aura"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +params = [ + { + filterType: "pixel", + filterId: "pixelate", + sizeX: 2.5, + sizeY: 2.5, + }, +]; + +presetObject = new Object(); +presetObject.name = "pixelate"; +presetObject.library = PresetsLibrary.MAIN; +presetObject.params = params; +presets.push(presetObject); + +export var templatePresets = []; + +// white : **electric , **waves, ***xrays, **liquid (normal), (clover) +// black : **liquid (protoplasm), **smoke, **rays, outline, **fumes, **fog, **flood, **fire +// no texture : **glow, **bulge, **blur, **bloom + +params = [ + { + filterType: "flood", + filterId: "Watery Surface", + time: 0, + color: 0x0020bb, + billowy: 0.43, + tintIntensity: 0.72, + glint: 0.31, + scale: 70, + padding: 10, + animated: { + time: { + active: true, + speed: 0.0006, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Watery Surface"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "liquid", + filterId: "Protoplasm", + color: 0x20aaee, + time: 0, + blend: 8, + intensity: 4, + spectral: true, + scale: 1.4, + animated: { + time: { + active: true, + speed: 0.001, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Protoplasm"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "liquid", + filterId: "Watery Surface 2", + color: 0x20aaee, + time: 0, + blend: 8, + intensity: 4, + spectral: false, + scale: 1.4, + animated: { + time: { + active: true, + speed: 0.001, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Watery Surface 2"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "smoke", + filterId: "Smoky Area", + color: 0xaaaaaa, + time: 0, + blend: 2, + dimX: 1, + dimY: 1, + animated: { + time: { + active: true, + speed: 0.002, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Smoky Area"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "electric", + filterId: "Shock", + color: 0xffffff, + time: 0, + blend: 1, + intensity: 5, + animated: { + time: { + active: true, + speed: 0.002, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Shock"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "xray", + filterId: "Annihilating Rays", + time: 0, + color: 0xffbb00, + blend: 9, + dimX: 1, + dimY: 1, + anchorX: 0, + anchorY: 0, + divisor: 6, + intensity: 4, + animated: { + time: { + active: true, + speed: 0.0012, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Annihilating Rays"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "ray", + filterId: "Classic Rays", + time: 0, + color: 0xcf8000, + alpha: 0.5, + divisor: 32, + anchorX: 0, + anchorY: 0, + animated: { + time: { + active: true, + speed: 0.0005, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Classic Rays"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "fumes", + filterId: "Smoke Filaments", + color: 0x808080, + time: 0, + blend: 8, + animated: { + time: { + active: true, + speed: 0.001, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Smoke Filaments"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "fire", + filterId: "Flames", + intensity: 1.5, + color: 0xffffff, + amplitude: 1.3, + time: 0, + blend: 2, + fireBlend: 1, + animated: { + time: { + active: true, + speed: -0.0016, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Flames"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "xfog", + filterId: "Thick Fog", + autoFit: false, + color: 0x3090ff, + time: 0, + animated: { + time: { + active: true, + speed: 0.0006, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Thick Fog"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-vstrong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "glow", + filterId: "Glowing Outline", + outerStrength: 5.5, + innerStrength: 0, + color: 0x006000, + quality: 0.5, + padding: 10, + animated: { + outerStrength: { + active: true, + loopDuration: 3000, + animType: "syncCosOscillation", + val1: 5.5, + val2: 1.5, + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Glowing Outline"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "wave", + filterId: "Waves", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.015, + frequency: 120, + color: 0xffffff, + maxIntensity: 2.5, + minIntensity: 0.9, + padding: 10, + animated: { + time: { + active: true, + speed: 0.0085, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Waves"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "wave", + filterId: "Waves 2", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.014, + frequency: 400, + color: 0xffffff, + maxIntensity: 2.4, + minIntensity: 0.8, + padding: 10, + animated: { + time: { + active: true, + speed: 0.0385, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Waves 2"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "wave", + filterId: "Waves 3", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.017, + frequency: 35, + color: 0xffffff, + maxIntensity: 2.6, + minIntensity: 0.9, + padding: 20, + animated: { + time: { + active: true, + speed: 0.0085, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Waves 3"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "xglow", + filterId: "Zone : Fire", + auraType: 1, + color: 0x903010, + scale: 1.5, + time: 0, + auraIntensity: 1.8, + subAuraIntensity: 0.25, + threshold: 0.6, + discard: false, + animated: { + time: { + active: true, + speed: 0.0027, + animType: "move", + }, + thickness: { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 2, + val2: 5, + }, + }, + }, + { + filterType: "fire", + filterId: "Zone : Fire", + intensity: 1.5, + color: 0xffffff, + amplitude: 1, + time: 0, + blend: 2, + fireBlend: 1, + animated: { + time: { + active: true, + speed: -0.0015, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Zone : Fire"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "xglow", + filterId: "Zone : Electricity", + auraType: 2, + color: 0x303030, + scale: 1.5, + time: 0, + auraIntensity: 1, + subAuraIntensity: 0.9, + threshold: 0, + discard: true, + animated: { + time: { + active: true, + speed: 0.0027, + animType: "move", + }, + thickness: { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 1, + val2: 2, + }, + }, + }, + { + filterType: "electric", + filterId: "Zone : Electricity", + color: 0xffffff, + time: 0, + blend: 1, + intensity: 5, + animated: { + time: { + active: true, + speed: 0.002, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Zone : Electricity"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/white-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "xglow", + filterId: "Zone : Blizzard", + auraType: 1, + color: 0x5099dd, + thickness: 4.5, + scale: 5, + time: 0, + auraIntensity: 0.25, + subAuraIntensity: 1, + threshold: 0.5, + discard: false, + animated: { + time: { + active: true, + speed: 0.0018, + animType: "move", + }, + thickness: { + val1: 2, + val2: 3.3, + animType: "cosOscillation", + loopDuration: 3000, + }, + subAuraIntensity: { + val1: 0.05, + val2: 0.1, + animType: "cosOscillation", + loopDuration: 6000, + }, + auraIntensity: { + val1: 0.9, + val2: 2.2, + animType: "cosOscillation", + loopDuration: 3000, + }, + }, + }, + { + filterType: "smoke", + filterId: "Zone : Blizzard", + color: 0x80ccff, + time: 0, + blend: 2, + dimY: 1, + animated: { + time: { + active: true, + speed: -0.005, + animType: "move", + }, + dimX: { + val1: 0.4, + val2: 0.2, + animType: "cosOscillation", + loopDuration: 3000, + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Zone : Blizzard"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "bulgepinch", + filterId: "Bulging Out", + padding: 150, + strength: 0, + radiusPercent: 200, + animated: { + strength: { + active: true, + animType: "cosOscillation", + loopDuration: 2000, + val1: 0, + val2: 0.45, + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Bulging Out"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "blur", + filterId: "Blurred Texture", + padding: 25, + quality: 4.0, + blur: 0, + blurX: 0, + blurY: 0, + animated: { + blurX: { + active: true, + animType: "syncCosOscillation", + loopDuration: 500, + val1: 0, + val2: 6, + }, + blurY: { + active: true, + animType: "syncCosOscillation", + loopDuration: 750, + val1: 0, + val2: 6, + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Blurred Texture"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "xbloom", + filterId: "Bloomed Texture", + threshold: 0.35, + bloomScale: 0, + brightness: 1, + blur: 0.1, + padding: 10, + quality: 15, + blendMode: 0, + animated: { + bloomScale: { + active: true, + loopDuration: 2000, + animType: "syncCosOscillation", + val1: 0, + val2: 2.1, + }, + threshold: { + active: false, + loopDuration: 1000, + animType: "syncCosOscillation", + val1: 0.0, + val2: 1.9, + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Bloomed Texture"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "liquid", + filterId: "Wild Magic", + color: 0xff0000, + time: 0, + blend: 6, + intensity: 5, + spectral: false, + scale: 2.5, + animated: { + time: { + active: true, + speed: 0.0018, + animType: "move", + }, + }, + }, + { + filterType: "wave", + filterId: "Wild Magic", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.014, + frequency: 10, + color: 0xffffff, + maxIntensity: 1.3, + minIntensity: 0.6, + padding: 10, + animated: { + time: { + active: true, + speed: 0.0065, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Wild Magic"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "web", + filterId: "Spider Web 1", + anchorX: 0.5, + anchorY: 0.5, + color: 0xffffff, + thickness: 2, + div2: 5, + time: 98.8, + animated: { + time: { + active: true, + loopDuration: 5000, + animType: "cosOscillation", + val1: 98.8, + val2: 99.7, + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Spider Web 1"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "web", + filterId: "Spider Web 2", + anchorX: 0.5, + anchorY: 0.5, + color: 0xcccccc, + animated: { + time: { + active: true, + speed: 0.0005, + animType: "move", + }, + }, + }, + { + filterType: "liquid", + filterId: "Spider Web 2", + color: 0xff0000, + time: 0, + blend: 4, + intensity: 8, + spectral: false, + scale: 0.2, + animated: { + time: { + active: true, + speed: 0.0005, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Spider Web 2"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +params = [ + { + filterType: "web", + filterId: "Spider Web 3", + anchorX: 0.5, + anchorY: 0.5, + color: 0xcccccc, + time: 100, + }, + { + filterType: "liquid", + filterId: "Spider Web 3", + color: 0xff0000, + time: 0, + blend: 1, + intensity: 4, + spectral: true, + scale: 0.2, + animated: { + time: { + active: true, + speed: 0.0005, + animType: "move", + }, + }, + }, +]; + +presetObject = {}; +presetObject.name = "Spider Web 3"; +presetObject.library = PresetsLibrary.TEMPLATE; +presetObject.defaultTexture = "modules/tokenmagic/fx/assets/templates/black-tone-strong-opacity.png"; +presetObject.params = params; +templatePresets.push(presetObject); + +export var allPresets = presets.concat(templatePresets); diff --git a/tokenmagic/gui/icons/simple-gui-macro.svg b/src/gui/icons/simple-gui-macro.svg similarity index 100% rename from tokenmagic/gui/icons/simple-gui-macro.svg rename to src/gui/icons/simple-gui-macro.svg diff --git a/tokenmagic/gui/macros/SImpleGUIMacro.js b/src/gui/macros/SImpleGUIMacro.js similarity index 54% rename from tokenmagic/gui/macros/SImpleGUIMacro.js rename to src/gui/macros/SImpleGUIMacro.js index c4d2c19..a18e434 100644 --- a/tokenmagic/gui/macros/SImpleGUIMacro.js +++ b/src/gui/macros/SImpleGUIMacro.js @@ -3,10 +3,10 @@ // You can create your own compendium, and put any effects in it // Just change MyCompendium below with your custom compendium -const MyCompendium = 'TokenMagic Book of Fire'; +const MyCompendium = "TokenMagic Book of Fire"; // ------------------------ -const macroVersion = 'v0.2.1'; +const macroVersion = "v0.2.1"; /* Simple GUI - Token Magic Author : brunocalado @@ -19,17 +19,17 @@ Icon: let filterType; (async () => { - let msgtoken = ``; - if (canvas.tokens.controlled != 0 || canvas.background.controlled[0]) { - filterType = 'selected'; - } else if (game.user.targets.size != 0) { - filterType = 'targeted'; - } else { - ui.notifications.error('Select something!'); - return; - } - - let template = `\n \n
\n \n \n
\n \n \n\n \n `;\n\n new Dialog({\n title: `TMFX GUI - ${macroVersion}`,\n content: template,\n buttons: {\n yes: {\n icon: \"\",\n label: \"Apply\",\n callback: () => {}\n },\n clear: {\n icon: \"\",\n label: \"Clear\",\n callback: async (html) => {\n removeOnSelected(html);\n }\n }\n },\n default: \"yes\",\n close: html => {\n }\n }, { id: 'tokenmagic-quickpreview' }).render(true);\n //} ).render(true); \n})()\n\n// ==============================\n// Main\n// ==============================\n\n\n// ==============================\n// Common Functions \n// ==============================\nasync function removeOnSelected() {\n await TokenMagic.deleteFilters(_token);\n await TokenMagic.deleteFiltersOnSelected(); // Delete all filters on the selected tokens/tiles\n}\n\nasync function loadMacroButton() {\n const list_compendium = await game.packs.filter(p => p.metadata.type == 'Macro');\n const inside = await list_compendium.filter(p => p.metadata.label == MyCompendium)[0].index.contents;\n let msg = ``;\n let tmp;\n let counter = 1;\n\n inside.map((el) => {\n tmp = el.name.split(' ').join('');\n msg += `
  • `;\n counter += 1;\n });\n\n return msg;\n}\n\nasync function loadMacros(filterType) {\n const pack = await game.packs.find(p => p.metadata.label == MyCompendium);\n const index = await pack.getIndex({fields: [\"name\", \"img\", \"command\"]});\n const inside = index.contents;\n let msg = ``;\n let tmp;\n let counter = 1;\n\n inside.map((el) => {\n let macro = el.command;\n if (filterType == 'selected') {\n macro = macro.replace(\"OnTargeted\", \"OnSelected\");\n } else {\n macro = macro.replace(\"OnSelected\", \"OnTargeted\");\n }\n tmp = el.name.split(' ').join('');\n msg += `async function effect${counter}() {`;\n msg += `await removeOnSelected();`;\n msg += `${macro}`;\n msg += `}`;\n counter += 1;\n });\n return msg;\n}\n\nfunction removeAll() {\n const clean = `async function removeOnSelected() {await TokenMagic.deleteFilters(_token);await TokenMagic.deleteFiltersOnSelected()}`;\n return clean;\n}", + "folder": null, + "sort": 9000000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!iQbTZfjc0y3vHYTB" +} diff --git a/src/packs/_source/tmMacros/00-d-tmfx-gui-toggle-presets.json b/src/packs/_source/tmMacros/00-d-tmfx-gui-toggle-presets.json new file mode 100644 index 0000000..ebee5e0 --- /dev/null +++ b/src/packs/_source/tmMacros/00-d-tmfx-gui-toggle-presets.json @@ -0,0 +1,24 @@ +{ + "name": "00 - D - TMFX GUI - Toggle Presets", + "type": "script", + "scope": "global", + "author": "cDfy4cFieNjb5vsL", + "img": "icons/svg/book.svg", + "command": "// Search for and toggle presets on all selected placeables\n\nfunction togglePresetOnSelected(presetName) {\n const controlled = [...canvas.templates.controlled, ...canvas.tokens.controlled, ...canvas.drawings.controlled];\n for(const placeable of controlled) {\n if(TokenMagic.hasFilterId(placeable, presetName)) {\n TokenMagic.deleteFilters(placeable, presetName);\n } else {\n const preset = TokenMagic.getPreset(presetName);\n if(preset) {\n TokenMagic.addUpdateFilters(placeable, preset);\n }\n }\n }\n}\n\nlet content = ``;\n\nlet list = '';\n\ncontent += list;\n \nlet styles = `\n\n`;\n\ncontent = styles + content;\n \n new Dialog({\n title: `TMFX GUI - Toggle Presets`,\n content,\n render: (html) => {\n // Filtering\n html.find('.search').on('input', () => {\n const filter = html.find('.search').val().trim().toLowerCase()\n html.find('.preset-list li').each(function () {\n const li = $(this);\n if(li.find('a').text().toLowerCase().includes(filter)) {\n li.show();\n } else {\n li.hide();\n }\n });\n });\n // Toggling\n html.find('.preset-list li').on('click', (event) => {\n const presetName = $(event.target).closest('li').find('a').text();\n togglePresetOnSelected(presetName);\n });\n // Deleting\n html.find('.delete').on('click', ()=> {\n TokenMagic.deleteFiltersOnSelected();\n });\n } ,\n buttons: {\n close: {\n icon: \"\",\n label: \"Close\",\n callback: () => {}\n },\n },\n default: \"close\",\n close: html => {\n }\n }, { id: 'tokenmagic-toggle-preset' }).render(true);", + "folder": null, + "ownership": { + "default": 0 + }, + "flags": {}, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1695323062735, + "modifiedTime": 1695399597925, + "lastModifiedBy": "packsbuilder0000" + }, + "_id": "y1VbGayfVRU7eqGi", + "sort": 0, + "_key": "!macros!y1VbGayfVRU7eqGi" +} diff --git a/src/packs/_source/tmMacros/01-bevel.json b/src/packs/_source/tmMacros/01-bevel.json new file mode 100644 index 0000000..bde5e81 --- /dev/null +++ b/src/packs/_source/tmMacros/01-bevel.json @@ -0,0 +1,24 @@ +{ + "_id": "GvYp56Thtf3n9RYy", + "name": "01 - Bevel", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/01%20-%20Bevel.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"bevel\",\n filterId: \"myBevel\",\n rotation: 0,\n thickness: 5,\n lightColor: 0xFF0000,\n lightAlpha: 0.8,\n shadowColor: 0x00FF00,\n shadowAlpha: 0.5,\n animated :\n {\n rotation: \n { \n active: true,\n clockWise: true, \n loopDuration: 1600, \n animType: \"syncRotation\"\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!GvYp56Thtf3n9RYy" +} diff --git a/src/packs/_source/tmMacros/02-adjustment.json b/src/packs/_source/tmMacros/02-adjustment.json new file mode 100644 index 0000000..e90805c --- /dev/null +++ b/src/packs/_source/tmMacros/02-adjustment.json @@ -0,0 +1,24 @@ +{ + "_id": "VWTz2fKfSb6WK7Mo", + "name": "02 - Adjustment", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/02%20-%20Adjustment.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"adjustment\",\n filterId: \"myAdjust\",\n saturation: 1,\n brightness: 1,\n contrast: 1,\n gamma: 1,\n red: 0.2,\n green: 0.2,\n blue: 0.2,\n alpha: 1,\n animated:\n {\n alpha: \n { \n active: true, \n loopDuration: 2000, \n animType: \"syncCosOscillation\",\n val1: 0.35,\n val2: 0.75 }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6500000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!VWTz2fKfSb6WK7Mo" +} diff --git a/src/packs/_source/tmMacros/03-drop-shadow.json b/src/packs/_source/tmMacros/03-drop-shadow.json new file mode 100644 index 0000000..a8d2731 --- /dev/null +++ b/src/packs/_source/tmMacros/03-drop-shadow.json @@ -0,0 +1,24 @@ +{ + "_id": "hayiRem3LXoEP3tL", + "name": "03 - Drop Shadow", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/03%20-%20Drop%20Shadow.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"shadow\",\n filterId: \"myShadow\",\n rotation: 35,\n blur: 2,\n quality: 5,\n distance: 20,\n alpha: 0.7,\n padding: 10,\n shadowOnly: false,\n color: 0x000000,\n zOrder: 6000,\n animated:\n {\n blur: \n { \n active: true, \n loopDuration: 500, \n animType: \"syncCosOscillation\", \n val1: 2, \n val2: 4\n },\n rotation:\n {\n active: true,\n loopDuration: 100,\n animType: \"syncSinOscillation\",\n val1: 33,\n val2: 37\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8900000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!hayiRem3LXoEP3tL" +} diff --git a/src/packs/_source/tmMacros/04-outline.json b/src/packs/_source/tmMacros/04-outline.json new file mode 100644 index 0000000..a886da5 --- /dev/null +++ b/src/packs/_source/tmMacros/04-outline.json @@ -0,0 +1,31 @@ +{ + "_id": "b5Enw7tEwfjDNHuY", + "name": "04 - Outline", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/04%20-%20Outline.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"outline\",\n filterId: \"myOutline\",\n padding: 10,\n color: 0xEE6035,\n thickness: 1,\n quality: 5,\n zOrder: 9,\n animated :\n {\n thickness: \n { \n active: true,\n loopDuration: 800,\n animType: \"syncCosOscillation\",\n val1: 1, \n val2: 6\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7400000, + "flags": { + "combat-utility-belt": { + "macroTrigger": "" + }, + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!b5Enw7tEwfjDNHuY" +} diff --git a/src/packs/_source/tmMacros/05-glow.json b/src/packs/_source/tmMacros/05-glow.json new file mode 100644 index 0000000..f140190 --- /dev/null +++ b/src/packs/_source/tmMacros/05-glow.json @@ -0,0 +1,28 @@ +{ + "_id": "g7O4u4dTaWcnajW7", + "name": "05 - Glow", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/05%20-%20Glow.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"glow\",\n filterId: \"superSpookyGlow\",\n outerStrength: 4,\n innerStrength: 0,\n color: 0x5099DD,\n quality: 0.5,\n padding: 10,\n animated:\n {\n color: \n {\n active: true, \n loopDuration: 3000, \n animType: \"colorOscillation\", \n val1:0x5099DD, \n val2:0x90EEFF\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8600000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!g7O4u4dTaWcnajW7" +} diff --git a/src/packs/_source/tmMacros/06-bloom.json b/src/packs/_source/tmMacros/06-bloom.json new file mode 100644 index 0000000..e91ab6b --- /dev/null +++ b/src/packs/_source/tmMacros/06-bloom.json @@ -0,0 +1,24 @@ +{ + "_id": "cCEOQFsJvjhSTbbM", + "name": "06 - Bloom", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/06%20-%20Bloom.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"xbloom\",\n filterId: \"letsShine\",\n threshold: 0.35,\n bloomScale: 0,\n brightness: 1,\n blur: 0.1,\n padding: 10,\n quality: 15,\n blendMode: 0,\n animated:\n {\n bloomScale: \n { \n active: true, \n loopDuration: 2000, \n animType: \"syncCosOscillation\", \n val1: 0, \n val2: 2.1\n },\n threshold: \n { \n active: false, \n loopDuration: 1000, \n animType: \"syncCosOscillation\", \n val1: 0.00, \n val2: 1.90\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!cCEOQFsJvjhSTbbM" +} diff --git a/src/packs/_source/tmMacros/07-distortion.json b/src/packs/_source/tmMacros/07-distortion.json new file mode 100644 index 0000000..a0e1562 --- /dev/null +++ b/src/packs/_source/tmMacros/07-distortion.json @@ -0,0 +1,24 @@ +{ + "_id": "yHYwADWdYDAMTuCR", + "name": "07 - Distortion", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/07%20-%20Distortion.webp", + "scope": "global", + "command": "// you can change the mask of the filter\n// the mask must have a power of 2 h and w (512x512, 128x128, ...) \n// the distortion applies on black and white and shades of grey\n// after testing the first version of this macro try this :\n// -> maskPath: \"modules/tokenmagic/fx/assets/waves-2.png\"\n\nlet params =\n[{\n filterType: \"distortion\",\n filterId: \"myDistortion\",\n maskPath: \"modules/tokenmagic/fx/assets/distortion-1.png\",\n maskSpriteScaleX: 5,\n maskSpriteScaleY: 5,\n padding: 20,\n animated:\n {\n maskSpriteX: { active: true, speed: 0.05, animType: \"move\" },\n maskSpriteY: { active: true, speed: 0.07, animType: \"move\" }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 11400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!yHYwADWdYDAMTuCR" +} diff --git a/src/packs/_source/tmMacros/08-old-film.json b/src/packs/_source/tmMacros/08-old-film.json new file mode 100644 index 0000000..6ccc413 --- /dev/null +++ b/src/packs/_source/tmMacros/08-old-film.json @@ -0,0 +1,24 @@ +{ + "_id": "lH53KTce3zYEFXos", + "name": "08 - Old film", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/08%20-%20Old%20film.webp", + "scope": "global", + "command": "// special : the OldFilm filter need an Outline filter to be contained (or else, it will affect all the container)\nlet params =\n[{\n filterType: \"oldfilm\",\n filterId: \"myOldfilm\",\n sepia: 0.6,\n noise: 0.2,\n noiseSize: 1.0,\n scratch: 0.8,\n scratchDensity: 0.5,\n scratchWidth: 1.2,\n vignetting: 0.9,\n vignettingAlpha: 0.6,\n vignettingBlur: 0.2,\n animated:\n {\n seed: \n { \n active: true, \n animType: \"randomNumber\", \n val1: 0, \n val2: 1 \n },\n vignetting: \n { \n active: true, \n animType: \"syncCosOscillation\" , \n loopDuration: 2000, \n val1: 0.2, \n val2: 0.4 }\n }\n},\n{\n filterType: \"outline\",\n filterId: \"oldfilmOutline\",\n color: 0x000000,\n thickness: 0,\n zOrder: 61\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 9500000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!lH53KTce3zYEFXos" +} diff --git a/src/packs/_source/tmMacros/09-t01-twist-transform.json b/src/packs/_source/tmMacros/09-t01-twist-transform.json new file mode 100644 index 0000000..f440a09 --- /dev/null +++ b/src/packs/_source/tmMacros/09-t01-twist-transform.json @@ -0,0 +1,24 @@ +{ + "_id": "OWgJD9lvBlDzXALz", + "name": "09 - T01 - Twist (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/09%20-%20T01%20-%20Twist%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"myTwistTransform\",\n twRadiusPercent: 70,\n padding: 10,\n animated:\n {\n twRotation:\n {\n animType: \"sinOscillation\",\n val1: -90,\n val2: +90,\n loopDuration: 5000,\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 4800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!OWgJD9lvBlDzXALz" +} diff --git a/src/packs/_source/tmMacros/09-t02-moo-man-dance-transform.json b/src/packs/_source/tmMacros/09-t02-moo-man-dance-transform.json new file mode 100644 index 0000000..3bf1701 --- /dev/null +++ b/src/packs/_source/tmMacros/09-t02-moo-man-dance-transform.json @@ -0,0 +1,24 @@ +{ + "_id": "jFdKzkYqcKOmeQPW", + "name": "09 - T02 - Moo Man Dance (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/09%20-%20T02%20-%20Moo%20Man%20Dance%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"theMooManDance\",\n twRadiusPercent: 70,\n bpRadiusPercent: 90,\n padding: 50,\n animated:\n {\n twRotation:\n {\n animType: \"sinOscillation\",\n val1: -90,\n val2: +90,\n loopDuration: 1000,\n },\n bpStrength:\n {\n animType: \"cosOscillation\",\n val1: 0,\n val2: 0.55,\n loopDuration: 1000,\n },\n translationX:\n {\n animType: \"sinOscillation\",\n val1: -0.125,\n val2: +0.125,\n loopDuration: 1400,\n },\n translationY:\n {\n animType: \"cosOscillation\",\n val1: -0.125,\n val2: +0.125,\n loopDuration: 1400,\n },\n rotation:\n {\n animType: \"cosOscillation\",\n val1: 90,\n val2: -90,\n loopDuration: 4200,\n }, \n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 9100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!jFdKzkYqcKOmeQPW" +} diff --git a/src/packs/_source/tmMacros/10-t01-bulge-transform.json b/src/packs/_source/tmMacros/10-t01-bulge-transform.json new file mode 100644 index 0000000..15dd203 --- /dev/null +++ b/src/packs/_source/tmMacros/10-t01-bulge-transform.json @@ -0,0 +1,24 @@ +{ + "_id": "FBQzhLveCvFKOvJ7", + "name": "10 - T01 - Bulge (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/10%20-%20T01%20-%20Bulge%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"myBulgeTransform\",\n bpRadiusPercent: 70,\n padding: 100,\n animated:\n {\n bpStrength:\n {\n animType: \"cosOscillation\",\n val1: 0,\n val2: 0.65,\n loopDuration: 3500,\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!FBQzhLveCvFKOvJ7" +} diff --git a/src/packs/_source/tmMacros/10-t02-pinch-transform.json b/src/packs/_source/tmMacros/10-t02-pinch-transform.json new file mode 100644 index 0000000..488ab60 --- /dev/null +++ b/src/packs/_source/tmMacros/10-t02-pinch-transform.json @@ -0,0 +1,24 @@ +{ + "_id": "wT26Z1cjH4pFmtFO", + "name": "10 - T02 - Pinch (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/10%20-%20T02%20-%20Pinch%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"myPinchTransform\",\n bpRadiusPercent: 70,\n padding: 100,\n animated:\n {\n bpStrength:\n {\n animType: \"cosOscillation\",\n val1: 0,\n val2: -0.65,\n loopDuration: 3500,\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 11100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!wT26Z1cjH4pFmtFO" +} diff --git a/src/packs/_source/tmMacros/11-blur.json b/src/packs/_source/tmMacros/11-blur.json new file mode 100644 index 0000000..185f71b --- /dev/null +++ b/src/packs/_source/tmMacros/11-blur.json @@ -0,0 +1,24 @@ +{ + "_id": "CdFhWPKBMb5wj7cM", + "name": "11 - Blur", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/11%20-%20Blur.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"blur\",\n filterId: \"myBlur\",\n padding: 10,\n quality: 4.0,\n blur: 0,\n blurX: 0,\n blurY: 0,\n animated:\n {\n blurX: \n { \n active: true, \n animType: \"syncCosOscillation\", \n loopDuration: 500, \n val1: 0, \n val2: 6\n },\n blurY: \n { \n active: true, \n animType: \"syncCosOscillation\", \n loopDuration: 750, \n val1: 0, \n val2: 6}\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 2400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!CdFhWPKBMb5wj7cM" +} diff --git a/src/packs/_source/tmMacros/12-zoom-blur.json b/src/packs/_source/tmMacros/12-zoom-blur.json new file mode 100644 index 0000000..3e55954 --- /dev/null +++ b/src/packs/_source/tmMacros/12-zoom-blur.json @@ -0,0 +1,24 @@ +{ + "_id": "t2MjFs4cVUCYsbMr", + "name": "12 - Zoom Blur", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/12%20-%20Zoom%20Blur.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zoomblur\",\n filterId: \"myZoomBlur\",\n strength: 0.15,\n innerRadiusPercent: 65,\n radiusPercent: 100,\n padding: 30,\n animated:\n {\n innerRadiusPercent: \n { \n active: true, \n animType: \"sinOscillation\", \n loopDuration: 500, \n val1: 65, \n val2: 75\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 10400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!t2MjFs4cVUCYsbMr" +} diff --git a/src/packs/_source/tmMacros/13-shockwave-wave.json b/src/packs/_source/tmMacros/13-shockwave-wave.json new file mode 100644 index 0000000..9bc618d --- /dev/null +++ b/src/packs/_source/tmMacros/13-shockwave-wave.json @@ -0,0 +1,28 @@ +{ + "_id": "r3JzTibAUnlpgPsD", + "name": "13 - Shockwave (wave)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/13%20-%20Shockwave%20%28wave%29.webp", + "scope": "global", + "command": "// Below, you can turn on the anchor animation.\nlet params =\n[{\n filterType: \"wave\",\n filterId: \"myShockwave\",\n time: 0,\n strength: 0.03,\n frequency: 15,\n maxIntensity: 4.0,\n minIntensity: 0.5,\n padding:25,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0180,\n animType: \"move\",\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 9900000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!r3JzTibAUnlpgPsD" +} diff --git a/src/packs/_source/tmMacros/14-remove-shadow.json b/src/packs/_source/tmMacros/14-remove-shadow.json new file mode 100644 index 0000000..3ab4ccc --- /dev/null +++ b/src/packs/_source/tmMacros/14-remove-shadow.json @@ -0,0 +1,24 @@ +{ + "_id": "H3rF4XGEf76ZylwP", + "name": "14 - Remove Shadow", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/14%20-%20Remove%20Shadow.webp", + "scope": "global", + "command": "// this simple filter remove pixels with a certain amount of alpha\n// it can be useful to remove shadows before using glow or outline filters.\n\nlet params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myZap\",\n alphaTolerance: 0.45,\n rank: 2\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!H3rF4XGEf76ZylwP" +} diff --git a/src/packs/_source/tmMacros/15-cosmic-ray.json b/src/packs/_source/tmMacros/15-cosmic-ray.json new file mode 100644 index 0000000..0f5dc3b --- /dev/null +++ b/src/packs/_source/tmMacros/15-cosmic-ray.json @@ -0,0 +1,24 @@ +{ + "_id": "37aHASDQzFvbqmJG", + "name": "15 - Cosmic Ray", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/15%20-%20Cosmic%20Ray.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"ray\",\n filterId : \"myRay\",\n time: 0,\n color: 0xCF8000,\n alpha: 0.5,\n divisor: 32,\n anchorX: 0,\n anchorY: 0,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0005, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!37aHASDQzFvbqmJG" +} diff --git a/src/packs/_source/tmMacros/16-inner-fog.json b/src/packs/_source/tmMacros/16-inner-fog.json new file mode 100644 index 0000000..d372374 --- /dev/null +++ b/src/packs/_source/tmMacros/16-inner-fog.json @@ -0,0 +1,28 @@ +{ + "_id": "Edw0KaZiBtWEG86g", + "name": "16 - Inner Fog", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/16%20-%20Inner%20Fog.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fog\",\n filterId: \"myFog\",\n color: 0x000000,\n density: 0.65,\n time: 0,\n dimX: 1,\n dimY: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 2.2, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 2900000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Edw0KaZiBtWEG86g" +} diff --git a/src/packs/_source/tmMacros/17-fumes.json b/src/packs/_source/tmMacros/17-fumes.json new file mode 100644 index 0000000..107bc25 --- /dev/null +++ b/src/packs/_source/tmMacros/17-fumes.json @@ -0,0 +1,28 @@ +{ + "_id": "ebWbFeiJP8UZG4Fd", + "name": "17 - Fumes", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/17%20-%20Fumes.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fumes\",\n filterId: \"myFumes\",\n color: 0x808080,\n time: 0,\n blend: 8,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.001, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8200000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!ebWbFeiJP8UZG4Fd" +} diff --git a/src/packs/_source/tmMacros/18-electric.json b/src/packs/_source/tmMacros/18-electric.json new file mode 100644 index 0000000..9e65b4a --- /dev/null +++ b/src/packs/_source/tmMacros/18-electric.json @@ -0,0 +1,28 @@ +{ + "_id": "YJjeB7N0L1rGfZD2", + "name": "18 - Electric", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/18%20-%20Electric.webp", + "scope": "global", + "command": "// Because the shader is dynamically compiled,\n// intensity is a one time init and can't be updated.\n// you must delete the filters to \"change\" it.\nlet params =\n[{\n filterType: \"electric\",\n filterId: \"myElectric\",\n color: 0xFFFFFF,\n time: 0,\n blend: 1,\n intensity: 5,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0020, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7000000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!YJjeB7N0L1rGfZD2" +} diff --git a/src/packs/_source/tmMacros/19-t01-fire.json b/src/packs/_source/tmMacros/19-t01-fire.json new file mode 100644 index 0000000..9d8dd10 --- /dev/null +++ b/src/packs/_source/tmMacros/19-t01-fire.json @@ -0,0 +1,24 @@ +{ + "_id": "F47j6ivhmXxeYVmY", + "name": "19 - T01 - Fire", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/19%20-%20T01%20-%20Fire.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fire\",\n filterId: \"myFire\",\n intensity: 1,\n color: 0xFFFFFF,\n amplitude: 1,\n time: 0,\n blend: 2,\n fireBlend : 1,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n },\n intensity:\n {\n active:true,\n loopDuration: 15000,\n val1: 0.8,\n val2: 2,\n animType: \"syncCosOscillation\"\n },\n amplitude:\n {\n active:true,\n loopDuration: 4400,\n val1: 1,\n val2: 1.4,\n animType: \"syncCosOscillation\"\n }\n \n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!F47j6ivhmXxeYVmY" +} diff --git a/src/packs/_source/tmMacros/19-t02-devouring-fire.json b/src/packs/_source/tmMacros/19-t02-devouring-fire.json new file mode 100644 index 0000000..3f1a65d --- /dev/null +++ b/src/packs/_source/tmMacros/19-t02-devouring-fire.json @@ -0,0 +1,24 @@ +{ + "_id": "Gec6BaJMehMO7p7v", + "name": "19 - T02 - Devouring Fire", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/19%20-%20T02%20-%20Devouring%20Fire.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fire\",\n filterId: \"myFire\",\n intensity: 3,\n color: 0xFFFFFF,\n amplitude: 2,\n time: 0,\n blend: 10,\n fireBlend : 1,\n alphaDiscard: true,\n zOrder: 50,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n }\n }\n},{\n filterType: \"glow\",\n filterId: \"glowripples\",\n outerStrength: 4,\n innerStrength: 2,\n color: 0xAA6500,\n quality: 0.5,\n padding: 10,\n zOrder: 100,\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3500000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Gec6BaJMehMO7p7v" +} diff --git a/src/packs/_source/tmMacros/20-waves.json b/src/packs/_source/tmMacros/20-waves.json new file mode 100644 index 0000000..f302359 --- /dev/null +++ b/src/packs/_source/tmMacros/20-waves.json @@ -0,0 +1,24 @@ +{ + "_id": "DoXvYWKPRcTpHbPG", + "name": "20 - Waves", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/20%20-%20Waves.webp", + "scope": "global", + "command": "// Below, you can turn on the anchor animation.\nlet params =\n[{\n filterType: \"wave\",\n filterId: \"myWaves\",\n time: 0,\n anchorX: 0.5,\n anchorY: 0.5,\n strength: 0.015,\n frequency: 120,\n color: 0xFFFFFF,\n maxIntensity: 2.5,\n minIntensity: 0.9,\n padding:10,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0085, \n animType: \"move\" \n },\n anchorX :\n {\n active: false,\n val1: 0.15,\n val2: 0.85,\n animType: \"syncChaoticOscillation\",\n loopDuration: 20000\n },\n anchorY :\n {\n active: false,\n val1: 0.15,\n val2: 0.85,\n animType: \"syncSinOscillation\",\n loopDuration: 20000\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 2800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!DoXvYWKPRcTpHbPG" +} diff --git a/src/packs/_source/tmMacros/21-flood.json b/src/packs/_source/tmMacros/21-flood.json new file mode 100644 index 0000000..ffb9443 --- /dev/null +++ b/src/packs/_source/tmMacros/21-flood.json @@ -0,0 +1,24 @@ +{ + "_id": "zCCp4x0EResFji7O", + "name": "21 - Flood", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/21%20-%20Flood.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"flood\",\n filterId: \"myFlood\",\n time: 0,\n color: 0x0020BB,\n billowy: 0.43,\n tintIntensity: 0.72,\n glint: 0.31,\n scale: 70,\n padding: 10,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0006, \n animType: \"move\"\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 11800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!zCCp4x0EResFji7O" +} diff --git a/src/packs/_source/tmMacros/22-smoke.json b/src/packs/_source/tmMacros/22-smoke.json new file mode 100644 index 0000000..d9c5045 --- /dev/null +++ b/src/packs/_source/tmMacros/22-smoke.json @@ -0,0 +1,24 @@ +{ + "_id": "2zRNjnw7Ps26h5xz", + "name": "22 - Smoke", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/22%20-%20Smoke.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"smoke\",\n filterId: \"mySmoke\",\n color: 0x50FFAA,\n time: 0,\n blend: 2,\n dimX: 1,\n dimY: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\"\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!2zRNjnw7Ps26h5xz" +} diff --git a/src/packs/_source/tmMacros/23-t01-mirror-images.json b/src/packs/_source/tmMacros/23-t01-mirror-images.json new file mode 100644 index 0000000..6eb8fb8 --- /dev/null +++ b/src/packs/_source/tmMacros/23-t01-mirror-images.json @@ -0,0 +1,24 @@ +{ + "_id": "Ac6lTCiwnycb2Hbw", + "name": "23 - T01 - Mirror Images", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/23%20-%20T01%20-%20Mirror%20Images.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"images\",\n filterId: \"myMirrorImages\",\n time: 0,\n nbImage: 4,\n alphaImg: 1.0,\n alphaChr: 0.0,\n blend: 4,\n ampX: 0.10,\n ampY: 0.10,\n zOrder: 20,\n animated :\n {\n time: \n { \n active: true, \n speed: 0.0010, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Ac6lTCiwnycb2Hbw" +} diff --git a/src/packs/_source/tmMacros/23-t02-chaotic-images.json b/src/packs/_source/tmMacros/23-t02-chaotic-images.json new file mode 100644 index 0000000..d000901 --- /dev/null +++ b/src/packs/_source/tmMacros/23-t02-chaotic-images.json @@ -0,0 +1,24 @@ +{ + "_id": "ycesEG9gnQecVsDM", + "name": "23 - T02 - Chaotic Images", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/23%20-%20T02%20-%20Chaotic%20Images.webp", + "scope": "global", + "command": "// This is an extreme example...\nlet params =\n[{\n filterType: \"images\",\n filterId: \"myChaoticImages\",\n time: 0,\n nbImage: 4,\n alphaImg: 1.0,\n alphaChr: 0.0,\n blend: 4,\n ampX: 0.10,\n ampY: 0.10,\n padding: 80,\n zOrder: 20,\n animated :\n {\n time: \n { \n active: true, \n speed: 0.0010, \n animType: \"move\" \n },\n ampX:\n {\n active: true,\n val1: 0.00,\n val2: 0.30,\n chaosFactor: 0.03,\n animType: \"syncChaoticOscillation\",\n loopDuration: 2000\n },\n ampY:\n {\n active: true,\n val1: 0.00,\n val2: 0.30,\n chaosFactor: 0.04,\n animType: \"syncChaoticOscillation\",\n loopDuration: 1650\n },\n alphaChr: \n { \n active: true, \n animType: \"randomNumberPerLoop\", \n val1: 0.0, \n val2: 1,\n loopDuration: 250\n },\n alphaImg: \n { \n active: true, \n animType: \"randomNumberPerLoop\", \n val1: 0.8, \n val2: 1,\n loopDuration: 250\n },\n nbImage:\n {\n active: true,\n val1: 1,\n val2: 9,\n animType: \"syncSinOscillation\",\n loopDuration: 1400\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 11600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!ycesEG9gnQecVsDM" +} diff --git a/src/packs/_source/tmMacros/23-t03-spectral-images.json b/src/packs/_source/tmMacros/23-t03-spectral-images.json new file mode 100644 index 0000000..4b18f5a --- /dev/null +++ b/src/packs/_source/tmMacros/23-t03-spectral-images.json @@ -0,0 +1,24 @@ +{ + "_id": "UEsyHtvWqlOGbUAG", + "name": "23 - T03 - Spectral Images", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/23%20-%20T03%20-%20Spectral%20Images.webp", + "scope": "global", + "command": "// Another extreme example...\nlet params =\n[{\n filterType: \"images\",\n filterId: \"mySpectralImages\",\n time: 0, \n blend: 4,\n nbImage: 4, \n padding: 0,\n alphaImg: 0.5, \n alphaChr: 0.0,\n ampX: 0.10, \n ampY: 0.10,\n zOrder: 20,\n animated :\n {\n time: \n { \n speed: 0.0010, \n animType: \"move\" \n },\n ampX:\n {\n val1: 0, val2: 0.22,\n animType: \"syncCosOscillation\",\n loopDuration: 2500\n },\n ampY:\n {\n val1: 0, val2: 0.28,\n animType: \"syncCosOscillation\",\n loopDuration: 2500,\n },\n alphaChr: \n {\n val1: 1, val2: 0,\n animType: \"syncCosOscillation\",\n loopDuration: 2500\n },\n alphaImg: \n {\n val1: 0.2, val2: 0.8,\n animType: \"syncSinOscillation\",\n loopDuration: 2500\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!UEsyHtvWqlOGbUAG" +} diff --git a/src/packs/_source/tmMacros/24-t01-hexa-force-field-2.json b/src/packs/_source/tmMacros/24-t01-hexa-force-field-2.json new file mode 100644 index 0000000..2f25747 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t01-hexa-force-field-2.json @@ -0,0 +1,24 @@ +{ + "_id": "cqKydeDi9ay4PKdf", + "name": "24 - T01 - Hexa Force Field 2", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T01%20-%20Hexa%20Force%20Field%202.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myHexaField\",\n shieldType: 2,\n gridPadding: 2,\n color: 0x00CCDD,\n time: 0,\n blend: 2,\n intensity: 0.95,\n lightAlpha: 0,\n lightSize: 0,\n scale: 0.75,\n radius: 1,\n chromatic: false,\n alphaDiscard: true,\n zOrder: 5000,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!cqKydeDi9ay4PKdf" +} diff --git a/src/packs/_source/tmMacros/24-t01-hexa-force-field-3-scintillating.json b/src/packs/_source/tmMacros/24-t01-hexa-force-field-3-scintillating.json new file mode 100644 index 0000000..d3bb46f --- /dev/null +++ b/src/packs/_source/tmMacros/24-t01-hexa-force-field-3-scintillating.json @@ -0,0 +1,24 @@ +{ + "_id": "HfaGElkKX6xXf3zV", + "name": "24 - T01 - Hexa Force Field 3 - Scintillating", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T01%20-%20Hexa%20Force%20Field%203%20-%20Scintillating.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myHexaField\",\n shieldType: 2,\n gridPadding: 2,\n color: 0x00CCDD,\n time: 0,\n blend: 2,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0,\n scale: 2,\n radius: 0.98,\n chromatic: false,\n discardThreshold: 0.13,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"xglow\",\n filterId: \"myBurningAura\",\n auraType: 2,\n color: 0x500050,\n scale: 1.,\n time: 0,\n auraIntensity: 1,\n subAuraIntensity: 0,\n threshold: 0,\n discard: false,\n zOrder: 3000,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 6000, \n animType: \"cosOscillation\", \n val1:2, \n val2:4\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!HfaGElkKX6xXf3zV" +} diff --git a/src/packs/_source/tmMacros/24-t01-hexa-force-field.json b/src/packs/_source/tmMacros/24-t01-hexa-force-field.json new file mode 100644 index 0000000..8a7e8c4 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t01-hexa-force-field.json @@ -0,0 +1,24 @@ +{ + "_id": "sbP8KX50YRYtxVyB", + "name": "24 - T01 - Hexa Force Field", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T01%20-%20Hexa%20Force%20Field.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myHexaField\",\n shieldType: 2,\n gridPadding: 2,\n color: 0xCC00CC,\n time: 0,\n blend: 3,\n intensity: 1,\n lightAlpha: 0.5,\n lightSize: 0.5,\n scale: 0.5,\n radius: 1,\n chromatic: false,\n alphaDiscard: true,\n zOrder: 5000,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 10200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!sbP8KX50YRYtxVyB" +} diff --git a/src/packs/_source/tmMacros/24-t02-fire-shield-2.json b/src/packs/_source/tmMacros/24-t02-fire-shield-2.json new file mode 100644 index 0000000..ee12778 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t02-fire-shield-2.json @@ -0,0 +1,24 @@ +{ + "_id": "WdxUWiUJALQVSO81", + "name": "24 - T02 - Fire Shield 2", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield%202.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myFireField\",\n shieldType: 1,\n gridPadding: 2,\n color: 0xE58550,\n time: 0,\n blend: 2,\n intensity: 1.2,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.5,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!WdxUWiUJALQVSO81" +} diff --git a/src/packs/_source/tmMacros/24-t02-fire-shield-3-ring.json b/src/packs/_source/tmMacros/24-t02-fire-shield-3-ring.json new file mode 100644 index 0000000..e05675d --- /dev/null +++ b/src/packs/_source/tmMacros/24-t02-fire-shield-3-ring.json @@ -0,0 +1,24 @@ +{ + "_id": "Uw5icMEGsNrCToeV", + "name": "24 - T02 - Fire Shield 3 - Ring", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield%203%20-%20Ring.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myZap\",\n alphaTolerance: 0.45\n},{\n filterType: \"field\",\n filterId: \"myFireField\",\n shieldType: 1,\n gridPadding: 1.1,\n color: 0xE58550,\n time: 0,\n blend: 2,\n intensity: 1.2,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.9,\n hideRadius: 0.95,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n},{\n filterType: \"xglow\",\n filterId: \"myBurningAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 4.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1.5,\n threshold: 0.40,\n discard: true,\n zOrder: 3000,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:5\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Uw5icMEGsNrCToeV" +} diff --git a/src/packs/_source/tmMacros/24-t02-fire-shield-4-lava-zone.json b/src/packs/_source/tmMacros/24-t02-fire-shield-4-lava-zone.json new file mode 100644 index 0000000..459d157 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t02-fire-shield-4-lava-zone.json @@ -0,0 +1,24 @@ +{ + "_id": "kyQD90fSuNLDI4Y0", + "name": "24 - T02 - Fire Shield 4 - Lava Zone", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield%204%20-%20Lava%20Zone.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myZap\",\n alphaTolerance: 0.45\n},{\n filterType: \"field\",\n filterId: \"myLavaRing\",\n shieldType: 6,\n gridPadding: 1.25,\n color: 0xFFAA00,\n time: 0,\n blend: 14,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.30,\n hideRadius: 0.95,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n },\n radius: \n {\n active: true, \n loopDuration: 6000, \n animType: \"cosOscillation\", \n val1:1, \n val2:0.8\n },\n hideRadius: \n {\n active: true, \n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:0.75, \n val2:0.4\n }\n }\n},{\n filterType: \"xglow\",\n filterId: \"myBurningAura\",\n auraType: 2,\n color: 0xFF5000,\n thickness: 9.8,\n scale: 1.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1,\n threshold: 0.30,\n discard: true,\n zOrder: 3000,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 600, \n animType: \"cosOscillation\", \n val1:4, \n val2:8\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 9400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!kyQD90fSuNLDI4Y0" +} diff --git a/src/packs/_source/tmMacros/24-t02-fire-shield.json b/src/packs/_source/tmMacros/24-t02-fire-shield.json new file mode 100644 index 0000000..6018b46 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t02-fire-shield.json @@ -0,0 +1,24 @@ +{ + "_id": "IA3ofbRDpi3Rjgcy", + "name": "24 - T02 - Fire Shield", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myFireField\",\n shieldType: 1,\n gridPadding: 2,\n color: 0xE58550,\n time: 0,\n blend: 2,\n intensity: 1.2,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 4000000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!IA3ofbRDpi3Rjgcy" +} diff --git a/src/packs/_source/tmMacros/24-t03-poisoned-smoke.json b/src/packs/_source/tmMacros/24-t03-poisoned-smoke.json new file mode 100644 index 0000000..7b4c0ee --- /dev/null +++ b/src/packs/_source/tmMacros/24-t03-poisoned-smoke.json @@ -0,0 +1,24 @@ +{ + "_id": "SSY0fjib0PgJaKEK", + "name": "24 - T03 - Poisoned Smoke", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T03%20-%20Poisoned%20Smoke.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"mySmokeField\",\n shieldType: 3,\n gridPadding: 1,\n color: 0x60CC70,\n time: 0,\n blend: 0,\n intensity: 0.9,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!SSY0fjib0PgJaKEK" +} diff --git a/src/packs/_source/tmMacros/24-t04-shell-earth.json b/src/packs/_source/tmMacros/24-t04-shell-earth.json new file mode 100644 index 0000000..993003c --- /dev/null +++ b/src/packs/_source/tmMacros/24-t04-shell-earth.json @@ -0,0 +1,24 @@ +{ + "_id": "359Mw23cvaEDevkP", + "name": "24 - T04 - Shell - Earth", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T04%20-%20Shell%20-%20Earth.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myEarthField\",\n shieldType: 4,\n gridPadding: 2,\n color: 0xBB9070,\n time: 0,\n blend: 1,\n intensity: 1.25,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 500000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!359Mw23cvaEDevkP" +} diff --git a/src/packs/_source/tmMacros/24-t04-shell-moving-ice-disc.json b/src/packs/_source/tmMacros/24-t04-shell-moving-ice-disc.json new file mode 100644 index 0000000..af2ff6c --- /dev/null +++ b/src/packs/_source/tmMacros/24-t04-shell-moving-ice-disc.json @@ -0,0 +1,24 @@ +{ + "_id": "tZZaP7yvqdNnqF2L", + "name": "24 - T04 - Shell - Moving Ice Disc", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T04%20-%20Shell%20-%20Moving%20Ice%20Disc.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myIceField\",\n shieldType: 14,\n gridPadding: 1.25,\n color: 0x409090,\n time: 0,\n blend: 9,\n intensity: 1,\n lightAlpha: 2,\n lightSize: 1,\n scale: 1,\n radius: 0.97,\n chromatic: false,\n discardThreshold: 0.2,\n alphaDiscard: true,\n animated :\n {\n posLightX:\n {\n active: true,\n val1: 0.25,\n val2: 0.75,\n animType: \"syncCosOscillation\",\n loopDuration: 5000\n },\n posLightY:\n {\n active: true,\n val1: 0.25,\n val2: 0.75,\n animType: \"syncSinOscillation\",\n loopDuration: 5000\n },\n lightSize:\n {\n active: true,\n val1: 0.95,\n val2: 1.05,\n animType: \"sinOscillation\",\n loopDuration: 900\n }\n }\n},{\n filterType: \"xglow\",\n filterId: \"myIceField\",\n auraType: 1,\n color: 0x5099DD,\n thickness: 4.5,\n scale: 1,\n time: 0,\n auraIntensity: 0.25,\n subAuraIntensity: 0.25,\n threshold: 0.1,\n discard: false,\n zOrder: 3000,\n animated:\n {\n time:\n {\n active: true,\n speed: 0.0018,\n animType: \"move\"\n },\n thickness:\n {\n val1: 2, val2: 2.5,\n animType: \"cosOscillation\",\n loopDuration: 3000\n },\n subAuraIntensity:\n {\n val1: 0.45, val2: 0.65,\n animType: \"cosOscillation\",\n loopDuration: 6000\n },\n auraIntensity:\n {\n val1: 0.9, val2: 2.2,\n animType: \"cosOscillation\",\n loopDuration: 3000\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 10500000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!tZZaP7yvqdNnqF2L" +} diff --git a/src/packs/_source/tmMacros/24-t05-mega-chroma-shell-on-top.json b/src/packs/_source/tmMacros/24-t05-mega-chroma-shell-on-top.json new file mode 100644 index 0000000..6a1a176 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t05-mega-chroma-shell-on-top.json @@ -0,0 +1,24 @@ +{ + "_id": "LrfXNjrImAWK5Hb2", + "name": "24 - T05 - Mega - Chroma Shell (on top)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T05%20-%20Mega%20-%20Chroma%20Shell%20%28on%20top%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myEarthFieldTop\",\n shieldType: 5,\n gridPadding: 3,\n color: 0xAAAAAA,\n time: 0,\n blend: 5,\n intensity: 1.9,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n zIndex: 5,\n chromatic: true,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 4700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!LrfXNjrImAWK5Hb2" +} diff --git a/src/packs/_source/tmMacros/24-t05-mega-ice-shell-on-top.json b/src/packs/_source/tmMacros/24-t05-mega-ice-shell-on-top.json new file mode 100644 index 0000000..a06d776 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t05-mega-ice-shell-on-top.json @@ -0,0 +1,24 @@ +{ + "_id": "QHFSZ2GTB3gdDijZ", + "name": "24 - T05 - Mega - Ice Shell (on top)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T05%20-%20Mega%20-%20Ice%20Shell%20%28on%20top%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myEarthFieldTop\",\n shieldType: 5,\n gridPadding: 3,\n color: 0x00DDFF,\n time: 0,\n blend: 5,\n intensity: 1.9,\n lightAlpha: 0,\n lightSize: 0,\n scale: 1,\n radius: 1,\n zIndex: 5,\n discardThreshold: 0.09,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n},\n {\n filterType: \"xglow\",\n filterId: \"myEarthFieldTopGlow\",\n auraType: 1,\n color: 0x5099DD,\n thickness: 4.5,\n scale: 1,\n time: 0,\n auraIntensity: 0.25,\n subAuraIntensity: 1,\n threshold: 0.5,\n discard: false,\n zOrder: 3000,\n animated:\n {\n time:\n {\n active: true,\n speed: 0.0018,\n animType: \"move\"\n },\n thickness:\n {\n val1: 2, val2: 2.5,\n animType: \"cosOscillation\",\n loopDuration: 3000\n },\n subAuraIntensity:\n {\n val1: 0.45, val2: 0.65,\n animType: \"cosOscillation\",\n loopDuration: 6000\n },\n auraIntensity:\n {\n val1: 0.9, val2: 2.2,\n animType: \"cosOscillation\",\n loopDuration: 3000\n }\n }\n }];\n\nTokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5000000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!QHFSZ2GTB3gdDijZ" +} diff --git a/src/packs/_source/tmMacros/24-t06-air-bubble-2.json b/src/packs/_source/tmMacros/24-t06-air-bubble-2.json new file mode 100644 index 0000000..b21e581 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t06-air-bubble-2.json @@ -0,0 +1,24 @@ +{ + "_id": "etT28F5qKw6PpXq5", + "name": "24 - T06 - Air Bubble 2", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T06%20-%20Air%20Bubble%202.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myAirField\",\n shieldType: 6,\n gridPadding: 1.2,\n color: 0x7090AA,\n time: 0,\n blend: 2,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.1,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!etT28F5qKw6PpXq5" +} diff --git a/src/packs/_source/tmMacros/24-t06-air-bubble.json b/src/packs/_source/tmMacros/24-t06-air-bubble.json new file mode 100644 index 0000000..8f1278c --- /dev/null +++ b/src/packs/_source/tmMacros/24-t06-air-bubble.json @@ -0,0 +1,24 @@ +{ + "_id": "6Do4AOxfbtCG8R4j", + "name": "24 - T06 - Air Bubble", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T06%20-%20Air%20Bubble.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myAirField\",\n shieldType: 6,\n gridPadding: 1.2,\n color: 0x7090AA,\n time: 0,\n blend: 1,\n intensity: 1,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!6Do4AOxfbtCG8R4j" +} diff --git a/src/packs/_source/tmMacros/24-t07-mage-armor-2.json b/src/packs/_source/tmMacros/24-t07-mage-armor-2.json new file mode 100644 index 0000000..6789a5f --- /dev/null +++ b/src/packs/_source/tmMacros/24-t07-mage-armor-2.json @@ -0,0 +1,24 @@ +{ + "_id": "Ii7MvSDFFEKMavuM", + "name": "24 - T07 - Mage Armor 2", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T07%20-%20Mage%20Armor%202.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myMageField\",\n shieldType: 7,\n gridPadding: 1,\n color: 0xEEFFFF,\n time: 0,\n blend: 4,\n intensity: 0.8,\n lightAlpha: 0,\n lightSize: 0,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.25,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.003, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 4300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Ii7MvSDFFEKMavuM" +} diff --git a/src/packs/_source/tmMacros/24-t07-mage-armor.json b/src/packs/_source/tmMacros/24-t07-mage-armor.json new file mode 100644 index 0000000..4f94284 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t07-mage-armor.json @@ -0,0 +1,24 @@ +{ + "_id": "6ZIpqLC3agLw2Vgx", + "name": "24 - T07 - Mage Armor", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T07%20-%20Mage%20Armor.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myMageField\",\n shieldType: 7,\n gridPadding: 1.,\n color: 0xFFFFFF,\n time: 0,\n blend: 4,\n intensity: 0.8,\n lightAlpha: 1,\n lightSize: 0.45,\n scale: 1,\n radius: 1,\n chromatic: false,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!6ZIpqLC3agLw2Vgx" +} diff --git a/src/packs/_source/tmMacros/24-t08-chromatic-bubble-2.json b/src/packs/_source/tmMacros/24-t08-chromatic-bubble-2.json new file mode 100644 index 0000000..71ca8c1 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t08-chromatic-bubble-2.json @@ -0,0 +1,28 @@ +{ + "_id": "EzV1RAvmD9azXoNe", + "name": "24 - T08 - Chromatic Bubble 2", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T08%20-%20Chromatic%20Bubble%202.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myChromaField\",\n shieldType: 8,\n gridPadding: 1,\n color: 0xAAAAAA,\n time: 0,\n blend: 2,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0,\n scale: 1,\n radius: 1,\n chromatic: true,\n discardThreshold: 0.3,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0045, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3000000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!EzV1RAvmD9azXoNe" +} diff --git a/src/packs/_source/tmMacros/24-t08-chromatic-bubble.json b/src/packs/_source/tmMacros/24-t08-chromatic-bubble.json new file mode 100644 index 0000000..228aef5 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t08-chromatic-bubble.json @@ -0,0 +1,28 @@ +{ + "_id": "f74nx1SMT5m8RRn8", + "name": "24 - T08 - Chromatic Bubble", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T08%20-%20Chromatic%20Bubble.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myChromaField\",\n shieldType: 8,\n gridPadding: 2,\n color: 0xAAAAAA,\n time: 0,\n blend: 2,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0,\n scale: 1,\n radius: 1,\n chromatic: true,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0045, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8400000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!f74nx1SMT5m8RRn8" +} diff --git a/src/packs/_source/tmMacros/24-t09-water-defense-2-ring.json b/src/packs/_source/tmMacros/24-t09-water-defense-2-ring.json new file mode 100644 index 0000000..effe887 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t09-water-defense-2-ring.json @@ -0,0 +1,24 @@ +{ + "_id": "CPMuEoGlADZ4OfXv", + "name": "24 - T09 - Water Defense 2 - Ring", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T09%20-%20Water%20Defense%202%20-%20Ring.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myWaterField\",\n shieldType: 9,\n gridPadding: 1.2,\n color: 0x20BBEE,\n time: 0,\n blend: 4,\n intensity: 1,\n lightAlpha: 0.7,\n lightSize: 0.5,\n scale: 0.6,\n radius: 1,\n chromatic: false,\n hideRadius: 0.8,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n },\n radius: \n {\n active: true, \n loopDuration: 6000, \n animType: \"cosOscillation\", \n val1:1, \n val2:0.8\n },\n hideRadius: \n {\n active: true, \n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:0.6, \n val2:0\n }\n }\n},{\n filterType: \"liquid\",\n filterId: \"myDriftLiquid\",\n color: 0x002040,\n time: 0,\n blend: 4,\n intensity: 4,\n spectral: false,\n scale: 1.5,\n zOrder: 3000,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0018, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 2200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!CPMuEoGlADZ4OfXv" +} diff --git a/src/packs/_source/tmMacros/24-t09-water-defense.json b/src/packs/_source/tmMacros/24-t09-water-defense.json new file mode 100644 index 0000000..0b21e20 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t09-water-defense.json @@ -0,0 +1,24 @@ +{ + "_id": "aoqr6qPxif62zWLo", + "name": "24 - T09 - Water Defense", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T09%20-%20Water%20Defense.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myWaterField\",\n shieldType: 9,\n gridPadding: 1.2,\n color: 0x20BBEE,\n time: 0,\n blend: 4,\n intensity: 1,\n lightAlpha: 0.7,\n lightSize: 0.5,\n scale: 0.6,\n radius: 1,\n chromatic: false,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!aoqr6qPxif62zWLo" +} diff --git a/src/packs/_source/tmMacros/24-t10-evil-aura.json b/src/packs/_source/tmMacros/24-t10-evil-aura.json new file mode 100644 index 0000000..b790036 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t10-evil-aura.json @@ -0,0 +1,24 @@ +{ + "_id": "4Ywsytul1no7EwKb", + "name": "24 - T10 - Evil Aura", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T10%20-%20Evil%20Aura.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myEvilField\",\n shieldType: 10,\n gridPadding: 1,\n color: 0xFF3010,\n time: 0,\n blend: 5,\n intensity: 1,\n lightAlpha: 4,\n lightSize: 0.8,\n scale: 0.5,\n radius: 1,\n chromatic: false,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0012, \n animType: \"move\" \n },\n lightSize: \n {\n val1: 0.4, val2: 1.5,\n animType: \"syncCosOscillation\",\n loopDuration: 5000\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!4Ywsytul1no7EwKb" +} diff --git a/src/packs/_source/tmMacros/24-t11-grid-force-field-2-chromatic.json b/src/packs/_source/tmMacros/24-t11-grid-force-field-2-chromatic.json new file mode 100644 index 0000000..e5233ab --- /dev/null +++ b/src/packs/_source/tmMacros/24-t11-grid-force-field-2-chromatic.json @@ -0,0 +1,24 @@ +{ + "_id": "fZd9j5Y4p49Vwys0", + "name": "24 - T11 - Grid Force Field 2 - Chromatic", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T11%20-%20Grid%20Force%20Field%202%20-%20Chromatic.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myGridField\",\n shieldType: 11,\n gridPadding: 2,\n color: 0xC1C1C1,\n time: 0,\n blend: 2,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0.3,\n scale: 0.5,\n radius: 1,\n chromatic: true,\n alphaDiscard: true,\n discardThreshold: 0.3,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8500000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!fZd9j5Y4p49Vwys0" +} diff --git a/src/packs/_source/tmMacros/24-t11-grid-force-field.json b/src/packs/_source/tmMacros/24-t11-grid-force-field.json new file mode 100644 index 0000000..ea5f81f --- /dev/null +++ b/src/packs/_source/tmMacros/24-t11-grid-force-field.json @@ -0,0 +1,24 @@ +{ + "_id": "VuMHH9LMD51MNJzZ", + "name": "24 - T11 - Grid Force Field", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T11%20-%20Grid%20Force%20Field.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myGridField\",\n shieldType: 11,\n gridPadding: 2,\n color: 0x00CCCC,\n time: 0,\n blend: 2,\n intensity: 1,\n lightAlpha: 1,\n lightSize: 0.3,\n scale: 0.5,\n radius: 1,\n chromatic: false,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!VuMHH9LMD51MNJzZ" +} diff --git a/src/packs/_source/tmMacros/24-t12-warp-time-aura-2.json b/src/packs/_source/tmMacros/24-t12-warp-time-aura-2.json new file mode 100644 index 0000000..ff1ae38 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t12-warp-time-aura-2.json @@ -0,0 +1,28 @@ +{ + "_id": "7078QmgtTEjnbAv0", + "name": "24 - T12 - Warp Time Aura 2", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T12%20-%20Warp%20Time%20Aura%202.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myMageField\",\n shieldType: 7,\n gridPadding: 2,\n color: 0xFFFFFF,\n time: 0,\n blend: 4,\n intensity: 0.8,\n lightAlpha: 1,\n lightSize: 0.45,\n scale: 1,\n radius: 1,\n chromatic: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0080, \n animType: \"move\" \n }\n }\n},{\n filterType: \"field\",\n filterId: \"myWarpField\",\n shieldType: 12,\n gridPadding: 2,\n color: 0xFFFFFF,\n time: 0,\n blend: 2,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0,\n scale: 0.7,\n radius: 1,\n chromatic: false,\n alphaDiscard: true,\n discardThreshold: 0.1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1300000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!7078QmgtTEjnbAv0" +} diff --git a/src/packs/_source/tmMacros/24-t12-warp-time-aura.json b/src/packs/_source/tmMacros/24-t12-warp-time-aura.json new file mode 100644 index 0000000..aaa5c73 --- /dev/null +++ b/src/packs/_source/tmMacros/24-t12-warp-time-aura.json @@ -0,0 +1,28 @@ +{ + "_id": "2IOkNL2J1jETUvSP", + "name": "24 - T12 - Warp Time Aura", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T12%20-%20Warp%20Time%20Aura.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myWarpField\",\n shieldType: 12,\n gridPadding: 2,\n color: 0xFFFFFF,\n time: 0,\n blend: 2,\n intensity: 1.5,\n lightAlpha: 0.8,\n lightSize: 0.5,\n scale: 0.7,\n radius: 1,\n chromatic: false,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 200000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!2IOkNL2J1jETUvSP" +} diff --git a/src/packs/_source/tmMacros/24-t13-simple-color.json b/src/packs/_source/tmMacros/24-t13-simple-color.json new file mode 100644 index 0000000..639188d --- /dev/null +++ b/src/packs/_source/tmMacros/24-t13-simple-color.json @@ -0,0 +1,24 @@ +{ + "_id": "GHbWoqQWjeUjcStr", + "name": "24 - T13 - Simple Color", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T13%20-%20Simple%20Color.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"mySimpleField\",\n shieldType: 13,\n gridPadding: 2,\n alpha: 0.25,\n color: 0xCCCC00,\n time: 0,\n blend: 14,\n intensity: 1.10,\n lightSize: 0,\n scale: 1,\n radius: 1,\n chromatic: false,\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!GHbWoqQWjeUjcStr" +} diff --git a/src/packs/_source/tmMacros/25-t01-sunburst-rays-xray.json b/src/packs/_source/tmMacros/25-t01-sunburst-rays-xray.json new file mode 100644 index 0000000..78666ba --- /dev/null +++ b/src/packs/_source/tmMacros/25-t01-sunburst-rays-xray.json @@ -0,0 +1,24 @@ +{ + "_id": "IEl6F5dtFcYBZDDZ", + "name": "25 - T01 - Sunburst Rays (xray)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/25%20-%20T01%20-%20Sunburst%20Rays%20%28xray%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xray\",\n filterId: \"mySunburstRays\",\n time: 0,\n color: 0xFFBB00,\n blend: 9,\n dimX: 1,\n dimY: 1,\n anchorX: 0,\n anchorY: 0,\n divisor: 36,\n intensity: 4,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0012, \n animType: \"move\" \n },\n anchorX:\n {\n animType: \"syncCosOscillation\",\n loopDuration : 6000,\n val1: 0.40,\n val2: 0.60\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 4100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!IEl6F5dtFcYBZDDZ" +} diff --git a/src/packs/_source/tmMacros/25-t02-lucky-clover-xray.json b/src/packs/_source/tmMacros/25-t02-lucky-clover-xray.json new file mode 100644 index 0000000..d00b164 --- /dev/null +++ b/src/packs/_source/tmMacros/25-t02-lucky-clover-xray.json @@ -0,0 +1,24 @@ +{ + "_id": "YPOoPH63FqcEoVTk", + "name": "25 - T02 - Lucky Clover (xray)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/25%20-%20T02%20-%20Lucky%20Clover%20%28xray%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xray\",\n filterId: \"myLuckyRays\",\n time: 0,\n color: 0x00FF00,\n blend: 9,\n dimX: 0.05,\n dimY: 0.05,\n anchorX: 0.5,\n anchorY: 0.5,\n divisor: 4,\n intensity: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0012, \n animType: \"move\" \n },\n anchorX:\n {\n animType: \"syncCosOscillation\",\n loopDuration : 6000,\n val1: 0.40,\n val2: 0.60\n },\n anchorY:\n {\n animType: \"syncSinOscillation\",\n loopDuration : 6000,\n val1: 0.40,\n val2: 0.60\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!YPOoPH63FqcEoVTk" +} diff --git a/src/packs/_source/tmMacros/25-t03-x-ray-scan-xray.json b/src/packs/_source/tmMacros/25-t03-x-ray-scan-xray.json new file mode 100644 index 0000000..3bad48c --- /dev/null +++ b/src/packs/_source/tmMacros/25-t03-x-ray-scan-xray.json @@ -0,0 +1,24 @@ +{ + "_id": "hFZvMSE5VMCUiYNE", + "name": "25 - T03 - X-ray Scan (xray)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/25%20-%20T03%20-%20X-ray%20Scan%20%28xray%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xray\",\n filterId: \"myXrayScan\",\n time: 0,\n color: 0xFFFFFF,\n blend: 5,\n dimX: 20,\n dimY: 20,\n anchorX: 0.5,\n anchorY: 0,\n divisor: 8,\n intensity: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.00038, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!hFZvMSE5VMCUiYNE" +} diff --git a/src/packs/_source/tmMacros/25-t04-blue-rays-xray.json b/src/packs/_source/tmMacros/25-t04-blue-rays-xray.json new file mode 100644 index 0000000..4a4f457 --- /dev/null +++ b/src/packs/_source/tmMacros/25-t04-blue-rays-xray.json @@ -0,0 +1,28 @@ +{ + "_id": "SpHEaIwubKpbwzvV", + "name": "25 - T04 - Blue Rays ! (xray)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/25%20-%20T04%20-%20Blue%20Rays%20%21%20%28xray%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xray\",\n filterId: \"myBlueRay\",\n time: 0,\n color: 0x1030FF,\n blend: 9,\n dimX: 1,\n dimY: 1,\n anchorX: 0,\n anchorY: 0,\n divisor: 24,\n intensity: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0002, \n animType: \"move\" \n },\n anchorX:\n {\n animType: \"syncCosOscillation\",\n loopDuration : 18000,\n val1: 0.05,\n val2: 0.95\n },\n anchorY:\n {\n animType: \"syncSinOscillation\",\n loopDuration : 18000,\n val1: 0.05,\n val2: 0.95\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5500000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!SpHEaIwubKpbwzvV" +} diff --git a/src/packs/_source/tmMacros/26-t01-spectral-body-liquid.json b/src/packs/_source/tmMacros/26-t01-spectral-body-liquid.json new file mode 100644 index 0000000..4cc7bbf --- /dev/null +++ b/src/packs/_source/tmMacros/26-t01-spectral-body-liquid.json @@ -0,0 +1,24 @@ +{ + "_id": "SpvVIO1eHYG96TGX", + "name": "26 - T01 - Spectral Body (liquid)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/26%20-%20T01%20-%20Spectral%20Body%20%28liquid%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"liquid\",\n filterId: \"mySpectralBody\",\n color: 0x20AAEE,\n time: 0,\n blend: 8,\n intensity: 4,\n spectral: true,\n scale: 0.9,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0010, \n animType: \"move\" \n },\n color: \n {\n active: true, \n loopDuration: 6000, \n animType: \"colorOscillation\", \n val1:0xFFFFFF, \n val2:0x00AAFF\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!SpvVIO1eHYG96TGX" +} diff --git a/src/packs/_source/tmMacros/26-t02-mantle-of-madness-liquid.json b/src/packs/_source/tmMacros/26-t02-mantle-of-madness-liquid.json new file mode 100644 index 0000000..ceab073 --- /dev/null +++ b/src/packs/_source/tmMacros/26-t02-mantle-of-madness-liquid.json @@ -0,0 +1,24 @@ +{ + "_id": "8nsxKDYhS1Wcc139", + "name": "26 - T02 - Mantle of Madness (liquid)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/26%20-%20T02%20-%20Mantle%20of%20Madness%20%28liquid%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"liquid\",\n filterId: \"myMantle\",\n color: 0x0090FF,\n time: 0,\n blend: 5,\n intensity: 0.0001,\n spectral: false,\n scale: 7,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n },\n intensity : \n { \n active: true, \n animType: \"syncCosOscillation\",\n loopDuration: 30000,\n val1: 0.0001, \n val2: 4 \n },\n scale: \n { \n active: true, \n animType: \"syncCosOscillation\",\n loopDuration: 30000,\n val1: 7, \n val2: 1 \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1500000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!8nsxKDYhS1Wcc139" +} diff --git a/src/packs/_source/tmMacros/26-t03-drift-in-plans-liquid-waves.json b/src/packs/_source/tmMacros/26-t03-drift-in-plans-liquid-waves.json new file mode 100644 index 0000000..caaae6c --- /dev/null +++ b/src/packs/_source/tmMacros/26-t03-drift-in-plans-liquid-waves.json @@ -0,0 +1,28 @@ +{ + "_id": "T953GJB235BbrCll", + "name": "26 - T03 - Drift in Plans (liquid+waves)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/26%20-%20T03%20-%20Drift%20in%20Plans%20%28liquid%2Bwaves%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"wave\",\n filterId: \"myDriftWaves\",\n time: 0,\n anchorX: 0.5,\n anchorY: 0.5,\n strength: 0.035,\n frequency: 20,\n color: 0xFFFFFF,\n maxIntensity: 1.5,\n minIntensity: 0.5,\n padding:10,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0085, \n animType: \"move\" \n },\n anchorX :\n {\n active: true,\n val1: 0.35,\n val2: 0.65,\n animType: \"syncCosOscillation\",\n loopDuration: 10000\n },\n anchorY :\n {\n active: true,\n val1: 0.35,\n val2: 0.65,\n animType: \"syncSinOscillation\",\n loopDuration: 10000\n }\n }\n},\n{\n filterType: \"liquid\",\n filterId: \"myDriftLiquid\",\n color: 0xFF0000,\n time: 0,\n blend: 6,\n intensity: 5,\n spectral: false,\n scale: 2.5,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0018, \n animType: \"move\" \n },\n color: \n {\n active: true, \n loopDuration: 9000, \n animType: \"colorOscillation\", \n val1:0xFF0000, \n val2:0xFFFFFF\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5800000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!T953GJB235BbrCll" +} diff --git a/src/packs/_source/tmMacros/27-t01-burning-aura-xglow.json b/src/packs/_source/tmMacros/27-t01-burning-aura-xglow.json new file mode 100644 index 0000000..cb600b3 --- /dev/null +++ b/src/packs/_source/tmMacros/27-t01-burning-aura-xglow.json @@ -0,0 +1,24 @@ +{ + "_id": "cOaB7NxSQ5jNDd5g", + "name": "27 - T01 - Burning Aura (xglow)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T01%20-%20Burning%20Aura%20%28xglow%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myZapShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myBurningAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 1.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1.5,\n threshold: 0.40,\n discard: true,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:5\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!cOaB7NxSQ5jNDd5g" +} diff --git a/src/packs/_source/tmMacros/27-t02-glacial-aura-xglow.json b/src/packs/_source/tmMacros/27-t02-glacial-aura-xglow.json new file mode 100644 index 0000000..99a81f8 --- /dev/null +++ b/src/packs/_source/tmMacros/27-t02-glacial-aura-xglow.json @@ -0,0 +1,24 @@ +{ + "_id": "wdbgHdNcBwBETc1y", + "name": "27 - T02 - Glacial Aura (xglow)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T02%20-%20Glacial%20Aura%20%28xglow%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myGlacialZapShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myGlacialAura\",\n auraType: 1,\n color: 0x5099DD,\n thickness: 4.5,\n scale: 3,\n time: 0,\n auraIntensity: 0.8,\n subAuraIntensity: 0.25,\n threshold: 0.5,\n discard: false,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0018, \n animType: \"move\" \n },\n thickness: \n {\n val1: 2, val2: 4.7,\n animType: \"cosOscillation\",\n loopDuration: 3000\n },\n subAuraIntensity: \n {\n val1: 0.45, val2: 0.65,\n animType: \"cosOscillation\",\n loopDuration: 6000\n },\n auraIntensity: \n {\n val1: 0.9, val2: 2.2,\n animType: \"cosOscillation\",\n loopDuration: 3000\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 11200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!wdbgHdNcBwBETc1y" +} diff --git a/src/packs/_source/tmMacros/27-t03-ugly-villains-aura-xglow.json b/src/packs/_source/tmMacros/27-t03-ugly-villains-aura-xglow.json new file mode 100644 index 0000000..bad7edc --- /dev/null +++ b/src/packs/_source/tmMacros/27-t03-ugly-villains-aura-xglow.json @@ -0,0 +1,24 @@ +{ + "_id": "ydY1XOCO4yIhunkj", + "name": "27 - T03 - Ugly Villains Aura (xglow)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T03%20-%20Ugly%20Villains%20Aura%20%28xglow%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myUglyZapShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myUglyGlow\",\n auraType: 2,\n color: 0x050505,\n thickness: 2.7,\n scale: 7,\n time: 0,\n auraIntensity: 5,\n subAuraIntensity: 2,\n threshold: 0.08,\n discard: false,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0012, \n animType: \"move\" \n },\n auraIntensity:\n {\n active: true,\n loopDuration: 3000, \n animType: \"syncCosOscillation\", \n val1:5, \n val2:0\n },\n subAuraIntensity:\n {\n active: true,\n loopDuration: 3000, \n animType: \"syncCosOscillation\", \n val1:2, \n val2:0\n },\n color:\n {\n active: true,\n loopDuration: 6000, \n animType: \"syncColorOscillation\", \n val1:0x050505, \n val2:0x200000\n },\n threshold:\n {\n active: true,\n loopDuration: 1500, \n animType: \"syncCosOscillation\", \n val1:0.02, \n val2:0.50\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 11700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!ydY1XOCO4yIhunkj" +} diff --git a/src/packs/_source/tmMacros/27-t04-pure-fire-xglow-fire.json b/src/packs/_source/tmMacros/27-t04-pure-fire-xglow-fire.json new file mode 100644 index 0000000..d8a88ff --- /dev/null +++ b/src/packs/_source/tmMacros/27-t04-pure-fire-xglow-fire.json @@ -0,0 +1,28 @@ +{ + "_id": "eJQSmnIitUUQMKDS", + "name": "27 - T04 - Pure Fire (xglow+fire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T04%20-%20Pure%20Fire%20%28xglow%2Bfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fire\",\n filterId: \"myPureFire\",\n intensity: 1,\n color: 0xFFFFFF,\n amplitude: 1,\n time: 0,\n blend: 2,\n fireBlend : 1,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n },\n intensity:\n {\n active:true,\n loopDuration: 15000,\n val1: 0.8,\n val2: 2,\n animType: \"syncCosOscillation\"\n },\n amplitude:\n {\n active:true,\n loopDuration: 4400,\n val1: 1,\n val2: 1.4,\n animType: \"syncCosOscillation\"\n }\n \n }\n},\n{\n filterType: \"zapshadow\",\n filterId: \"myPureFireShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myPureFireAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 4.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1.5,\n threshold: 0.40,\n discard: true,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:5\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8000000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!eJQSmnIitUUQMKDS" +} diff --git a/src/packs/_source/tmMacros/27-t05-pure-fire-v2-xglow-fire.json b/src/packs/_source/tmMacros/27-t05-pure-fire-v2-xglow-fire.json new file mode 100644 index 0000000..edf05f5 --- /dev/null +++ b/src/packs/_source/tmMacros/27-t05-pure-fire-v2-xglow-fire.json @@ -0,0 +1,24 @@ +{ + "_id": "wRWqUK0wliNZSsgl", + "name": "27 - T05 - Pure Fire v2 (xglow+fire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T05%20-%20Pure%20Fire%20v2%20%28xglow%2Bfire%29.webp", + "scope": "global", + "command": "// In this version, the glow is blending with the fire\n// This is to show that the order of the filters is important\nlet params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myPureFireShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myPureFireAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 3.,\n time: 0,\n auraIntensity: 1,\n subAuraIntensity: 0.3,\n threshold: 0.25,\n discard: true,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:3.6\n }\n }\n},\n{\n filterType: \"fire\",\n filterId: \"myPureFire\",\n intensity: 1,\n color: 0xFFFFFF,\n amplitude: 1,\n time: 0,\n blend: 2,\n fireBlend : 1,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n },\n intensity:\n {\n active:true,\n loopDuration: 15000,\n val1: 0.8,\n val2: 3,\n animType: \"syncCosOscillation\"\n },\n amplitude:\n {\n active:true,\n loopDuration: 4400,\n val1: 1,\n val2: 1.6,\n animType: \"syncCosOscillation\"\n }\n \n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 11000000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!wRWqUK0wliNZSsgl" +} diff --git a/src/packs/_source/tmMacros/27-t06-pure-ice-xglow-smoke.json b/src/packs/_source/tmMacros/27-t06-pure-ice-xglow-smoke.json new file mode 100644 index 0000000..b4b14e4 --- /dev/null +++ b/src/packs/_source/tmMacros/27-t06-pure-ice-xglow-smoke.json @@ -0,0 +1,24 @@ +{ + "_id": "QkPSIfIOf72oD49L", + "name": "27 - T06 - Pure Ice (xglow+smoke)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T06%20-%20Pure%20Ice%20%28xglow%2Bsmoke%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"zapshadow\",\n filterId: \"myPureIceZapShadow\",\n alphaTolerance: 0.50\n },\n {\n filterType: \"xglow\",\n filterId: \"myPureIceAura\",\n auraType: 1,\n color: 0x5099DD,\n thickness: 4.5,\n scale: 10,\n time: 0,\n auraIntensity: 0.25,\n subAuraIntensity: 1,\n threshold: 0.5,\n discard: false,\n animated:\n {\n time:\n {\n active: true,\n speed: 0.0018,\n animType: \"move\"\n },\n thickness:\n {\n val1: 2, val2: 2.5,\n animType: \"cosOscillation\",\n loopDuration: 3000\n },\n subAuraIntensity:\n {\n val1: 0.45, val2: 0.65,\n animType: \"cosOscillation\",\n loopDuration: 6000\n },\n auraIntensity:\n {\n val1: 0.9, val2: 2.2,\n animType: \"cosOscillation\",\n loopDuration: 3000\n }\n }\n },\n {\n filterType: \"smoke\",\n filterId: \"myPureIceSmoke\",\n color: 0x80CCFF,\n time: 0,\n blend: 2,\n dimX: 0.3,\n dimY: 1,\n animated:\n {\n time:\n {\n active: true,\n speed: -0.006,\n animType: \"move\"\n },\n dimX:\n {\n val1: 0.4, val2: 0.2,\n animType: \"cosOscillation\",\n loopDuration: 3000\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!QkPSIfIOf72oD49L" +} diff --git a/src/packs/_source/tmMacros/28-glory-to-pixels.json b/src/packs/_source/tmMacros/28-glory-to-pixels.json new file mode 100644 index 0000000..ce86918 --- /dev/null +++ b/src/packs/_source/tmMacros/28-glory-to-pixels.json @@ -0,0 +1,24 @@ +{ + "_id": "8KIRbHAgs6SCs8mT", + "name": "28 - Glory to Pixels", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/28%20-%20Glory%20to%20Pixels.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"pixel\",\n filterId: \"pixelate\",\n sizeX: 2.5,\n sizeY: 2.5\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!8KIRbHAgs6SCs8mT" +} diff --git a/src/packs/_source/tmMacros/29-t01-foul-fog-xfog.json b/src/packs/_source/tmMacros/29-t01-foul-fog-xfog.json new file mode 100644 index 0000000..7a59a2b --- /dev/null +++ b/src/packs/_source/tmMacros/29-t01-foul-fog-xfog.json @@ -0,0 +1,24 @@ +{ + "_id": "T1cSEVif6eETPeQw", + "name": "29 - T01 - Foul Fog (xfog)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/29%20-%20T01%20-%20Foul%20Fog%20%28xfog%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"xfog\",\n filterId: \"foulfog\",\n color: 0xFFFFFF,\n time: 0,\n animated:\n {\n time:\n {\n active: true,\n speed: 0.0005,\n animType: \"move\"\n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!T1cSEVif6eETPeQw" +} diff --git a/src/packs/_source/tmMacros/29-t02-phase-spider-web-xfog-web.json b/src/packs/_source/tmMacros/29-t02-phase-spider-web-xfog-web.json new file mode 100644 index 0000000..4f1663c --- /dev/null +++ b/src/packs/_source/tmMacros/29-t02-phase-spider-web-xfog-web.json @@ -0,0 +1,24 @@ +{ + "_id": "ki2AEmXzUJkGpU65", + "name": "29 - T02 - Phase Spider Web (xfog+web)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/29%20-%20T02%20-%20Phase%20Spider%20Web%20%28xfog%2Bweb%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"web\",\n filterId: \"phaseweb\",\n time: 0,\n animated:\n {\n time:\n {\n active: true,\n speed: 0.0005,\n animType: \"move\"\n }\n }\n},\n{\n filterType: \"xfog\",\n filterId: \"phaseweb\",\n color: 0x30FF30,\n time: 0,\n animated:\n {\n time:\n {\n active: true,\n speed: 0.0005,\n animType: \"move\"\n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 9300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!ki2AEmXzUJkGpU65" +} diff --git a/src/packs/_source/tmMacros/30-t01-simple-web-web.json b/src/packs/_source/tmMacros/30-t01-simple-web-web.json new file mode 100644 index 0000000..94d638c --- /dev/null +++ b/src/packs/_source/tmMacros/30-t01-simple-web-web.json @@ -0,0 +1,24 @@ +{ + "_id": "9gvCwVdvis3NABbI", + "name": "30 - T01 - Simple Web (web)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/30%20-%20T01%20-%20Simple%20Web%20%28web%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"web\",\n filterId: \"simpleweb\",\n time: 100,\n div1: 20,\n div2: 10,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0005, \n animType: \"move\" \n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!9gvCwVdvis3NABbI" +} diff --git a/src/packs/_source/tmMacros/30-t02-infernal-web-field-web.json b/src/packs/_source/tmMacros/30-t02-infernal-web-field-web.json new file mode 100644 index 0000000..7184bf6 --- /dev/null +++ b/src/packs/_source/tmMacros/30-t02-infernal-web-field-web.json @@ -0,0 +1,24 @@ +{ + "_id": "D2su0oqd2SLY0uZ7", + "name": "30 - T02 - Infernal Web (field+web)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/30%20-%20T02%20-%20Infernal%20Web%20%28field%2Bweb%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"field\",\n filterId: \"infernalWeb\",\n shieldType: 1,\n gridPadding: 1.5,\n color: 0xCC2050,\n time: 0,\n blend: 3,\n intensity: 1,\n lightAlpha: 1,\n lightSize: 0.8,\n scale: 1,\n radius: 1,\n chromatic: false,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0012, \n animType: \"move\" \n },\n lightSize: \n {\n val1: 0.4, val2: 1.5,\n animType: \"syncCosOscillation\",\n loopDuration: 5000\n }\n }\n}\n,{\n filterType: \"web\",\n filterId: \"infernalWeb\",\n time: 100,\n div1: 16,\n div2: 8,\n tear: 0.45,\n amplitude: 0.8,\n thickness: 2,\n color: 0xAA3030,\n zOrder: 1024,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0005, \n animType: \"move\" \n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 2600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!D2su0oqd2SLY0uZ7" +} diff --git a/src/packs/_source/tmMacros/31-t01-glowing-globes-globes.json b/src/packs/_source/tmMacros/31-t01-glowing-globes-globes.json new file mode 100644 index 0000000..782d8e6 --- /dev/null +++ b/src/packs/_source/tmMacros/31-t01-glowing-globes-globes.json @@ -0,0 +1,24 @@ +{ + "_id": "BV1FdyFefneHRoEx", + "name": "31 - T01 - Glowing Globes (globes)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/31%20-%20T01%20-%20Glowing%20Globes%20%28globes%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"globes\",\n filterId: \"glowingGlobes\",\n time: 0,\n color: 0x5099DD,\n distortion: 0.4,\n scale: 80,\n alphaDiscard: false,\n zOrder: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0005, \n animType: \"move\" \n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 2100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!BV1FdyFefneHRoEx" +} diff --git a/src/packs/_source/tmMacros/31-t02-fairy-outline-globes-glow.json b/src/packs/_source/tmMacros/31-t02-fairy-outline-globes-glow.json new file mode 100644 index 0000000..c70b6cf --- /dev/null +++ b/src/packs/_source/tmMacros/31-t02-fairy-outline-globes-glow.json @@ -0,0 +1,24 @@ +{ + "_id": "URg5jbccjFontPwQ", + "name": "31 - T02 - Fairy Outline (globes+glow)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/31%20-%20T02%20-%20Fairy%20Outline%20%28globes%2Bglow%29.webp", + "scope": "global", + "command": "// works better with non-round forms\nlet params = \n[{\n filterType: \"globes\",\n filterId: \"glowingGlobes\",\n time: 0,\n color: 0x3080EE,\n distortion: 0.9,\n scale: 320,\n alphaDiscard: true,\n zOrder: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"glow\",\n filterId: \"superSpookyGlow\",\n outerStrength: 4,\n innerStrength: 0,\n color: 0xFF3000,\n quality: 0.5,\n padding: 10,\n animated:\n {\n color: \n {\n active: true, \n loopDuration: 3000, \n animType: \"colorOscillation\", \n val1:0xFF3000, \n val2:0x30FF00\n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!URg5jbccjFontPwQ" +} diff --git a/src/packs/_source/tmMacros/32-t01-solar-ripples-ripples.json b/src/packs/_source/tmMacros/32-t01-solar-ripples-ripples.json new file mode 100644 index 0000000..8d8b8a3 --- /dev/null +++ b/src/packs/_source/tmMacros/32-t01-solar-ripples-ripples.json @@ -0,0 +1,24 @@ +{ + "_id": "qMZ03TZJuNYwudlg", + "name": "32 - T01 - Solar Ripples (ripples)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/32%20-%20T01%20-%20Solar%20Ripples%20%28ripples%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"ripples\",\n filterId: \"SolarRipples\",\n color: 0xCC9000,\n time: 0,\n alphaDiscard: false,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 9800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!qMZ03TZJuNYwudlg" +} diff --git a/src/packs/_source/tmMacros/32-t02-devoured-by-the-bewitched-flames-ripples-glow.json b/src/packs/_source/tmMacros/32-t02-devoured-by-the-bewitched-flames-ripples-glow.json new file mode 100644 index 0000000..d221403 --- /dev/null +++ b/src/packs/_source/tmMacros/32-t02-devoured-by-the-bewitched-flames-ripples-glow.json @@ -0,0 +1,24 @@ +{ + "_id": "v9CPcenfjU6hH5mO", + "name": "32 - T02 - Devoured by the Bewitched Flames (ripples+glow)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/32%20-%20T02%20-%20Devoured%20by%20the%20Bewitched%20Flames%20%28ripples%2Bglow%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"ripples\",\n filterId: \"SolarRipples\",\n color: 0x508000,\n time: 0,\n alphaDiscard: true,\n zOrder:50,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"glow\",\n filterId: \"glowripples\",\n outerStrength: 2,\n innerStrength: 1,\n color: 0xFF3000,\n quality: 0.5,\n padding: 10,\n zOrder: 100,\n animated:\n {\n color: \n {\n active: true, \n loopDuration: 3000, \n animType: \"colorOscillation\", \n val1:0xFF3000, \n val2:0x30FF00\n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 10800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!v9CPcenfjU6hH5mO" +} diff --git a/src/packs/_source/tmMacros/33-t01-evade-stance-transform.json b/src/packs/_source/tmMacros/33-t01-evade-stance-transform.json new file mode 100644 index 0000000..5569e4e --- /dev/null +++ b/src/packs/_source/tmMacros/33-t01-evade-stance-transform.json @@ -0,0 +1,28 @@ +{ + "_id": "0U6lS2hR1uMm7iFI", + "name": "33 - T01 - Evade Stance (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/33%20-%20T01%20-%20Evade%20Stance%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"dodgeStance\",\n padding: 50,\n animated:\n {\n translationX:\n {\n animType: \"sinOscillation\",\n val1: -0.125,\n val2: +0.125,\n loopDuration: 1400,\n },\n translationY:\n {\n animType: \"cosOscillation\",\n val1: -0.035,\n val2: +0.035,\n loopDuration: 1400,\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 100000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!0U6lS2hR1uMm7iFI" +} diff --git a/src/packs/_source/tmMacros/33-t02-saving-roll-transform.json b/src/packs/_source/tmMacros/33-t02-saving-roll-transform.json new file mode 100644 index 0000000..49c4c48 --- /dev/null +++ b/src/packs/_source/tmMacros/33-t02-saving-roll-transform.json @@ -0,0 +1,28 @@ +{ + "_id": "Rcfdd8fQYH3Ripm1", + "name": "33 - T02 - Saving Roll (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/33%20-%20T02%20-%20Saving%20Roll%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"savingRoll\",\n autoDestroy: true,\n padding: 80,\n pivotX: 0.5,\n pivotY: 0.55,\n animated:\n {\n translationX:\n {\n animType: \"sinOscillation\",\n val1: -0.220,\n val2: +0.220,\n loops: 1,\n loopDuration: 1250\n },\n rotation:\n {\n animType: \"sinOscillation\",\n val1: -360,\n val2: +360,\n loops: 1,\n loopDuration: 1250,\n },\n scaleY:\n {\n animType: \"cosOscillation\",\n val1: 1,\n val2: 1.3,\n loops: 2,\n loopDuration: 625,\n },\n scaleX:\n {\n animType: \"cosOscillation\",\n val1: 1,\n val2: 1.4,\n loops: 2,\n loopDuration: 625,\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5300000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Rcfdd8fQYH3Ripm1" +} diff --git a/src/packs/_source/tmMacros/33-t03-dodge-jump-transform.json b/src/packs/_source/tmMacros/33-t03-dodge-jump-transform.json new file mode 100644 index 0000000..fac43e7 --- /dev/null +++ b/src/packs/_source/tmMacros/33-t03-dodge-jump-transform.json @@ -0,0 +1,28 @@ +{ + "_id": "snidZpTtUrrRZpiF", + "name": "33 - T03 - Dodge Jump (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/33%20-%20T03%20-%20Dodge%20Jump%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"jumpedDodge\",\n autoDestroy: true,\n padding: 80,\n animated:\n {\n translationY:\n {\n animType: \"cosOscillation\",\n val1: 0,\n val2: -0.225,\n loops: 1,\n loopDuration: 900\n },\n scaleY:\n {\n animType: \"cosOscillation\",\n val1: 1,\n val2: 0.65,\n loops: 2,\n loopDuration: 450,\n },\n scaleX:\n {\n animType: \"cosOscillation\",\n val1: 1,\n val2: 0.65,\n loops: 2,\n loopDuration: 450,\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 10300000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!snidZpTtUrrRZpiF" +} diff --git a/src/packs/_source/tmMacros/33-t04-some-real-nuts-here-transform.json b/src/packs/_source/tmMacros/33-t04-some-real-nuts-here-transform.json new file mode 100644 index 0000000..36c4fd2 --- /dev/null +++ b/src/packs/_source/tmMacros/33-t04-some-real-nuts-here-transform.json @@ -0,0 +1,28 @@ +{ + "_id": "PHe9kakKlPKpARvm", + "name": "33 - T04 - Some Real Nuts Here! (transform)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/33%20-%20T04%20-%20Some%20Real%20Nuts%20Here%21%20%28transform%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"transform\",\n filterId: \"myTransform\",\n padding: 200,\n animated:\n {\n rotation:\n {\n clockWise: true,\n loopDuration: 700,\n animType: \"syncRotation\"\n },\n translationX:\n {\n animType: \"sinOscillation\",\n val1: -0.25,\n val2: +0.25\n },\n translationY:\n {\n animType: \"sinOscillation\",\n val1: -0.125,\n val2: +0.125,\n loopDuration: 1500\n },\n scaleX:\n {\n animType: \"sinOscillation\",\n val1: 0.5,\n val2: 2.6,\n loopDuration: 1200\n },\n scaleY:\n {\n animType: \"sinOscillation\",\n val1: 0.5,\n val2: 2.6,\n loopDuration: 1200\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 4900000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!PHe9kakKlPKpARvm" +} diff --git a/src/packs/_source/tmMacros/34-t01-wound-repeatable-splash.json b/src/packs/_source/tmMacros/34-t01-wound-repeatable-splash.json new file mode 100644 index 0000000..6f20cb2 --- /dev/null +++ b/src/packs/_source/tmMacros/34-t01-wound-repeatable-splash.json @@ -0,0 +1,24 @@ +{ + "_id": "XzB3cj1TLsx7qABY", + "name": "34 - T01 - Wound - Repeatable (splash)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/34%20-%20T01%20-%20Wound%20-%20Repeatable%20%28splash%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"splash\",\n filterId: \"mySplash\",\n rank:5,\n color: 0x990505,\n padding: 80,\n time: Math.random()*1000,\n seed: Math.random(),\n splashFactor: 1,\n spread: 0.4,\n blend: 1,\n dimX: 1,\n dimY: 1,\n cut: false,\n textureAlphaBlend: true,\n anchorX: 0.32+(Math.random()*0.36),\n anchorY: 0.32+(Math.random()*0.36)\n }];\n\nawait TokenMagic.addFiltersOnSelected(params);", + "folder": null, + "sort": 6900000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!XzB3cj1TLsx7qABY" +} diff --git a/src/packs/_source/tmMacros/34-t02-dead-splash.json b/src/packs/_source/tmMacros/34-t02-dead-splash.json new file mode 100644 index 0000000..ce34c95 --- /dev/null +++ b/src/packs/_source/tmMacros/34-t02-dead-splash.json @@ -0,0 +1,24 @@ +{ + "_id": "WyiMXpscxVhgE1zy", + "name": "34 - T02 - Dead (splash)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/34%20-%20T02%20-%20Dead%20%28splash%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"splash\",\n filterId: \"mySplash\",\n color: 0x900505,\n padding: 30,\n time: Math.random()*1000,\n seed: Math.random()/100,\n splashFactor: 2,\n spread: 7,\n blend: 1,\n dimX: 1,\n dimY: 1,\n cut: true,\n textureAlphaBlend: false\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6800000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!WyiMXpscxVhgE1zy" +} diff --git a/src/packs/_source/tmMacros/34-t03-blood-bath-splash.json b/src/packs/_source/tmMacros/34-t03-blood-bath-splash.json new file mode 100644 index 0000000..a751dd9 --- /dev/null +++ b/src/packs/_source/tmMacros/34-t03-blood-bath-splash.json @@ -0,0 +1,24 @@ +{ + "_id": "CRwxsDAsfCkXXTOa", + "name": "34 - T03 - Blood Bath (splash)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/34%20-%20T03%20-%20Blood%20Bath%20%28splash%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"splash\",\n filterId: \"mySplash\",\n color: 0xFF0505,\n padding: 80,\n time: 0,\n seed: 0.10,\n splashFactor: 2.25,\n spread: 7,\n blend: 7,\n dimX: 1,\n dimY: 1,\n alphaBlending: false,\n alphaDiscard: true,\n cut: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 2300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!CRwxsDAsfCkXXTOa" +} diff --git a/src/packs/_source/tmMacros/35-t01-fire-v2-xfire.json b/src/packs/_source/tmMacros/35-t01-fire-v2-xfire.json new file mode 100644 index 0000000..bd3dc88 --- /dev/null +++ b/src/packs/_source/tmMacros/35-t01-fire-v2-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "URV08yIJk4cBTppj", + "name": "35 - T01 - Fire v2 (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T01%20-%20Fire%20v2%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myFireV2XFire\",\n time: 0,\n blend: 1,\n amplitude: 1,\n dispersion: 0,\n chromatic: false,\n scaleX: 1.5,\n scaleY: 1,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!URV08yIJk4cBTppj" +} diff --git a/src/packs/_source/tmMacros/35-t02-chromatic-fire-xfire.json b/src/packs/_source/tmMacros/35-t02-chromatic-fire-xfire.json new file mode 100644 index 0000000..35c4e4c --- /dev/null +++ b/src/packs/_source/tmMacros/35-t02-chromatic-fire-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "9FRCMHBW6OsUXDwz", + "name": "35 - T02 - Chromatic Fire (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T02%20-%20Chromatic%20Fire%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myChromaticXFire\",\n time: 0,\n blend: 2,\n amplitude: 1.1,\n dispersion: 0,\n chromatic: true,\n scaleX: 1,\n scaleY: 1,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 1600000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!9FRCMHBW6OsUXDwz" +} diff --git a/src/packs/_source/tmMacros/35-t03-sparks-xfire.json b/src/packs/_source/tmMacros/35-t03-sparks-xfire.json new file mode 100644 index 0000000..f453530 --- /dev/null +++ b/src/packs/_source/tmMacros/35-t03-sparks-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "GKxtep2eo55zKl1Z", + "name": "35 - T03 - Sparks (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T03%20-%20Sparks%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"mySparksXFire\",\n time: 0,\n blend: 2,\n amplitude: 0.7,\n dispersion: 0,\n chromatic: false,\n scaleX: 2,\n scaleY: 2,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 3400000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!GKxtep2eo55zKl1Z" +} diff --git a/src/packs/_source/tmMacros/35-t04-cold-fire-xfire.json b/src/packs/_source/tmMacros/35-t04-cold-fire-xfire.json new file mode 100644 index 0000000..0df80ca --- /dev/null +++ b/src/packs/_source/tmMacros/35-t04-cold-fire-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "hC63QbO6aATjatSA", + "name": "35 - T04 - Cold Fire (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T04%20-%20Cold%20Fire%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myColdXFire\",\n time: 0,\n color: 0xBBDDEE,\n blend: 1,\n amplitude: 1,\n dispersion: 0,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 8700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!hC63QbO6aATjatSA" +} diff --git a/src/packs/_source/tmMacros/35-t05-black-fire-xfire.json b/src/packs/_source/tmMacros/35-t05-black-fire-xfire.json new file mode 100644 index 0000000..dd0b7e3 --- /dev/null +++ b/src/packs/_source/tmMacros/35-t05-black-fire-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "Zvg3xCOOPTtPH1MY", + "name": "35 - T05 - Black Fire (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T05%20-%20Black%20Fire%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myBlackXFire\",\n time: 0,\n color: 0x707070,\n blend: 11,\n amplitude: 1,\n dispersion: 2.2,\n chromatic: false,\n scaleX: 2.5,\n scaleY: 2,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Zvg3xCOOPTtPH1MY" +} diff --git a/src/packs/_source/tmMacros/35-t06-custom-color-fire-xfire.json b/src/packs/_source/tmMacros/35-t06-custom-color-fire-xfire.json new file mode 100644 index 0000000..94b31dc --- /dev/null +++ b/src/packs/_source/tmMacros/35-t06-custom-color-fire-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "llpMoa9rOjeCzWf3", + "name": "35 - T06 - Custom Color Fire (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T06%20-%20Custom%20Color%20Fire%20%28xfire%29.webp", + "scope": "global", + "command": "// example with color fine tuning\nlet params =\n[{\n filterType: \"xfire\",\n filterId: \"myCustomXFire\",\n time: 0,\n color1: 0x00DD20,\n color2: 0x009090,\n color3: 0x001020,\n color4: 0x00CCFF,\n blend: 1,\n amplitude: 1,\n dispersion: 0,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 9700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!llpMoa9rOjeCzWf3" +} diff --git a/src/packs/_source/tmMacros/35-t07-superfrost-xfire.json b/src/packs/_source/tmMacros/35-t07-superfrost-xfire.json new file mode 100644 index 0000000..d551570 --- /dev/null +++ b/src/packs/_source/tmMacros/35-t07-superfrost-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "TUyzBYb350Gcn5rE", + "name": "35 - T07 - SuperFrost (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T07%20-%20SuperFrost%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"mySuperFrost\",\n color: 0xACC5C5,\n time: 0,\n blend: 5,\n amplitude: 1,\n dispersion: 0,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: true,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0020, \n animType: \"move\" \n } \n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 5900000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!TUyzBYb350Gcn5rE" +} diff --git a/src/packs/_source/tmMacros/35-t08-animated-superfrost-xfire-xglow.json b/src/packs/_source/tmMacros/35-t08-animated-superfrost-xfire-xglow.json new file mode 100644 index 0000000..02d5b40 --- /dev/null +++ b/src/packs/_source/tmMacros/35-t08-animated-superfrost-xfire-xglow.json @@ -0,0 +1,24 @@ +{ + "_id": "TktbnfMR7IIWewbg", + "name": "35 - T08 - Animated SuperFrost (xfire+xglow)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T08%20-%20Animated%20SuperFrost%20%28xfire%2Bxglow%29.webp", + "scope": "global", + "command": "let params =\n [{\n filterType: \"zapshadow\",\n filterId: \"myAnimSuperFrost\",\n alphaTolerance: 0.50\n },\n {\n filterType: \"xfire\",\n filterId: \"myAnimSuperFrost\",\n color: 0xACC5C5,\n time: 0,\n blend: 5,\n amplitude: 1,\n dispersion: 0,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: true,\n animated:\n {\n time:\n {\n active: true,\n speed: -0.0020,\n animType: \"move\"\n },\n dispersion:\n {\n animType: \"cosOscillation\",\n val1: 0.25,\n val2: 0.55,\n loopDuration: 3000\n }\n }\n },\n {\n filterType: \"xglow\",\n filterId: \"myAnimSuperFrost\",\n auraType: 1,\n color: 0x6090AA,\n thickness: 4.5,\n scale: 10,\n time: 0,\n auraIntensity: 0.25,\n subAuraIntensity: 1,\n threshold: 0.5,\n discard: false,\n animated:\n {\n time:\n {\n active: true,\n speed: 0.0018,\n animType: \"move\"\n },\n thickness:\n {\n val1: 2, val2: 2.5,\n animType: \"cosOscillation\",\n loopDuration: 3000\n },\n subAuraIntensity:\n {\n val1: 0.45, val2: 0.65,\n animType: \"cosOscillation\",\n loopDuration: 6000\n },\n auraIntensity:\n {\n val1: 0.9, val2: 1.1,\n animType: \"cosOscillation\",\n loopDuration: 3000\n }\n }\n }];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 6000000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!TktbnfMR7IIWewbg" +} diff --git a/src/packs/_source/tmMacros/35-t09-superheat-xfire.json b/src/packs/_source/tmMacros/35-t09-superheat-xfire.json new file mode 100644 index 0000000..95b725b --- /dev/null +++ b/src/packs/_source/tmMacros/35-t09-superheat-xfire.json @@ -0,0 +1,24 @@ +{ + "_id": "2l4UxekocRzIzaPE", + "name": "35 - T09 - SuperHeat (xfire)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T09%20-%20SuperHeat%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"mySuperHeat\",\n time: 0,\n blend: 5,\n amplitude: 0.25,\n dispersion: -1,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: true,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0090, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 300000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!2l4UxekocRzIzaPE" +} diff --git a/src/packs/_source/tmMacros/35-t10-animated-superheat-xfire-liquid-wave.json b/src/packs/_source/tmMacros/35-t10-animated-superheat-xfire-liquid-wave.json new file mode 100644 index 0000000..26972b4 --- /dev/null +++ b/src/packs/_source/tmMacros/35-t10-animated-superheat-xfire-liquid-wave.json @@ -0,0 +1,24 @@ +{ + "_id": "eBGBaCFsLO8b3lMb", + "name": "35 - T10 - Animated SuperHeat (xfire+liquid+wave)", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T10%20-%20Animated%20SuperHeat%20%28xfire%2Bliquid%2Bwave%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myAnimSuperHeat\",\n time: 0,\n blend: 5,\n amplitude: 0.5,\n dispersion: -1,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: true,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0090, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"liquid\",\n filterId: \"myAnimSuperHeat\",\n color: 0xBB9500,\n time: 0,\n blend: 8,\n intensity: 1,\n spectral: false,\n scale: 0.25,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0010, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"wave\",\n filterId: \"myAnimSuperHeat\",\n time: 0,\n anchorX: 0.5,\n anchorY: 0.5,\n strength: 0.005,\n frequency: 60,\n color: 0xFFFFFF,\n maxIntensity: 2.0,\n minIntensity: 1.0,\n padding:10,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0100, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 7900000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!eBGBaCFsLO8b3lMb" +} diff --git a/src/packs/_source/tmMacros/36-t01-turn-into-mystery-man-polymorph.json b/src/packs/_source/tmMacros/36-t01-turn-into-mystery-man-polymorph.json new file mode 100644 index 0000000..d22c154 --- /dev/null +++ b/src/packs/_source/tmMacros/36-t01-turn-into-mystery-man-polymorph.json @@ -0,0 +1,24 @@ +{ + "_id": "lZefFMIYs8WYRpdZ", + "name": "36 - T01 - Turn into Mystery Man (polymorph)", + "type": "script", + "flags": {}, + "scope": "global", + "command": "// This macro contains a small tutorial : how to work with non-infinite loops and halfCosOscillation animType\n\n// Click once to transform your token and again to revert to the original shape (thank to halfCosOscillation)\n\n// There is 9 types of metamorphose\n// 1 - Simple transition\n// 2 - Dreamy\n// 3 - Twist\n// 4 - Water drop\n// 5 - TV Noise\n// 6 - Morphing\n// 7 - Take off/Put on you disguise!\n// 8 - Wind\n// 9 - Hologram\n\n// change the type here\nlet transitionType = 4;\n\n// change the target image here\nlet targetImagePath = \"icons/svg/mystery-man.svg\";\n\n// declare filter id (think to change the id for personal macros)\n// each filterId should be unique to a player or gm to prevent collisions\n// example : \"brutusChthulhuPolymorph\"\nlet polymorphFilterId = \"myPolymorph\";\n\n// we put our code into an async function that will be called later\nlet polymorphFunc = async function () {\n\n for (const token of canvas.tokens.controlled) {\n let params;\n \n // Is the filter already activated on the placeable ? \n if (token.TMFXhasFilterId(polymorphFilterId)) {\n \n // Yes. So we update the type in the general section and loops + active in the progress animated section, to activate the animation for just one loop.\n // \"type\" to allow you to change the animation type\n // \"active\" to say at Token Magic : \"Hey filter! It's time to work again!\"\n // \"loops\" so that Token Magic can know how many loops it needs to schedule for the animation.\n // Each animation loop decreases \"loops\" by one. When \"loops\" reach 0, \"active\" becomes \"false\" and the animation will be dormant again.\n // Thank to the halfCosOscillation, a loop brings the value of the property from val1 to val2. A second loop is needed to bring val2 to val1. This is useful for monitoring progress with back and forth movements.\n params =\n [{\n filterType: \"polymorph\",\n filterId: polymorphFilterId,\n type: transitionType,\n animated:\n {\n progress:\n {\n active: true,\n loops: 1\n }\n }\n }];\n\n } else {\n\n // No. So we create the entirety of the filter\n params =\n [{\n filterType: \"polymorph\",\n filterId: polymorphFilterId,\n type: transitionType,\n padding: 70,\n magnify: 1,\n imagePath: targetImagePath,\n animated:\n {\n progress:\n {\n active: true,\n animType: \"halfCosOscillation\",\n val1: 0,\n val2: 100,\n loops: 1,\n loopDuration: 1000\n }\n }\n }];\n }\n\n // all functions that add, update or delete filters are asynchronous\n // if you are in a loop AND/OR you chain these functions, it is MANDATORY to await them\n // otherwise, data persistence may not works.\n // this is the reason why we use an async function (we cant use await in a non-async function)\n // avoid awaiting in a forEach loop, use \"for\" or \"for/of\" loop.\n await token.TMFXaddUpdateFilters(params);\n }\n\n};\n\n// polymorph async function call\npolymorphFunc();", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/36%20-%20T01%20-%20Turn%20into%20Mystery%20Man%20%28polymorph%29.webp", + "ownership": { + "default": 0 + }, + "folder": null, + "sort": 9600000, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!lZefFMIYs8WYRpdZ" +} diff --git a/src/packs/_source/tmMacros/37-t01-ioun-stone-sprite.json b/src/packs/_source/tmMacros/37-t01-ioun-stone-sprite.json new file mode 100644 index 0000000..af947fa --- /dev/null +++ b/src/packs/_source/tmMacros/37-t01-ioun-stone-sprite.json @@ -0,0 +1,24 @@ +{ + "_id": "vd2sFikounQpg6nh", + "name": "37 - T01 - Ioun Stone (sprite)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/37%20-%20T01%20-%20Ioun%20Stone%20%28sprite%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"sprite\",\n filterId: \"mySprite\",\n imagePath: \"modules/tokenmagic/fx/assets/gem-2.png\",\n gridPadding: 1,\n scaleX: 0.20,\n scaleY: 0.20,\n colorize: true,\n color: 0xFFBB00,\n inverse: false,\n top: true,\n animated:\n {\n rotation: \n { \n active: true,\n clockWise: false, \n loopDuration: 2000, \n animType: \"syncRotation\"\n },\n translationX:\n {\n active: true,\n animType: \"cosOscillation\",\n val1: 2.0,\n val2: -2.0,\n loopDuration: 4000,\n },\n translationY:\n {\n active: true,\n animType: \"sinOscillation\",\n val1: 2.0,\n val2: -2.0,\n loopDuration: 4000,\n },\n color:\n {\n active: true,\n animType: \"colorOscillation\",\n val1: 0xFFFF00,\n val2: 0x00FFFF,\n loopDuration: 4000,\n }\n }\n}];\n\nawait TokenMagic.addFiltersOnSelected(params);", + "folder": null, + "sort": 10900000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!vd2sFikounQpg6nh" +} diff --git a/src/packs/_source/tmMacros/37-t02-pentagram-sprite.json b/src/packs/_source/tmMacros/37-t02-pentagram-sprite.json new file mode 100644 index 0000000..fcc3f6c --- /dev/null +++ b/src/packs/_source/tmMacros/37-t02-pentagram-sprite.json @@ -0,0 +1,24 @@ +{ + "_id": "sIy0tlSrWhG7m15h", + "name": "37 - T02 - Pentagram (sprite)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/37%20-%20T02%20-%20Pentagram%20%28sprite%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"sprite\",\n filterId: \"myPentagram\",\n imagePath: \"modules/tokenmagic/fx/assets/pentagram.png\",\n gridPadding: 2,\n scaleX: 3,\n scaleY: 3,\n colorize: true,\n color: 0xFF0000,\n inverse: true,\n top: false,\n animated:\n {\n rotation: \n { \n active: true,\n clockWise: false, \n loopDuration: 4000, \n animType: \"syncRotation\"\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 10000000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!sIy0tlSrWhG7m15h" +} diff --git a/src/packs/_source/tmMacros/37-t03-fire-pentagram-sprite-xglow.json b/src/packs/_source/tmMacros/37-t03-fire-pentagram-sprite-xglow.json new file mode 100644 index 0000000..3f19ede --- /dev/null +++ b/src/packs/_source/tmMacros/37-t03-fire-pentagram-sprite-xglow.json @@ -0,0 +1,24 @@ +{ + "_id": "4cniAQdp0uQ4vE3G", + "name": "37 - T03 - Fire Pentagram (sprite+xglow)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/37%20-%20T03%20-%20Fire%20Pentagram%20%28sprite%2Bxglow%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"sprite\",\n filterId: \"myFirePentagram\",\n imagePath: \"modules/tokenmagic/fx/assets/pentagram.png\",\n gridPadding: 2,\n scaleX: 3,\n scaleY: 3,\n colorize: true,\n color: 0x000000,\n inverse: true,\n top: false,\n animated:\n {\n rotation: \n { \n active: true,\n clockWise: false, \n loopDuration: 4000, \n animType: \"syncRotation\"\n }\n }\n},\n{\n filterType: \"zapshadow\",\n filterId: \"myFirePentagram\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myFirePentagram\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 1.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1.5,\n threshold: 0.40,\n discard: true,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:5\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 900000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!4cniAQdp0uQ4vE3G" +} diff --git a/src/packs/_source/tmMacros/38-replace-color.json b/src/packs/_source/tmMacros/38-replace-color.json new file mode 100644 index 0000000..3666b6a --- /dev/null +++ b/src/packs/_source/tmMacros/38-replace-color.json @@ -0,0 +1,28 @@ +{ + "name": "38 - Replace Color", + "type": "script", + "author": "SyH1ydCe6TgtPGAR", + "img": "icons/magic/time/arrows-circling-pink.webp", + "scope": "global", + "command": "async function applyFilter() {\n\tlet params = [\n\t\t{\n\t\t\tfilterType: 'replaceColor',\n\t\t\tfilterId: 'ReplaceColor',\n\t\t\toriginalColor: PIXI.utils.hex2rgb(originalColor),\n\t\t\tnewColor: PIXI.utils.hex2rgb(newColor),\n\t\t\tepsilon,\n\t\t},\n\t];\n\n\tawait TokenMagic.addUpdateFiltersOnSelected(params);\n}\n\nlet originalColor = 0xff0000;\nlet newColor = 0x00ff00;\nlet epsilon = 0.7;\n\nconst filter = TokenMagic.getControlledPlaceables()[0].children.find((child) => child.filters?.[0]?.filterId === 'ReplaceColor')?.filters[0];\nif (filter) {\n\toriginalColor = PIXI.utils.rgb2hex(filter.uniforms.originalColor);\n\tnewColor = PIXI.utils.rgb2hex(filter.uniforms.newColor);\n\tepsilon = filter.uniforms.epsilon;\n}\n\nconst originalColorString = PIXI.utils.hex2string(originalColor);\nconst newColorString = PIXI.utils.hex2string(newColor);\n\nnew Dialog(\n\t{\n\t\ttitle: 'Replace Color',\n\t\tcontent: `\n
    \n

    Select the parameters you wish to change

    \n
    \n \n
    \n \n \n \n
    \n
    \n \n \n \n
    \n
    \n \n \n ${epsilon}\n \n
    \n
    \n `,\n\t\tbuttons: {\n\t\t\tsave: {\n\t\t\t\ticon: ``,\n\t\t\t\tlabel: 'Set',\n\t\t\t\tcallback: async (html) => applyFilter(),\n\t\t\t},\n\t\t\tcancel: {\n\t\t\t\ticon: ``,\n\t\t\t\tlabel: 'Cancel',\n\t\t\t\tcallback: async (html) => {\n\t\t\t\t\tif (!filter) TokenMagic.deleteFiltersOnSelected();\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tdefault: 'yes',\n\t\trender: (html) => {\n\t\t\tfunction updateFilterParams() {\n\t\t\t\toriginalColor = PIXI.utils.string2hex(html.querySelector('#originalColorText').value);\n\t\t\t\tnewColor = PIXI.utils.string2hex(html.querySelector('#replacementColorText').value);\n\t\t\t\tepsilon = +html.querySelector('input[name=tolerance]').value;\n\n\t\t\t\tapplyFilter();\n\t\t\t}\n\n\t\t\tconst oldColor = html.querySelector('input[name=originalColor]');\n\t\t\tconst oldColorBar = html.querySelector('#originalColorText');\n\t\t\tconst replacementColor = html.querySelector('input[name=replacementColor]');\n\t\t\tconst replacementColorBar = html.querySelector('#replacementColorText');\n\t\t\tconst tolerance = html.querySelector('input[name=tolerance]');\n\t\t\tconst toleranceSpan = html.querySelector('#toleranceSpan');\n\n\t\t\toldColor.addEventListener('change', (ev) => (oldColorBar.value = ev.target.value));\n\t\t\toldColorBar.addEventListener('change', (ev) => (oldColor.value = ev.target.value));\n\t\t\treplacementColor.addEventListener('change', (ev) => (replacementColorBar.value = ev.target.value));\n\t\t\treplacementColorBar.addEventListener('change', (ev) => (replacementColor.value = ev.target.value));\n\t\t\ttolerance.addEventListener('change', (ev) => (toleranceSpan.textContent = ev.target.value));\n\t\t\thtml.addEventListener('change', () => updateFilterParams());\n\n\t\t\tapplyFilter();\n\t\t},\n\t},\n\t{ jQuery: false }\n).render(true);", + "folder": null, + "sort": 11900000, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "_id": "zLsUrLWfdJn7BjTw", + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!zLsUrLWfdJn7BjTw" +} diff --git a/src/packs/_source/tmMacros/39-dungeondraft-tint.json b/src/packs/_source/tmMacros/39-dungeondraft-tint.json new file mode 100644 index 0000000..5f8baf9 --- /dev/null +++ b/src/packs/_source/tmMacros/39-dungeondraft-tint.json @@ -0,0 +1,24 @@ +{ + "name": "39 - DungeonDraft Tint", + "type": "script", + "author": "SyH1ydCe6TgtPGAR", + "img": "icons/magic/light/hand-sparks-smoke-green.webp", + "scope": "global", + "command": "async function applyFilter() {\n\tlet params = [\n\t\t{\n\t\t\tfilterType: 'ddTint',\n\t\t\tfilterId: 'DDTint',\n\t\t\ttint: PIXI.utils.hex2rgb(color),\n\t\t},\n\t];\n\n\tawait TokenMagic.addUpdateFiltersOnSelected(params);\n}\n\nlet color = 0xff0000;\n\nconst filter = TokenMagic.getControlledPlaceables()[0].children.find((child) => child.filters?.[0]?.filterId === 'DDTint')?.filters[0];\nif (filter) color = PIXI.utils.rgb2hex(filter.uniforms.tint);\n\nconst colorString = PIXI.utils.hex2string(color);\n\nnew Dialog(\n\t{\n\t\ttitle: 'Dungeondraft Tint',\n\t\tcontent: `\n
    \n
    \n \n \n \n
    \n
    \n `,\n\t\tbuttons: {\n\t\t\tsave: {\n\t\t\t\ticon: ``,\n\t\t\t\tlabel: 'Set',\n\t\t\t\tcallback: async (html) => applyFilter(),\n\t\t\t},\n\t\t\tcancel: {\n\t\t\t\ticon: ``,\n\t\t\t\tlabel: 'Cancel',\n\t\t\t\tcallback: async (html) => {\n\t\t\t\t\tif (!filter) TokenMagic.deleteFiltersOnSelected();\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tdefault: 'save',\n\t\trender: (html) => {\n\t\t\tfunction updateFilterParams() {\n\t\t\t\tcolor = PIXI.utils.string2hex(html.querySelector('#colorText').value);\n\n\t\t\t\tapplyFilter();\n\t\t\t}\n\n\t\t\tconst oldColor = html.querySelector('input[name=color]');\n\t\t\tconst oldColorBar = html.querySelector('#colorText');\n\n\t\t\toldColor.addEventListener('change', (ev) => (oldColorBar.value = ev.target.value));\n\t\t\toldColorBar.addEventListener('change', (ev) => (oldColor.value = ev.target.value));\n\t\t\thtml.addEventListener('change', () => updateFilterParams());\n\n\t\t\tapplyFilter();\n\t\t},\n\t},\n\t{ jQuery: false }\n).render(true);", + "folder": null, + "sort": 11500000, + "flags": {}, + "_id": "ySVgJ0j9REhxaF5O", + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!ySVgJ0j9REhxaF5O" +} diff --git a/src/packs/_source/tmMacros/40-ascii-ascii.json b/src/packs/_source/tmMacros/40-ascii-ascii.json new file mode 100644 index 0000000..bf0d2de --- /dev/null +++ b/src/packs/_source/tmMacros/40-ascii-ascii.json @@ -0,0 +1,30 @@ +{ + "name": "40 - Ascii (ascii)", + "type": "script", + "author": "UTH9wXZFkTza6igr", + "img": "modules/tokenmagic/gui/macros/images/40%20-%20Ascii.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"ascii\",\n filterId: \"myAscii\",\n size: 8\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "flags": { + "advanced-macros": { + "runAsGM": false, + "runForEveryone": false, + "runForSpecificUser": "" + } + }, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1669130213391, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "folder": null, + "sort": 7500000, + "_id": "bt4FUt1RboVkjk2W", + "_key": "!macros!bt4FUt1RboVkjk2W" +} diff --git a/src/packs/_source/tmMacros/41-dot-shade-dot.json b/src/packs/_source/tmMacros/41-dot-shade-dot.json new file mode 100644 index 0000000..829547b --- /dev/null +++ b/src/packs/_source/tmMacros/41-dot-shade-dot.json @@ -0,0 +1,24 @@ +{ + "name": "41 - Dot Shade (dot)", + "type": "script", + "scope": "global", + "author": "UTH9wXZFkTza6igr", + "img": "modules/tokenmagic/gui/macros/images/41%20-%20Dot.webp", + "command": "let params =\n[{\n filterType: \"dot\",\n filterId: \"myDot\",\n scale: 1,\n angle: 5,\n grayscale: true,\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "ownership": { + "default": 0 + }, + "flags": {}, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1673706034119, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "folder": null, + "sort": 2500000, + "_id": "D2d0BpOjnTSbzeOt", + "_key": "!macros!D2d0BpOjnTSbzeOt" +} diff --git a/src/packs/_source/tmMacros/42-crt-monitor-crt.json b/src/packs/_source/tmMacros/42-crt-monitor-crt.json new file mode 100644 index 0000000..2374fe1 --- /dev/null +++ b/src/packs/_source/tmMacros/42-crt-monitor-crt.json @@ -0,0 +1,24 @@ +{ + "name": "42 - CRT Monitor (crt)", + "type": "script", + "scope": "global", + "author": "UTH9wXZFkTza6igr", + "img": "modules/tokenmagic/gui/macros/images/42%20-%20CRT.webp", + "command": "let params = [\n {\n filterType: \"crt\",\n filterId: \"myCRT\",\n curvature: 4,\n lineWidth: 5,\n lineContrast: 0.25,\n verticalLine: false,\n noise: 0.3,\n noiseSize: 1,\n vignetting: 0,\n vignettingAlpha: 1,\n vignettingBlur: 0.3,\n animated: {\n seed: {\n active: true,\n animType: \"randomNumber\",\n val1: 0,\n val2: 1\n },\n time: {\n active: true,\n speed: -0.01,\n animType: \"move\"\n },\n vignetting: {\n active: false,\n animType: \"syncCosOscillation\",\n loopDuration: 2000,\n val1: 0.1,\n val2: 0.2\n }\n },\n enabled: true\n },\n {\n filterType: \"outline\",\n filterId: \"crtOutline\",\n color: 0,\n thickness: 0,\n zOrder: 321,\n enabled: true\n }\n];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "ownership": { + "default": 0 + }, + "flags": {}, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1673706658449, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "folder": null, + "sort": 4500000, + "_id": "JZzR087czwBFJOFC", + "_key": "!macros!JZzR087czwBFJOFC" +} diff --git a/src/packs/_source/tmMacros/43-rgb-split-rgbsplit.json b/src/packs/_source/tmMacros/43-rgb-split-rgbsplit.json new file mode 100644 index 0000000..4a32460 --- /dev/null +++ b/src/packs/_source/tmMacros/43-rgb-split-rgbsplit.json @@ -0,0 +1,24 @@ +{ + "name": "43 - RGB Split (rgbSplit)", + "type": "script", + "scope": "global", + "author": "UTH9wXZFkTza6igr", + "img": "modules/tokenmagic/gui/macros/images/43%20-%20RGB%20Split.webp", + "command": "let params = [\n {\n filterType: \"rgbSplit\",\n filterId: \"myRGBSplit\",\n redX: -10,\n redY: 0,\n greenX: 0,\n greenY: 10,\n blueX: 0,\n blueY: 0,\n enabled: true\n }\n];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "ownership": { + "default": 0 + }, + "flags": {}, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1673711141092, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "folder": null, + "sort": 1000000, + "_id": "5tUn35zYzB7m8sLN", + "_key": "!macros!5tUn35zYzB7m8sLN" +} diff --git a/src/packs/_source/tmMacros/44-criss-cross-overlay-sprite.json b/src/packs/_source/tmMacros/44-criss-cross-overlay-sprite.json new file mode 100644 index 0000000..7eb8a1e --- /dev/null +++ b/src/packs/_source/tmMacros/44-criss-cross-overlay-sprite.json @@ -0,0 +1,24 @@ +{ + "name": "44 - Criss-Cross Overlay (sprite)", + "type": "script", + "scope": "global", + "author": "UTH9wXZFkTza6igr", + "img": "modules/tokenmagic/gui/macros/images/44%20-%20Criss%20Cross%20Overlay%20(sprite).webp", + "command": "let params = [\n {\n filterType: \"sprite\",\n filterId: \"crissCrossBox\",\n imagePath: \"modules/tokenmagic/fx/assets/box.webp\",\n repeat: true,\n alphaDiscard: true,\n colorize: true,\n color: 0x0000FF,\n inverse: true,\n gridPadding: 1,\n maintainAspectRatio: false,\n maintainScale: false,\n scaleX: 0.16,\n scaleY: 0.16,\n translationX: 0,\n translationY: 0,\n rotation: 45,\n alpha: 0.75,\n top: true,\n animated: {\n rotation: {\n active: false,\n clockWise: false,\n loopDuration: 30000,\n animType: \"syncRotation\"\n }\n },\n }\n];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "ownership": { + "default": 0 + }, + "flags": {}, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1673888263584, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "folder": null, + "sort": 4400000, + "_id": "Izk5Ewj7YLcPO75x", + "_key": "!macros!Izk5Ewj7YLcPO75x" +} diff --git a/src/packs/_source/tmMacros/45-star-mask-spritemask.json b/src/packs/_source/tmMacros/45-star-mask-spritemask.json new file mode 100644 index 0000000..dd4ad59 --- /dev/null +++ b/src/packs/_source/tmMacros/45-star-mask-spritemask.json @@ -0,0 +1,24 @@ +{ + "name": "45 - Star Mask (spriteMask)", + "type": "script", + "scope": "global", + "author": "cDfy4cFieNjb5vsL", + "img": "modules/tokenmagic/gui/macros/images/45%20-%20Star%20Mask%20(spriteMask).webp", + "command": "let params = [\n {\n \"filterType\": \"spriteMask\",\n \"filterId\": \"starMask\",\n \"imagePath\": \"modules/tokenmagic/fx/assets/star.webp\",\n \"repeat\": false,\n \"gridPadding\": 1,\n \"maintainAspectRatio\": false,\n \"maintainScale\": false,\n \"scaleX\": 1,\n \"scaleY\": 1,\n \"translationX\": 0,\n \"translationY\": 0,\n \"rotation\": 0,\n \"alpha\": 1,\n \"rank\": 10000,\n \"enabled\": true\n }\n];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "ownership": { + "default": 0 + }, + "flags": {}, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1694556128271, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_id": "8Lb6g8Tm1navvZbM", + "sort": 10600000, + "_key": "!macros!8Lb6g8Tm1navvZbM" +} diff --git a/src/packs/_source/tmMacros/a-multi-filters-example.json b/src/packs/_source/tmMacros/a-multi-filters-example.json new file mode 100644 index 0000000..f2fe6c8 --- /dev/null +++ b/src/packs/_source/tmMacros/a-multi-filters-example.json @@ -0,0 +1,24 @@ +{ + "_id": "tvDGSwbeQ97HNS8v", + "name": "A - Multi-Filters Example", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/A%20-%20Multi-Filters%20Example.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fog\",\n color: 0x00FF50,\n density: 0.20,\n time: 0,\n animated :\n {\n time : \n { \n active: true, \n speed: 1.2, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"ray\",\n time: 0,\n color: 0x00DE50,\n alpha: 0.25,\n divisor: 32,\n anchorY: 0,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0005, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"glow\",\n distance: 10,\n outerStrength: 8,\n innerStrength: 0,\n color: 0x003000,\n quality: 0.5,\n padding: 10,\n animated:\n {\n color: \n {\n active: true, \n loopDuration: 3000, \n animType: \"colorOscillation\", \n val1:0x003000, \n val2:0x00EF00\n }\n }\n}\n];\n\nawait TokenMagic.addFiltersOnSelected(params);", + "folder": null, + "sort": 10700000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!tvDGSwbeQ97HNS8v" +} diff --git a/src/packs/_source/tmMacros/b-multi-filters-example.json b/src/packs/_source/tmMacros/b-multi-filters-example.json new file mode 100644 index 0000000..1aff8b2 --- /dev/null +++ b/src/packs/_source/tmMacros/b-multi-filters-example.json @@ -0,0 +1,24 @@ +{ + "_id": "eJnsq5g4Pldh8Z6Q", + "name": "B - Multi-Filters Example", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/B%20-%20Multi-Filters%20Example.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"distortion\",\n maskPath: \"modules/tokenmagic/fx/assets/waves-2.png\",\n maskSpriteScaleX: 7,\n maskSpriteScaleY: 7,\n padding: 50,\n animated:\n {\n maskSpriteX: { active: true, speed: 0.05, animType: \"move\" },\n maskSpriteY: { active: true, speed: 0.07, animType: \"move\" }\n }\n},\n{\n filterType: \"ray\",\n time: 0,\n color: 0xEF9000,\n alpha: 0.25,\n divisor: 32,\n anchorY: 1,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0005, \n animType: \"move\" \n }\n }\n},\n{\n filterType: \"glow\",\n distance: 10,\n outerStrength: 8,\n innerStrength: 0,\n color: 0xB03000,\n quality: 0.5,\n animated:\n {\n color: \n {\n active: true, \n loopDuration: 3000, \n animType: \"colorOscillation\", \n val1:0xB03000, \n val2:0xFFD010\n }\n }\n}\n];\n\nawait TokenMagic.addFiltersOnSelected(params);", + "folder": null, + "sort": 8100000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!eJnsq5g4Pldh8Z6Q" +} diff --git a/src/packs/_source/tmMacros/c-electric-multi-filters.json b/src/packs/_source/tmMacros/c-electric-multi-filters.json new file mode 100644 index 0000000..334b22d --- /dev/null +++ b/src/packs/_source/tmMacros/c-electric-multi-filters.json @@ -0,0 +1,24 @@ +{ + "_id": "Ia0tPcllVQq96yXF", + "name": "C - Electric Multi-Filters", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/C%20-%20Electric%20Multi-Filters.webp", + "scope": "global", + "command": "// works better with tokens or tiles with no shadows\nlet params =\n[{\n filterType: \"shadow\",\n blur: 2,\n quality: 5,\n distance: 0,\n alpha: 1.,\n padding: 100,\n color: 0xFFFFFF,\n animated:\n {\n blur: \n { \n active: true, \n loopDuration: 500, \n animType: \"syncCosOscillation\", \n val1: 2, \n val2: 4\n },\n }\n},\n{\n filterType: \"electric\",\n color: 0xFFFFFF,\n time: 0,\n blend: 2,\n intensity: 5,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0020, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addFiltersOnSelected(params);", + "folder": null, + "sort": 4200000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Ia0tPcllVQq96yXF" +} diff --git a/src/packs/_source/tmMacros/d-auto-destroy-example.json b/src/packs/_source/tmMacros/d-auto-destroy-example.json new file mode 100644 index 0000000..274a646 --- /dev/null +++ b/src/packs/_source/tmMacros/d-auto-destroy-example.json @@ -0,0 +1,24 @@ +{ + "_id": "HjzhkTFUng8sxWkH", + "name": "D - Auto-Destroy Example", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/D%20-%20Auto-Destroy%20Example.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"bevel\",\n autoDestroy: true,\n rotation: 0,\n thickness: 5,\n lightColor: 0x00FF00,\n lightAlpha: 0.7,\n shadowColor: 0xFF0000,\n shadowAlpha: 0.4,\n animated :\n {\n rotation: \n { \n active: true,\n clockWise: true, \n loopDuration: 1000,\n loops: 5,\n animType: \"rotation\"\n }\n }\n}];\n\nawait TokenMagic.addFiltersOnSelected(params);", + "folder": null, + "sort": 3900000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!HjzhkTFUng8sxWkH" +} diff --git a/src/packs/_source/tmMacros/e-click-click-click-and-click.json b/src/packs/_source/tmMacros/e-click-click-click-and-click.json new file mode 100644 index 0000000..e9d2bc9 --- /dev/null +++ b/src/packs/_source/tmMacros/e-click-click-click-and-click.json @@ -0,0 +1,24 @@ +{ + "_id": "BGz9j7xPy0H2QlBf", + "name": "E - Click, click, click and click !", + "type": "script", + "author": "Njc5YzFjZDI5NjZl", + "img": "modules/tokenmagic/gui/macros/images/E%20-%20Click%2C%20click%2C%20click%20and%20click%20%21.webp", + "scope": "global", + "command": "let glowFunc = async function() {\n\n const myTokens = canvas.tokens.placeables;\n\n for (const myToken of myTokens ){\n if (myToken.TMFXhasFilterId(\"funnyAlternateGlow\")) {\n await myToken.TMFXdeleteFilters(\"funnyAlternateGlow\");\n } else {\n let params =\n [{\n filterType: \"glow\",\n filterId: \"funnyAlternateGlow\",\n color: Math.floor(Math.random() * 16777215),\n animated: null\n }];\n await myToken.TMFXaddUpdateFilters(params);\n }\n }\n};\n\nglowFunc();", + "folder": null, + "sort": 2000000, + "flags": {}, + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!BGz9j7xPy0H2QlBf" +} diff --git a/src/packs/_source/tmMacros/f-03-export-fx-presets.json b/src/packs/_source/tmMacros/f-03-export-fx-presets.json new file mode 100644 index 0000000..d8c0189 --- /dev/null +++ b/src/packs/_source/tmMacros/f-03-export-fx-presets.json @@ -0,0 +1,24 @@ +{ + "_id": "Ku4jBl972O7hHczs", + "name": "F - 03 - Export FX Presets", + "type": "script", + "flags": {}, + "scope": "global", + "command": "TokenMagic.exportPresetLibrary();", + "author": "Njc5YzFjZDI5NjZl", + "img": "icons/svg/dice-target.svg", + "ownership": { + "default": 0 + }, + "folder": null, + "sort": 4600000, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!Ku4jBl972O7hHczs" +} diff --git a/src/packs/_source/tmMacros/f-04-import-fx-presets-local.json b/src/packs/_source/tmMacros/f-04-import-fx-presets-local.json new file mode 100644 index 0000000..e9e0666 --- /dev/null +++ b/src/packs/_source/tmMacros/f-04-import-fx-presets-local.json @@ -0,0 +1,24 @@ +{ + "_id": "QzFJd7hkaYesE7Ud", + "name": "F - 04 - Import FX Presets (local)", + "type": "script", + "flags": {}, + "scope": "global", + "command": "// Open the console (F12) to check the state of the import\r\n// You can configure in the module option panel the \"overwrite mode on import\"\r\n\r\nTokenMagic.importPresetLibrary();", + "author": "Njc5YzFjZDI5NjZl", + "img": "icons/svg/dice-target.svg", + "ownership": { + "default": 0 + }, + "folder": null, + "sort": 5200000, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!QzFJd7hkaYesE7Ud" +} diff --git a/src/packs/_source/tmMacros/f-05-import-fx-presets-url.json b/src/packs/_source/tmMacros/f-05-import-fx-presets-url.json new file mode 100644 index 0000000..9eeb5f0 --- /dev/null +++ b/src/packs/_source/tmMacros/f-05-import-fx-presets-url.json @@ -0,0 +1,24 @@ +{ + "_id": "sZmVZvLEYmlEC1bK", + "name": "F - 05 - Import FX Presets (URL)", + "type": "script", + "flags": {}, + "scope": "global", + "command": "// Replace the dummy url with a valid url that points to a Token Magic FX presets file (json)\r\n// Open the console (F12) to check the state of the import\r\n// You can configure in the module option panel the \"overwrite mode on import\"\r\n\r\n// TokenMagic.importPresetLibraryFromURL(\"https://presets-to-import-url\");\r\n\r\nui.notifications.warn(\"Open this macro and read the instructions.\");", + "author": "Njc5YzFjZDI5NjZl", + "img": "icons/svg/dice-target.svg", + "ownership": { + "default": 0 + }, + "folder": null, + "sort": 10100000, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!sZmVZvLEYmlEC1bK" +} diff --git a/src/packs/_source/tmMacros/f-06-export-template-settings.json b/src/packs/_source/tmMacros/f-06-export-template-settings.json new file mode 100644 index 0000000..bbe5212 --- /dev/null +++ b/src/packs/_source/tmMacros/f-06-export-template-settings.json @@ -0,0 +1,24 @@ +{ + "name": "F - 06 - Export Template Settings", + "type": "script", + "author": "jkj278HJluWLWiGt", + "img": "icons/svg/dice-target.svg", + "scope": "global", + "command": "TokenMagic.exportTemplateSettings();", + "folder": null, + "sort": 9200000, + "flags": {}, + "_id": "jMhvaRGK3hAufND8", + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!jMhvaRGK3hAufND8" +} diff --git a/src/packs/_source/tmMacros/f-07-import-template-settings-local.json b/src/packs/_source/tmMacros/f-07-import-template-settings-local.json new file mode 100644 index 0000000..d7ea33d --- /dev/null +++ b/src/packs/_source/tmMacros/f-07-import-template-settings-local.json @@ -0,0 +1,24 @@ +{ + "name": "F - 07 - Import Template Settings (local)", + "type": "script", + "author": "jkj278HJluWLWiGt", + "img": "icons/svg/dice-target.svg", + "scope": "global", + "command": "// Open the console (F12) to check the state of the import\n\nTokenMagic.importTemplateSettings();", + "folder": null, + "sort": 11300000, + "flags": {}, + "_id": "xlBIisESJPU1nSxw", + "ownership": { + "default": 0 + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": null, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "_key": "!macros!xlBIisESJPU1nSxw" +} diff --git a/src/packs/_source/tmMacros/g-randomization-example.json b/src/packs/_source/tmMacros/g-randomization-example.json new file mode 100644 index 0000000..5998634 --- /dev/null +++ b/src/packs/_source/tmMacros/g-randomization-example.json @@ -0,0 +1,29 @@ +{ + "name": "G - Randomization Example", + "type": "script", + "author": "UTH9wXZFkTza6igr", + "img": "modules/tokenmagic/gui/macros/images/G%20-%20Randomization%20Example.webp", + "scope": "global", + "command": "// This sprite filter contains randomized 'imagePath', 'scaleX', 'scaleY', 'rotation' and 'alpha' parameters.\n// - 'imagePath' sources a random path from the provided array\n// - The rest of params will generate a random value using ranges:\n// - 'val1' and 'val2' define the range for the randomized value\n// - 'step' defines the increment, step of 0.1 for example with range 0 to 1 would produce 0.1, 0.4, 0.2, 0.9, etc. \n// while a step of 10 with a range of 50 to 400 would produce 70, 50, 340, 200, etc.\n// - 'link' provides a way to set another parameter to the same randomized value, which is useful when for example setting scale which consists of two components x and y\n\nlet params = [\n {\n filterType: \"sprite\",\n filterId: \"randomOverlay\",\n repeat: true,\n alphaDiscard: true,\n inverse: true,\n gridPadding: 1,\n translationX: 0,\n translationY: 0,\n top: true,\n randomized: {\n imagePath: [\n \"modules/tokenmagic/fx/assets/distortion-1.png\",\n \"modules/tokenmagic/fx/assets/dots-1.png\",\n \"modules/tokenmagic/fx/assets/extrusion-1.png\",\n \"modules/tokenmagic/fx/assets/noise-2.jpg\",\n \"modules/tokenmagic/fx/assets/symbols-1.png\",\n \"modules/tokenmagic/fx/assets/waves-1.png\",\n ],\n scaleX: { val1: 0.1, val2: 0.6, step: 0.01, link: 'scaleY' },\n rotation: { val1: 0, val2: 360, step: 1 },\n alpha: { val1: 0.5, val2: 1.0, step: 0.1 }\n },\n }\n];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "ownership": { + "default": 0 + }, + "flags": { + "scene-packer": { + "hash": "8e77b72fb122ec185881742084f1a3ebf7ee7ed7", + "sourceId": "Macro.oiRoT64pfS1mVnXH" + } + }, + "_stats": { + "systemId": "dnd5e", + "systemVersion": "2.3.1", + "coreVersion": "11.308", + "createdTime": 1676649619562, + "modifiedTime": 1695296911423, + "lastModifiedBy": "packsbuilder0000" + }, + "folder": null, + "sort": 800000, + "_id": "4aMgnzj0WHUx054m", + "_key": "!macros!4aMgnzj0WHUx054m" +} diff --git a/src/packs/_source/tmSampleCompendium/19-t01-fire.json b/src/packs/_source/tmSampleCompendium/19-t01-fire.json new file mode 100644 index 0000000..de516d8 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/19-t01-fire.json @@ -0,0 +1,17 @@ +{ + "_id": "EdOz5OYVcgHEhraW", + "name": "19 - T01 - Fire", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/19%20-%20T01%20-%20Fire.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fire\",\n filterId: \"myFire\",\n intensity: 1,\n color: 0xFFFFFF,\n amplitude: 1,\n time: 0,\n blend: 2,\n fireBlend : 1,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n },\n intensity:\n {\n active:true,\n loopDuration: 15000,\n val1: 0.8,\n val2: 2,\n animType: \"syncCosOscillation\"\n },\n amplitude:\n {\n active:true,\n loopDuration: 4400,\n val1: 1,\n val2: 1.4,\n animType: \"syncCosOscillation\"\n }\n \n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!EdOz5OYVcgHEhraW" +} diff --git a/src/packs/_source/tmSampleCompendium/19-t02-devouring-fire.json b/src/packs/_source/tmSampleCompendium/19-t02-devouring-fire.json new file mode 100644 index 0000000..820a9bb --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/19-t02-devouring-fire.json @@ -0,0 +1,17 @@ +{ + "_id": "c5S9Ew0kvgMZU0Bg", + "name": "19 - T02 - Devouring Fire", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/19%20-%20T02%20-%20Devouring%20Fire.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fire\",\n filterId: \"myFire\",\n intensity: 3,\n color: 0xFFFFFF,\n amplitude: 2,\n time: 0,\n blend: 10,\n fireBlend : 1,\n alphaDiscard: true,\n zOrder: 50,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n }\n }\n},{\n filterType: \"glow\",\n filterId: \"glowripples\",\n outerStrength: 4,\n innerStrength: 2,\n color: 0xAA6500,\n quality: 0.5,\n padding: 10,\n zOrder: 100,\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!c5S9Ew0kvgMZU0Bg" +} diff --git a/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-2.json b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-2.json new file mode 100644 index 0000000..47b3523 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-2.json @@ -0,0 +1,17 @@ +{ + "_id": "nij9Xlo2wbJWM5fV", + "name": "24 - T02 - Fire Shield 2", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield%202.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myFireField\",\n shieldType: 1,\n gridPadding: 2,\n color: 0xE58550,\n time: 0,\n blend: 2,\n intensity: 1.2,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.5,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!nij9Xlo2wbJWM5fV" +} diff --git a/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-3-ring.json b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-3-ring.json new file mode 100644 index 0000000..3a20130 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-3-ring.json @@ -0,0 +1,17 @@ +{ + "_id": "Wu2N6ToVJUKVKTvj", + "name": "24 - T02 - Fire Shield 3 - Ring", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield%203%20-%20Ring.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myZap\",\n alphaTolerance: 0.45\n},{\n filterType: \"field\",\n filterId: \"myFireField\",\n shieldType: 1,\n gridPadding: 1.1,\n color: 0xE58550,\n time: 0,\n blend: 2,\n intensity: 1.2,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.9,\n hideRadius: 0.95,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n},{\n filterType: \"xglow\",\n filterId: \"myBurningAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 4.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1.5,\n threshold: 0.40,\n discard: true,\n zOrder: 3000,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:5\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!Wu2N6ToVJUKVKTvj" +} diff --git a/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-4-lava-zone.json b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-4-lava-zone.json new file mode 100644 index 0000000..1c071f7 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield-4-lava-zone.json @@ -0,0 +1,17 @@ +{ + "_id": "Nnty2Oba51s6pLYd", + "name": "24 - T02 - Fire Shield 4 - Lava Zone", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield%204%20-%20Lava%20Zone.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myZap\",\n alphaTolerance: 0.45\n},{\n filterType: \"field\",\n filterId: \"myLavaRing\",\n shieldType: 6,\n gridPadding: 1.25,\n color: 0xFFAA00,\n time: 0,\n blend: 14,\n intensity: 1,\n lightAlpha: 0,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n discardThreshold: 0.30,\n hideRadius: 0.95,\n alphaDiscard: true,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n },\n radius: \n {\n active: true, \n loopDuration: 6000, \n animType: \"cosOscillation\", \n val1:1, \n val2:0.8\n },\n hideRadius: \n {\n active: true, \n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:0.75, \n val2:0.4\n }\n }\n},{\n filterType: \"xglow\",\n filterId: \"myBurningAura\",\n auraType: 2,\n color: 0xFF5000,\n thickness: 9.8,\n scale: 1.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1,\n threshold: 0.30,\n discard: true,\n zOrder: 3000,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 600, \n animType: \"cosOscillation\", \n val1:4, \n val2:8\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!Nnty2Oba51s6pLYd" +} diff --git a/src/packs/_source/tmSampleCompendium/24-t02-fire-shield.json b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield.json new file mode 100644 index 0000000..63fde1d --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/24-t02-fire-shield.json @@ -0,0 +1,17 @@ +{ + "_id": "WcwNyVbYeHm24XgI", + "name": "24 - T02 - Fire Shield", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/24%20-%20T02%20-%20Fire%20Shield.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"field\",\n filterId: \"myFireField\",\n shieldType: 1,\n gridPadding: 2,\n color: 0xE58550,\n time: 0,\n blend: 2,\n intensity: 1.2,\n lightAlpha: 1,\n lightSize: 0.7,\n scale: 1,\n radius: 1,\n chromatic: false,\n zOrder: 512,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!WcwNyVbYeHm24XgI" +} diff --git a/src/packs/_source/tmSampleCompendium/27-t01-burning-aura-xglow.json b/src/packs/_source/tmSampleCompendium/27-t01-burning-aura-xglow.json new file mode 100644 index 0000000..da4343a --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/27-t01-burning-aura-xglow.json @@ -0,0 +1,17 @@ +{ + "_id": "ygP4EwZGwIChqLwG", + "name": "27 - T01 - Burning Aura (xglow)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T01%20-%20Burning%20Aura%20%28xglow%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myZapShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myBurningAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 4.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1.5,\n threshold: 0.40,\n discard: true,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:5\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!ygP4EwZGwIChqLwG" +} diff --git a/src/packs/_source/tmSampleCompendium/27-t04-pure-fire-xglow-fire.json b/src/packs/_source/tmSampleCompendium/27-t04-pure-fire-xglow-fire.json new file mode 100644 index 0000000..76d8dd6 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/27-t04-pure-fire-xglow-fire.json @@ -0,0 +1,21 @@ +{ + "_id": "AvE297PJ7nRJiyb9", + "name": "27 - T04 - Pure Fire (xglow+fire)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T04%20-%20Pure%20Fire%20%28xglow%2Bfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"fire\",\n filterId: \"myPureFire\",\n intensity: 1,\n color: 0xFFFFFF,\n amplitude: 1,\n time: 0,\n blend: 2,\n fireBlend : 1,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n },\n intensity:\n {\n active:true,\n loopDuration: 15000,\n val1: 0.8,\n val2: 2,\n animType: \"syncCosOscillation\"\n },\n amplitude:\n {\n active:true,\n loopDuration: 4400,\n val1: 1,\n val2: 1.4,\n animType: \"syncCosOscillation\"\n }\n \n }\n},\n{\n filterType: \"zapshadow\",\n filterId: \"myPureFireShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myPureFireAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 4.,\n time: 0,\n auraIntensity: 2,\n subAuraIntensity: 1.5,\n threshold: 0.40,\n discard: true,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:5\n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": { + "furnace": { + "runAsGM": false + } + }, + "_key": "!macros!AvE297PJ7nRJiyb9" +} diff --git a/src/packs/_source/tmSampleCompendium/27-t05-pure-fire-v2-xglow-fire.json b/src/packs/_source/tmSampleCompendium/27-t05-pure-fire-v2-xglow-fire.json new file mode 100644 index 0000000..6cfd6ed --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/27-t05-pure-fire-v2-xglow-fire.json @@ -0,0 +1,17 @@ +{ + "_id": "uFJIpXbBGRl1NY83", + "name": "27 - T05 - Pure Fire v2 (xglow+fire)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/27%20-%20T05%20-%20Pure%20Fire%20v2%20%28xglow%2Bfire%29.webp", + "scope": "global", + "command": "// In this version, the glow is blending with the fire\n// This is to show that the order of the filters is important\nlet params =\n[{\n filterType: \"zapshadow\",\n filterId: \"myPureFireShadow\",\n alphaTolerance: 0.50\n},\n{\n filterType: \"xglow\",\n filterId: \"myPureFireAura\",\n auraType: 2,\n color: 0x903010,\n thickness: 9.8,\n scale: 3.,\n time: 0,\n auraIntensity: 1,\n subAuraIntensity: 0.3,\n threshold: 0.25,\n discard: true,\n animated:\n {\n time : \n { \n active: true,\n speed: 0.0027, \n animType: \"move\" \n },\n thickness:\n {\n active: true,\n loopDuration: 3000, \n animType: \"cosOscillation\", \n val1:2, \n val2:3.6\n }\n }\n},\n{\n filterType: \"fire\",\n filterId: \"myPureFire\",\n intensity: 1,\n color: 0xFFFFFF,\n amplitude: 1,\n time: 0,\n blend: 2,\n fireBlend : 1,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0024, \n animType: \"move\" \n },\n intensity:\n {\n active:true,\n loopDuration: 15000,\n val1: 0.8,\n val2: 3,\n animType: \"syncCosOscillation\"\n },\n amplitude:\n {\n active:true,\n loopDuration: 4400,\n val1: 1,\n val2: 1.6,\n animType: \"syncCosOscillation\"\n }\n \n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!uFJIpXbBGRl1NY83" +} diff --git a/src/packs/_source/tmSampleCompendium/32-t01-solar-ripples-ripples.json b/src/packs/_source/tmSampleCompendium/32-t01-solar-ripples-ripples.json new file mode 100644 index 0000000..9a88400 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/32-t01-solar-ripples-ripples.json @@ -0,0 +1,17 @@ +{ + "_id": "A1qb9Vho5PFpPwOr", + "name": "32 - T01 - Solar Ripples (ripples)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/32%20-%20T01%20-%20Solar%20Ripples%20%28ripples%29.webp", + "scope": "global", + "command": "let params = \n[{\n filterType: \"ripples\",\n filterId: \"SolarRipples\",\n color: 0xCC9000,\n time: 0,\n alphaDiscard: false,\n animated :\n {\n time : \n { \n active: true, \n speed: 0.0009, \n animType: \"move\" \n }\n }\n}]\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!A1qb9Vho5PFpPwOr" +} diff --git a/src/packs/_source/tmSampleCompendium/35-t01-fire-v2-xfire.json b/src/packs/_source/tmSampleCompendium/35-t01-fire-v2-xfire.json new file mode 100644 index 0000000..eec90dd --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/35-t01-fire-v2-xfire.json @@ -0,0 +1,17 @@ +{ + "_id": "9qImMNihwv8V9Qho", + "name": "35 - T01 - Fire v2 (xfire)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T01%20-%20Fire%20v2%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myFireV2XFire\",\n time: 0,\n blend: 1,\n amplitude: 1,\n dispersion: 0,\n chromatic: false,\n scaleX: 1.5,\n scaleY: 1,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!9qImMNihwv8V9Qho" +} diff --git a/src/packs/_source/tmSampleCompendium/35-t02-chromatic-fire-xfire.json b/src/packs/_source/tmSampleCompendium/35-t02-chromatic-fire-xfire.json new file mode 100644 index 0000000..cf00dc5 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/35-t02-chromatic-fire-xfire.json @@ -0,0 +1,17 @@ +{ + "_id": "rzC68R0rMzIlzKw1", + "name": "35 - T02 - Chromatic Fire (xfire)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T02%20-%20Chromatic%20Fire%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myChromaticXFire\",\n time: 0,\n blend: 2,\n amplitude: 1.1,\n dispersion: 0,\n chromatic: true,\n scaleX: 1,\n scaleY: 1,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!rzC68R0rMzIlzKw1" +} diff --git a/src/packs/_source/tmSampleCompendium/35-t04-cold-fire-xfire.json b/src/packs/_source/tmSampleCompendium/35-t04-cold-fire-xfire.json new file mode 100644 index 0000000..4ddea46 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/35-t04-cold-fire-xfire.json @@ -0,0 +1,17 @@ +{ + "_id": "8aHbX9wGc5ih56Gx", + "name": "35 - T04 - Cold Fire (xfire)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T04%20-%20Cold%20Fire%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myColdXFire\",\n time: 0,\n color: 0xBBDDEE,\n blend: 1,\n amplitude: 1,\n dispersion: 0,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!8aHbX9wGc5ih56Gx" +} diff --git a/src/packs/_source/tmSampleCompendium/35-t05-black-fire-xfire.json b/src/packs/_source/tmSampleCompendium/35-t05-black-fire-xfire.json new file mode 100644 index 0000000..e0ebfde --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/35-t05-black-fire-xfire.json @@ -0,0 +1,17 @@ +{ + "_id": "HsMz9DNe78RVAI9y", + "name": "35 - T05 - Black Fire (xfire)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T05%20-%20Black%20Fire%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"myBlackXFire\",\n time: 0,\n color: 0x707070,\n blend: 11,\n amplitude: 1,\n dispersion: 2.2,\n chromatic: false,\n scaleX: 2.5,\n scaleY: 2,\n inlay: false,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0015, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!HsMz9DNe78RVAI9y" +} diff --git a/src/packs/_source/tmSampleCompendium/35-t09-superheat-xfire.json b/src/packs/_source/tmSampleCompendium/35-t09-superheat-xfire.json new file mode 100644 index 0000000..08f8511 --- /dev/null +++ b/src/packs/_source/tmSampleCompendium/35-t09-superheat-xfire.json @@ -0,0 +1,17 @@ +{ + "_id": "bRUq2B72Idhb4uVR", + "name": "35 - T09 - SuperHeat (xfire)", + "type": "script", + "author": "f8mJy0XxrFT8Pzt3", + "img": "modules/tokenmagic/gui/macros/images/35%20-%20T09%20-%20SuperHeat%20%28xfire%29.webp", + "scope": "global", + "command": "let params =\n[{\n filterType: \"xfire\",\n filterId: \"mySuperHeat\",\n time: 0,\n blend: 5,\n amplitude: 0.25,\n dispersion: -1,\n chromatic: false,\n scaleX: 1,\n scaleY: 1,\n inlay: true,\n animated :\n {\n time : \n { \n active: true, \n speed: -0.0090, \n animType: \"move\" \n }\n }\n}];\n\nawait TokenMagic.addUpdateFiltersOnSelected(params);", + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "f8mJy0XxrFT8Pzt3": 3 + }, + "flags": {}, + "_key": "!macros!bRUq2B72Idhb4uVR" +} diff --git a/src/packs/token-magic-portfolio/000202.ldb b/src/packs/tmMacros/000202.ldb similarity index 100% rename from src/packs/token-magic-portfolio/000202.ldb rename to src/packs/tmMacros/000202.ldb diff --git a/src/packs/tmMacros/CURRENT b/src/packs/tmMacros/CURRENT new file mode 100644 index 0000000..45d010a --- /dev/null +++ b/src/packs/tmMacros/CURRENT @@ -0,0 +1 @@ +MANIFEST-000393 diff --git a/src/packs/token-magic-book-of-fire/LOCK b/src/packs/tmMacros/LOCK similarity index 100% rename from src/packs/token-magic-book-of-fire/LOCK rename to src/packs/tmMacros/LOCK diff --git a/src/packs/tmMacros/LOG b/src/packs/tmMacros/LOG new file mode 100644 index 0000000..3dac3bb --- /dev/null +++ b/src/packs/tmMacros/LOG @@ -0,0 +1,3 @@ +2024/05/13-17:42:02.236 8ba0 Recovering log #392 +2024/05/13-17:42:02.241 8ba0 Delete type=0 #392 +2024/05/13-17:42:02.241 8ba0 Delete type=3 #391 diff --git a/src/packs/tmMacros/LOG.old b/src/packs/tmMacros/LOG.old new file mode 100644 index 0000000..8878027 --- /dev/null +++ b/src/packs/tmMacros/LOG.old @@ -0,0 +1,3 @@ +2024/05/13-17:42:02.221 8ba0 Recovering log #389 +2024/05/13-17:42:02.226 8ba0 Delete type=0 #389 +2024/05/13-17:42:02.226 8ba0 Delete type=3 #387 diff --git a/src/packs/token-magic-portfolio/MANIFEST-000387 b/src/packs/tmMacros/MANIFEST-000393 similarity index 71% rename from src/packs/token-magic-portfolio/MANIFEST-000387 rename to src/packs/tmMacros/MANIFEST-000393 index ad178b139ac51a867de1841cb983f6895de77ce6..8ce7a298710d8f6a83f63f397b5b74c1e38f009e 100644 GIT binary patch delta 25 gcmdnYxR7x|ztDtcS!ZqrMy4)iP6p;~W|psv09Th9fz delta 41 rcmbQoxSnxBuafwR<;%Dj7?~QGIT@Inm|6G_e-yn95@-Smv;YMF@TLi@ diff --git a/src/packs/token-magic-book-of-fire/CURRENT b/src/packs/token-magic-book-of-fire/CURRENT deleted file mode 100644 index 70d8a3a..0000000 --- a/src/packs/token-magic-book-of-fire/CURRENT +++ /dev/null @@ -1 +0,0 @@ -MANIFEST-000384 diff --git a/src/packs/token-magic-book-of-fire/LOG b/src/packs/token-magic-book-of-fire/LOG deleted file mode 100644 index d690091..0000000 --- a/src/packs/token-magic-book-of-fire/LOG +++ /dev/null @@ -1,7 +0,0 @@ -2023/11/01-09:21:40.153 41d8 Recovering log #382 -2023/11/01-09:21:40.159 41d8 Delete type=0 #382 -2023/11/01-09:21:40.160 41d8 Delete type=3 #380 -2023/11/01-10:26:08.102 4384 Level-0 table #387: started -2023/11/01-10:26:08.102 4384 Level-0 table #387: 0 bytes OK -2023/11/01-10:26:08.105 4384 Delete type=0 #385 -2023/11/01-10:26:08.105 4384 Manual compaction at level-0 from '!macros!8aHbX9wGc5ih56Gx' @ 72057594037927935 : 1 .. '!macros!ygP4EwZGwIChqLwG' @ 0 : 0; will stop at (end) diff --git a/src/packs/token-magic-book-of-fire/LOG.old b/src/packs/token-magic-book-of-fire/LOG.old deleted file mode 100644 index 9215945..0000000 --- a/src/packs/token-magic-book-of-fire/LOG.old +++ /dev/null @@ -1,7 +0,0 @@ -2023/10/28-19:22:08.164 234c Recovering log #378 -2023/10/28-19:22:08.169 234c Delete type=0 #378 -2023/10/28-19:22:08.169 234c Delete type=3 #376 -2023/10/28-19:22:53.794 5a5c Level-0 table #383: started -2023/10/28-19:22:53.795 5a5c Level-0 table #383: 0 bytes OK -2023/10/28-19:22:53.796 5a5c Delete type=0 #381 -2023/10/28-19:22:53.797 5a5c Manual compaction at level-0 from '!macros!8aHbX9wGc5ih56Gx' @ 72057594037927935 : 1 .. '!macros!ygP4EwZGwIChqLwG' @ 0 : 0; will stop at (end) diff --git a/src/packs/token-magic-portfolio/CURRENT b/src/packs/token-magic-portfolio/CURRENT deleted file mode 100644 index 99be12b..0000000 --- a/src/packs/token-magic-portfolio/CURRENT +++ /dev/null @@ -1 +0,0 @@ -MANIFEST-000387 diff --git a/src/packs/token-magic-portfolio/LOG b/src/packs/token-magic-portfolio/LOG deleted file mode 100644 index 0c303c1..0000000 --- a/src/packs/token-magic-portfolio/LOG +++ /dev/null @@ -1,7 +0,0 @@ -2023/11/01-09:21:40.130 2900 Recovering log #385 -2023/11/01-09:21:40.136 2900 Delete type=0 #385 -2023/11/01-09:21:40.136 2900 Delete type=3 #383 -2023/11/01-10:26:08.099 4384 Level-0 table #390: started -2023/11/01-10:26:08.099 4384 Level-0 table #390: 0 bytes OK -2023/11/01-10:26:08.101 4384 Delete type=0 #388 -2023/11/01-10:26:08.105 4384 Manual compaction at level-0 from '!macros!0U6lS2hR1uMm7iFI' @ 72057594037927935 : 1 .. '!macros!zLsUrLWfdJn7BjTw' @ 0 : 0; will stop at (end) diff --git a/src/packs/token-magic-portfolio/LOG.old b/src/packs/token-magic-portfolio/LOG.old deleted file mode 100644 index a164645..0000000 --- a/src/packs/token-magic-portfolio/LOG.old +++ /dev/null @@ -1,7 +0,0 @@ -2023/10/28-19:22:08.152 3478 Recovering log #381 -2023/10/28-19:22:08.158 3478 Delete type=0 #381 -2023/10/28-19:22:08.159 3478 Delete type=3 #379 -2023/10/28-19:22:53.789 5a5c Level-0 table #386: started -2023/10/28-19:22:53.789 5a5c Level-0 table #386: 0 bytes OK -2023/10/28-19:22:53.790 5a5c Delete type=0 #384 -2023/10/28-19:22:53.791 5a5c Manual compaction at level-0 from '!macros!0U6lS2hR1uMm7iFI' @ 72057594037927935 : 1 .. '!macros!zLsUrLWfdJn7BjTw' @ 0 : 0; will stop at (end) diff --git a/utils/clean.mjs b/utils/clean.mjs new file mode 100644 index 0000000..15c9191 --- /dev/null +++ b/utils/clean.mjs @@ -0,0 +1,17 @@ +import fs from "fs"; +import path from "path"; + +// Clean output directory, or create build directory +const outDir = path.resolve(process.cwd(), "dist"); +if (fs.existsSync(outDir)) { + const filesToClean = fs.readdirSync(outDir).map((dirName) => path.resolve(outDir, dirName)); + for (const file of filesToClean) { + fs.rmSync(file, { recursive: true }); + } +} else { + fs.mkdirSync(outDir); +} + +// Delete static/packs dir to prevent overwrite during rebuilds (temporary backwards compatibility) +// const oldPacksDir = path.resolve(process.cwd(), "static/packs"); +// fs.rmSync(oldPacksDir, { recursive: true, force: true }); diff --git a/utils/packs.mjs b/utils/packs.mjs new file mode 100644 index 0000000..2fc7550 --- /dev/null +++ b/utils/packs.mjs @@ -0,0 +1,282 @@ + +import fs from "fs"; +import { readdir, readFile, writeFile } from "node:fs/promises"; +import logger from "fancy-log"; +import path from "path"; +import yargs from "yargs"; +import { hideBin } from "yargs/helpers"; +import { compilePack, extractPack } from "@foundryvtt/foundryvtt-cli"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const BASE_FULL_PATH_MODULE = path.resolve(path.join(path.resolve(__dirname, '..'),"src")); +const MODULE_JSON_FULL_PATH = path.join(BASE_FULL_PATH_MODULE,"module.json"); // MOD 4535992 + +/** + * Folder where the compiled compendium packs should be located relative to the + * base module folder. + * @type {string} + */ +const PACK_DEST = path.join(BASE_FULL_PATH_MODULE,"packs"); + +/** + * Folder where source JSON files should be located relative to the module folder. + * @type {string} + */ +const PACK_SRC = path.join(BASE_FULL_PATH_MODULE,"packs/_source"); + + +// eslint-disable-next-line +const argv = yargs(hideBin(process.argv)) + .command(packageCommand()) + .help().alias("help", "h") + .argv; + + +// eslint-disable-next-line +function packageCommand() { + return { + command: "package [action] [pack] [entry]", + describe: "Manage packages", + builder: yargs => { + yargs.positional("action", { + describe: "The action to perform.", + type: "string", + choices: ["unpack", "pack", "clean"] + }); + yargs.positional("pack", { + describe: "Name of the pack upon which to work.", + type: "string" + }); + yargs.positional("entry", { + describe: "Name of any entry within a pack upon which to work. Only applicable to extract & clean commands.", + type: "string" + }); + }, + handler: async argv => { + const { action, pack, entry } = argv; + switch ( action ) { + case "clean": + return await cleanPacks(pack, entry); + case "pack": + return await compilePacks(pack); + case "unpack": + return await extractPacks(pack, entry); + } + } + }; +} + + +/* ----------------------------------------- */ +/* Clean Packs */ +/* ----------------------------------------- */ + +/** + * Removes unwanted flags, permissions, and other data from entries before extracting or compiling. + * @param {object} data Data for a single entry to clean. + * @param {object} [options={}] + * @param {boolean} [options.clearSourceId=true] Should the core sourceId flag be deleted. + * @param {number} [options.ownership=0] Value to reset default ownership to. + */ +function cleanPackEntry(data, { clearSourceId=true, ownership=0 }={}) { + if ( data.ownership ) data.ownership = { default: ownership }; + if ( clearSourceId ) delete data.flags?.core?.sourceId; + delete data.flags?.importSource; + delete data.flags?.exportSource; + if ( data._stats?.lastModifiedBy ) data._stats.lastModifiedBy = "packsbuilder0000"; + + // Remove empty entries in flags + if ( !data.flags ) data.flags = {}; + Object.entries(data.flags).forEach(([key, contents]) => { + if (contents && Object.keys(contents).length === 0 ) delete data.flags[key]; + }); + + if ( data.system?.activation?.cost === 0 ) data.system.activation.cost = null; + if ( data.system?.duration?.value === "0" ) data.system.duration.value = ""; + if ( data.system?.target?.value === 0 ) data.system.target.value = null; + if ( data.system?.target?.width === 0 ) data.system.target.width = null; + if ( data.system?.range?.value === 0 ) data.system.range.value = null; + if ( data.system?.range?.long === 0 ) data.system.range.long = null; + if ( data.system?.uses?.value === 0 ) data.system.uses.value = null; + if ( data.system?.uses?.max === "0" ) data.system.duration.value = ""; + if ( data.system?.save?.dc === 0 ) data.system.save.dc = null; + if ( data.system?.capacity?.value === 0 ) data.system.capacity.value = null; + if ( data.system?.strength === 0 ) data.system.strength = null; + + // Remove mystery-man.svg from Actors + if ( ["character", "npc"].includes(data.type) && data.img === "icons/svg/mystery-man.svg" ) { + data.img = ""; + data.prototypeToken.texture.src = ""; + } + + if ( data.effects ) data.effects.forEach(i => cleanPackEntry(i, { clearSourceId: false })); + if ( data.items ) data.items.forEach(i => cleanPackEntry(i, { clearSourceId: false })); + if ( data.pages ) data.pages.forEach(i => cleanPackEntry(i, { ownership: -1 })); + if ( data.system?.description?.value ) data.system.description.value = cleanString(data.system.description.value); + if ( data.label ) data.label = cleanString(data.label); + if ( data.name ) data.name = cleanString(data.name); +} + + +/** + * Removes invisible whitespace characters and normalizes single- and double-quotes. + * @param {string} str The string to be cleaned. + * @returns {string} The cleaned string. + */ +function cleanString(str) { + return str.replace(/\u2060/gu, "").replace(/[‘’]/gu, "'").replace(/[“”]/gu, '"'); +} + + +/** + * Cleans and formats source JSON files, removing unnecessary permissions and flags and adding the proper spacing. + * @param {string} [packName] Name of pack to clean. If none provided, all packs will be cleaned. + * @param {string} [entryName] Name of a specific entry to clean. + * + * - `npm run build:clean` - Clean all source JSON files. + * - `npm run build:clean -- classes` - Only clean the source files for the specified compendium. + * - `npm run build:clean -- classes Barbarian` - Only clean a single item from the specified compendium. + */ +async function cleanPacks(packName, entryName) { + entryName = entryName?.toLowerCase(); + const folders = fs.readdirSync(PACK_SRC, { withFileTypes: true }).filter(file => + file.isDirectory() && ( !packName || (packName === file.name) ) + ); + + /** + * Walk through directories to find JSON files. + * @param {string} directoryPath + * @yields {string} + */ + async function* _walkDir(directoryPath) { + const directory = await readdir(directoryPath, { withFileTypes: true }); + for ( const entry of directory ) { + const entryPath = path.join(directoryPath, entry.name); + if ( entry.isDirectory() ) yield* _walkDir(entryPath); + else if ( path.extname(entry.name) === ".json" ) yield entryPath; + } + } + + for ( const folder of folders ) { + logger.info(`Cleaning pack ${folder.name}`); + for await ( const src of _walkDir(path.join(PACK_SRC, folder.name)) ) { + const json = JSON.parse(await readFile(src, { encoding: "utf8" })); + if ( entryName && (entryName !== json.name.toLowerCase()) ) continue; + if ( !json._id || !json._key ) { + console.log(`Failed to clean \x1b[31m${src}\x1b[0m, must have _id and _key.`); + continue; + } + cleanPackEntry(json); + fs.rmSync(src, { force: true }); + writeFile(src, `${JSON.stringify(json, null, 2)}\n`, { mode: 0o664 }); + } + } +} + + +/* ----------------------------------------- */ +/* Compile Packs */ +/* ----------------------------------------- */ + +/** + * Compile the source JSON files into compendium packs. + * @param {string} [packName] Name of pack to compile. If none provided, all packs will be packed. + * + * - `npm run build:db` - Compile all JSON files into their LevelDB files. + * - `npm run build:db -- classes` - Only compile the specified pack. + */ +async function compilePacks(packName) { + // Determine which source folders to process + const folders = fs.readdirSync(PACK_SRC, { withFileTypes: true }).filter(file => + file.isDirectory() && ( !packName || (packName === file.name) ) + ); + + for ( const folder of folders ) { + const src = path.join(PACK_SRC, folder.name); + const dest = path.join(PACK_DEST, folder.name); + logger.info(`Compiling pack ${folder.name}`); + await compilePack(src, dest, { recursive: true, log: true, transformEntry: cleanPackEntry }); + } +} + + +/* ----------------------------------------- */ +/* Extract Packs */ +/* ----------------------------------------- */ + +/** + * Extract the contents of compendium packs to JSON files. + * @param {string} [packName] Name of pack to extract. If none provided, all packs will be unpacked. + * @param {string} [entryName] Name of a specific entry to extract. + * + * - `npm build:json - Extract all compendium LevelDB files into JSON files. + * - `npm build:json -- classes` - Only extract the contents of the specified compendium. + * - `npm build:json -- classes Barbarian` - Only extract a single item from the specified compendium. + */ +async function extractPacks(packName, entryName) { + entryName = entryName?.toLowerCase(); + + // Load module.json. + const module = JSON.parse(fs.readFileSync(MODULE_JSON_FULL_PATH, { encoding: "utf8" })); // MOD 4535992 /src/module.json instead ./system.json and rename system to module + + // Determine which source packs to process. + const packs = module.packs.filter(p => !packName || p.name === packName); + + for ( const packInfo of packs ) { + const dest = path.join(PACK_SRC, packInfo.name); + const packInfoPath = path.join(PACK_DEST, packInfo.name); // MOD 4535992 + logger.info(`Extracting pack ${packInfo.name} from ${packInfoPath} to ${dest}`); + + const folders = {}; + const containers = {}; + await extractPack(packInfoPath, dest, { + log: false, transformEntry: e => { + if ( e._key.startsWith("!folders") ) folders[e._id] = { name: slugify(e.name), folder: e.folder }; + else if ( e.type === "container" ) containers[e._id] = { + name: slugify(e.name), container: e.system?.container, folder: e.folder + }; + return false; + } + }); + const buildPath = (collection, entry, parentKey) => { + let parent = collection[entry[parentKey]]; + entry.path = entry.name; + while ( parent ) { + entry.path = path.join(parent.name, entry.path); + parent = collection[parent[parentKey]]; + } + }; + Object.values(folders).forEach(f => buildPath(folders, f, "folder")); + Object.values(containers).forEach(c => { + buildPath(containers, c, "container"); + const folder = folders[c.folder]; + if ( folder ) c.path = path.join(folder.path, c.path); + }); + + await extractPack(packInfoPath, dest, { + log: true, transformEntry: entry => { + if ( entryName && (entryName !== entry.name.toLowerCase()) ) return false; + cleanPackEntry(entry); + }, transformName: entry => { + if ( entry._id in folders ) return path.join(folders[entry._id].path, "_folder.json"); + if ( entry._id in containers ) return path.join(containers[entry._id].path, "_container.json"); + const outputName = slugify(entry.name); + const parent = containers[entry.system?.container] ?? folders[entry.folder]; + return path.join(parent?.path ?? "", `${outputName}.json`); + } + }); + } +} + + +/** + * Standardize name format. + * @param {string} name + * @returns {string} + */ +function slugify(name) { + return name.toLowerCase().replace("'", "").replace(/[^a-z0-9]+/gi, " ").trim().replace(/\s+|-{2,}/g, "-"); +} diff --git a/vite.config.mjs b/vite.config.mjs index 9c94182..41cfeac 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -61,8 +61,8 @@ export default () => { css: { // Creates a standard configuration for PostCSS with autoprefixer & postcss-preset-env. - postcss: postcssConfig({ - compress: s_COMPRESS, + postcss: postcssConfig({ + compress: s_COMPRESS, sourceMap: s_SOURCEMAPS }), }, @@ -92,7 +92,7 @@ export default () => { "/socket.io": { target: "ws://127.0.0.1:30000", ws: true }, }, }, - + build: { outDir: normalizePath( path.resolve(__dirname, `./dist/${s_MODULE_ID}`)), // __dirname, emptyOutDir: false, @@ -169,12 +169,16 @@ export default () => { dest: normalizePath(path.resolve(__dirname, `./dist/${s_MODULE_ID}/styles`)), }, { - src: normalizePath(path.resolve(__dirname, './src/packs')) + '/[!.]*', + src: normalizePath(path.resolve(__dirname, './src/packs')) + '/[!.^(_?.*)]*', // + '/[!.^(_source)]*', dest: normalizePath(path.resolve(__dirname, `./dist/${s_MODULE_ID}/packs`)), }, { src: normalizePath(path.resolve(__dirname, './src/module.json')), dest: normalizePath(path.resolve(__dirname, `./dist/${s_MODULE_ID}/`)), + }, + { + src: normalizePath(path.resolve(__dirname, './src/scripts/libs')) + '/[!.]*', + dest: normalizePath(path.resolve(__dirname, `./dist/${s_MODULE_ID}/scripts/libs`)), }, ], }), @@ -193,14 +197,14 @@ export default () => { if (warning.message.includes(` element should have an href attribute`)) { return; } - + // Let Rollup handle all other warnings normally. handler(warning); }, }), resolve(s_RESOLVE_CONFIG), // Necessary when bundling npm-linked packages. - + // When s_TYPHONJS_MODULE_LIB is true transpile against the Foundry module version of TRL. s_TYPHONJS_MODULE_LIB && typhonjsRuntime(), diff --git a/images/Compendium.JPG b/wiki/images/Compendium.JPG similarity index 100% rename from images/Compendium.JPG rename to wiki/images/Compendium.JPG diff --git a/images/SimpleGUIMacro-01.jpg b/wiki/images/SimpleGUIMacro-01.jpg similarity index 100% rename from images/SimpleGUIMacro-01.jpg rename to wiki/images/SimpleGUIMacro-01.jpg diff --git a/images/template-settings-base.png b/wiki/images/template-settings-base.png similarity index 100% rename from images/template-settings-base.png rename to wiki/images/template-settings-base.png diff --git a/images/template-settings-overrides.png b/wiki/images/template-settings-overrides.png similarity index 100% rename from images/template-settings-overrides.png rename to wiki/images/template-settings-overrides.png diff --git a/images/template-settings.png b/wiki/images/template-settings.png similarity index 100% rename from images/template-settings.png rename to wiki/images/template-settings.png diff --git a/images/templates-ex.png b/wiki/images/templates-ex.png similarity index 100% rename from images/templates-ex.png rename to wiki/images/templates-ex.png