Crazy idea: Button to convert existing generic Combat Log Event trigger to Custom trigger.
asaka-wa opened this issue · 7 comments
Is your feature request related to a problem? Please describe.
Not a problem exactly but it's quite frequent for people to have a mostly working Combat Log trigger but then need to expand it in some way that is going to require using a custom trigger. Would be nice to be able to click a button and have it created already.
Describe the solution you'd like
A nice button at the bottom of a Combat Log trigger that converts the trigger automagically :D
Additional context
To be fair, this was Infus's idea on the Discord so you should blame him.
We've actually made this significantly harder in the past few releases with the addition of delays and counts. Though it's still something I think would be nice to have.
Well I don't want such a button in general, as often the triggers do call WeakAuras functions that aren't public api. But for the CLEU trigger that might actually work and as the ticket correctly notes for the CLEU trigger this is actually somewhat of a common problem. So for that case, it's actually a happy concidence of being possible (I think) and being useful.
The other trigger for which that would be very common is the aura trigger, but that isn't possible at all.
Tangenting here to something that's less feasible, would be very neat if something similar could be done with %replacements. Just [click!] to have that replacement returned from a custom function instead.
Cute idea. We do generate a function string for triggers (including the combat log trigger) so at first glance this would be a matter of setting trigger.custom to the generated function string and changing trigger.type to custom. We wouldn’t even necessarily need to limit it to just combat log triggers.
I can see people clicking such an eject button by accident and freaking out though, so I think I would like an undo button first.
only offering it for one trigger is weird, many triggers could profit from it (if it's doable)
maybe some dropdown in event - custom - tsu? that adds the code (autofill templates)
What infus says is correct, many of our built in triggers use functions and code which is not exposed to custom code. Arguably we could change that but in the meantime it means adding an “eject to custom” button on everything isn’t particularly feasible today. So, at least for today adding it to only combat log trigger (or perhaps just event triggers) is probably enough.
But I do like the idea a lot, and I personally think it’s worth pursuing in the future.
I mentioned on Discord yesterday when this came up that the way Animations auto-fill their functions for you was pretty useful when I was first learning Lua. Especially because we used Animations so much back then. If combat log custom triggers could be added I really think that it provides a very smooth entry for people to get into the code stuff.
Status - Health trigger
▼
Event - Combat log trigger
▼
Eject to custom
▼
Custom triggers from scratch
There's a very tidy progression to that.