fantasycalendar / FoundryVTT-Sequencer

This module implements a basic pipeline that can be used for managing the flow of a set of functions, effects, sounds, and macros.
Other
41 stars 19 forks source link

[BUG] - duration() can't be used in a preset at the moment #179

Closed BenIsWassily closed 1 year ago

BenIsWassily commented 1 year ago

Describe the bug When using .duration() inside a preset, it throws an error.

To Reproduce Steps to reproduce the behavior:

  1. Create a preset with .duration() inside
    Sequencer.Presets.add("drop01", (effect, { aDuration = 2500, fInDuration = 200, fOutDuration = 1000, sDuration = 400 }={}) => {
      return effect
        .duration(aDuration)
        .fadeIn(fInDuration, { ease: "easeInSine" })
        .animateProperty("spriteContainer", "scale.x", { from: 4, to: 1, duration: sDuration, ease: "easeOutBounce" })
        .animateProperty("spriteContainer", "scale.y", { from: 4, to: 1, duration: sDuration, ease: "easeOutBounce" })
        .fadeOut(fOutDuration, { ease: "easeOutCirc" })
    });
  2. Use a macro to use the preset

    
    {
    let target = Array.from(game.user.targets)[0];  
    let scale = .5;
    
    new Sequence()
        .effect()
          .file("jb2a.icon.skull.dark_red")
          .atLocation(target)
          .scaleToObject(scale)
          .playbackRate(2)
          .preset("drop01")

.play() }


3. It should trigger the same error as shown below.

**Expected behavior**
`.duration()` being taken into account when used inside a preset without triggering an error.

**Screenshots**
![image](https://github.com/fantasycalendar/FoundryVTT-Sequencer/assets/34525955/0c81852e-bfb8-4291-91c0-108acf4a2400)

**Setup:**
 - Foundry Version: 10.291
 - System Version: DnD5e 2.2.1
 - Sequencer Version: 3.0.10
 - Browser & version: Google Chrome Version 114.0.5735.134 (Official Build) (64-bit)

**Active modules:**
 - Sequencer
 - socketlib
 - JB2A Patreon Collection
 - Tidy UI - Settings
Haxxer commented 1 year ago

Fixed in 3.0.11