WeakAuras

WeakAuras

206M Downloads

"Flag" Condition Variable Type

emptyrivers opened this issue · 2 comments

commented

Is your feature request related to a problem? Please describe.

Sometimes it is desirable to perform an action when the trigger’s state changes. For example, someone might wish to play a sound when a charge of Ironskin Brew comes off cooldown. Currently, this is somewhat cumbersome to do, as you must add an event trigger to a cooldown tracking aura to achieve this.

Describe the solution you'd like

A new type of condition variable, which functions similarly to the changed and resort state flags do, would do the trick nicely. The trigger system would advertise a particular state variable as a flag, and then set that flag to true whenever it deems necessary (this would obviously depend on the specific trigger). When this flag is set, the condition system will take note of that in its condition checks, and then unset the flag once it is done making checks.

As for the UI, I think this would be particularly simple. There is only one bit of information here; “is the flag set?” Thus I think that the UI should not need any extra controls generated for flag variables.

Describe alternatives you've considered
Can’t think of anything specific.

commented

That's something I have considered a few times.

Some other use cases:

I think the a way to do that is to introduce a few more properties to the state, e.g. on cooldown progress:

  • timeReady
  • timeOnCd
  • timeChargeGained
  • timeChargeLost,
    which record the time point at which the cooldown last became ready, or gained a charge, etc.

And then add the ability to conditiuons to check if a certain time is e.g. < 1s.

That would work nicely for animations, glows, but be a bit akward for sounds and other actions.
(And obviously animations being controllable from conditons is another seprate big task.)

commented

I had a thought that this feature might open up the possibility to merge the actions tab into conditions. Not sure if that's a good idea or not, but might be worth investigating.