Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Idea] Split Init Action into 2 parts #223

Closed
emptyrivers opened this issue Jul 3, 2017 · 3 comments
Closed

[Idea] Split Init Action into 2 parts #223

emptyrivers opened this issue Jul 3, 2017 · 3 comments

Comments

@emptyrivers
Copy link
Contributor

For auras that are always shown, or are always loaded, this is a moot point. However, an aura that loads only in combat or in just one particular encounter may have code it wants to run at the beginning of each combat. Neither the On Show action nor the On Init action is sufficient for this task; Init scripts run exactly once per session (unless the aura is modified, of course), while Show scripts might run too late if the aura doesn't show immediately upon load.

Thus, I propose splitting the init action into 2 options: On init, which runs when the session begins (or when the aura is modified), and a new one; On Load, which is called from WeakAuras.LoadDisplay.

Currently you can emulate the behavior of the proposed On Load script by adding an always active trigger, and then setting a condition to run a custom action when that trigger is active (so immediately). However, not only is this hacky and invites kludges, it also doesn't work properly, since as I understand, custom condition actions will run after the On Show action.

@InfusOnWoW
Copy link
Contributor

How is a OnLoad custom code different from a custom trigger that reacts to e.g. combat entered event?

@emptyrivers
Copy link
Contributor Author

If you can guarantee that those events will fire even if load options restrict to specific encounters/combat, then that's acceptable to me.

@InfusOnWoW
Copy link
Contributor

They should. That is the aura should start receiving events starting with the event that lead to it being loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants