#How to use SetTexture to get an icon?
1 messages · Page 1 of 1 (latest)
and where
just make an icon aura?
and set a manual icon to whatever you want
if it has to be code, then get into custom triggers
the "multiple conditions" you talk about certainly coincide with some event logic
so you can make a custom trigger for that and use the "icon" code field to set the icon accordingly
(or make it as a TSU in the first place)
Trigger State Updater is an advanced custom trigger type that allows for the creation of clones, as well as generally being a very flexible custom trigger for almost all situations. While it is complex, the wiki aims to be thorough so please do use it.
https://github.com/WeakAuras/WeakAuras2/wiki/Trigger-State-Updater-(TSU)/
or click on the red help button inside the icon code field if you wanna use a "normal" custom trigger
then you have no real understanding of them
if you want to force the icon to change with code, you might as well make it as a standalone addon in the first place
you can set the icon by force with aura_env.region:SetIcon(iconId) from within an auras code, or with WeakAuras.GetRegion("regionName"):SetIcon(iconId) from outside.
in the future, just use vdt to inspect the aura region and see which functions you can use to edit it by force.
https://github.com/brittyazel/DevTool
Dump tables there with DevTool:AddData(table, "title")
you'll just be working against WA at that point
if you want to get into custom coding, you need bugsack and buggrabber anyways
so get on that
you'd use WeakAuras.GetRegion only if you want to edit some different auras region. if you want to edit it from within the same aura, you use aura_env.region
but really
I'd strongly recommend you to just read up a bit on custom triggers and save yourself a lot of work
alternatively, be willing to have several icon-elements live on the same spot, but have mutually exclusive load conditions.
for instance (hah!) i did this when wanting to be able to tell if I'm in a scenario, an instance, a raid. the load conditions have an easy check box for these, so i really only needed an icon of a plain sort.
There are many ways to do this.
Since they mentioned wanting to include code I brought up custom triggers.
But this way of directly editing the region is certainly not the best. You're working against WA itself like that.
There are inbuilt ways to set icons depending on different circumstances. If the conditions tab isn't preferable, then some custom triggers where you implement the logic to decide on the icon in the trigger function and then set the icon accordingly, be it with the icon field or directly from within a TSU, are the way to go.
Editing the region directly shouldn't be the play in 99.99% of cases.
I'd be very curious about the end result though @ornate spruce.
If you feel like it, do share it here please.
Or outline what exactly you want to achieve, if you have the time.
I didn't mean to bash your approach, hence me answering the question directly in the end.
I was just trying to say that in the end, WA has the tools to do what you want right there for you. You can probably achieve your goals otherwise, but it's likely going to require more work and/or perform worse.
I can imagine many interesting uses for the thing that got asked after, for instance, a face that gets more beat-up as you're short on hitpoints (like some old video game I was fond of years ago).
such a thing would want to respond in-combat, and therefore a load condition would be less valuable for it.
Suffice it to say I'm also curious how this turns ❤️
(from what I can see the ask is about an icon for spell ID)
But you still wouldn't just edit the aura region for that.
You need to react to your health changing.
The simplest and most direct way would be to make a player health trigger, and in the conditions tab set up a bunch of conditions that change the icon/texture according to different health thresholds.
If you'd want to do it with custom code like this person here, you could make a custom trigger for the UNIT_HEALTH event and change it from within there. But that's just a hypothetical, a default trigger with conditions is enough for that.
Editing the aura region is pretty much never the answer.
You want to react to X changing. Weakauras gives you a way to monitor X, and also gives you a way to directly change Y depending on it.
If you monitor X to begin with, then you can also just use the inbuilt way to change Y instead of forcing it.
mmm, yes. the "what i'm looking for" in one place, the "how to show that" in another.
I see based on a spell ID
but not who cast that spell
or
did i get changed into voidform yet
or
did this bar start to show me voidtorrent instead of the boring one
i think the latter two, I've experienced on my shadowpriest, and the voidform is way more detectable.
also least code is fastest and in combat moments count.
so
I'm also interested in hearing more about the larger plan
Setting it directly is always the wrong answer.
And the larger plan is simply a bunch of default triggers in the end.
If they don't want the correct answer of "use a condition" or "use a custom trigger" they clearly don't understand the answer and it's not worth using more time to answer.
First of all, have you checked if Hekili is maintained for your version of WoW? That's basically exactly that.
Additionally, there are a bunch of rotation helper auras on wago that you can look at for inspiration.
!hekiliaddon
Rotation helpers are devilishly tricky to do right in WeakAuras. There are other addons which have pretty much solved that use case, like https://www.curseforge.com/wow/addons/hekili.
But if you want to make it yourself, then consider this:
You need to write the logic for your rotation helper somewhere, right?
And you wouldn't want to evaluate every frame, even if throttled, for performance reasons.
So you'd set up this whole code which decides what ability to use next/icon to display somewhere in WA (if you want to use WA).
And if you want to use WA, it makes sense to use it to gather the data you need as well. That's one of the things WA does after all: you want to react to different amounts of resources, buffs being present, CDs being ready, etc.? WA keeps track of that for you in the most efficient way possible.
So if you use WA to collect the data required etc., then why not also use the inbuilt functionality to change what gets shown depending on that data?
If you really get deep into this and pull through, which won't be easy or quick if you're a beginner and wanna do a full rotation helper, then you'll end up with a custom trigger anyways. And from there you are already offered a way to change the icon (and anything else) to what you want.
You'd probably be better off forking hekili's addon and adding support for showing multiple icons for the next few abilites.
I think that making a rotation helper is much more work than you think it is.
the biggest problem is always the one that you don't know about
%c only ever updates either on trigger update (when the trigger providing dynamic info updates or changes) or on every frame.
Trigger update won't always fire when you need it to if all you do is use a default trigger, since you will want to re-evaluate your next action depending on way more circumstances/way more often.
Every frame update is not a solution, even if you throttle it. It's absolutely atrocious for performance especially if you want to put an entire rotation helper in there.
A custom trigger setup has the benefit that you can set it up to fire exactly when you need it to, making it way better for performance.
sleep() will freeze your game
Just for reference, you can't sleep() in WoW, it'd freeze the UI.
If you click on "snippets" inside the expanded code window then you can paste in a pre-built throttle function that does a similar thing for your purposes
But no, strictly speaking even then using custom triggers should be superior to evaluating every frame.
By definition, if you set it up right, the custom trigger would do stuff only ever when it needs to.
Meanwhile if you throttle too little then it's just worse than that for performance, if you throttle too much then you maybe miss a step/evaluate too late and it messes up
That's hekili. Especially if you want to predict.
If you want to show multiple icons you need to know the future. To know the future you need to code in what the spells do.
If you want to show a single icon that's easy to do in weakauras. Without any code.
You put a aura per entry in a dynamic group, order it how you want, and set limit to 1
Not an aura per spell, an aura per entry.
But you want to predict the future. You need to know that when your reccomendation 1 is casting a dot, the dot will be applied for rec2.
You need to know that after casting rec1 you now have more or less ressources than now.
You explained exactly how hekili works when you mentioned maxdps.
Hekili definitely allows it to show a queue of your suggestable things to do. In my setup I have the recommend for single target extend one direction, the recommend for AoE go the other direction, them at just enough transparent that I can see them but I know they're a recommend only, and
if you don't like their shape iirc masque can be applied.
Also if you've got a WeakAura with some dependency to cry out (eg. DBM said defensive, you want a big blooming icon), you can anchor the WA icon at the same place Hekili's defense hint lives. Or just have it be art with a big hole in the middle so you're creating a "spell flare" that you'd personally honor.
Mixing and matching is totally feasible.
But faults in Hekilis recommendations can be just fixed by adding in your own APL/priority logic.
At least I'm pretty sure you can make custom ones
If Hekili can have the visuals you want, then I'd recommend to just look for where to add a custom APL/change the current one
Yeah, you can change that if you want. I'm pretty sure at least
Apparently they're called "action packs" in Hekili
Sure, you do you. Was just mentioning it