#HoT ProgressBar bar colour changing to affected unit class colour - where do i start?

105 messages · Page 1 of 1 (latest)

spice ice
#

i have a progress bar of my hot on someone and i'm looking to make the progress bar's colour their class colour. searching through posts my options look like:
1 - animation stuff
will disappoint asakawa and my pc, avoid if possible

2 - custom init action to grab the data using something like WA_ClassColorName(unit) and then.....not sure what comes next.
can i modify the bar colour from the init custom code itself or do i store/send the variable to a custom condition that sets bar colour based on the data gained from the init action?

3 - a trigger referencing a unit's characteristics to load unit data with it then matching the units class against a list of class names and colours in a custom condition, which modifies the colour

4 - trigger referencing the unit so i can access their unit info and then a condition for each class changing the bar colour picker to the colour.
this seems to be the option least likely to disappoint asakawa, but most likely to make me cry

looking to learn more about WA so also interested in why/why not to go about different option and best practice etc, feel free to point me to relevant resources

#

all code is in the condition, none in animation

local hhatsUnit = aura_env.state.unit
print(hhatsUnit)

local hhatsClass = select(2, UnitClass(hhatsUnit))
print(hhatsClass)

local hhatsColor = RAID_CLASS_COLORS[hhatsClass]
print(hhatsColor.r, hhatsColor.g, hhatsColor.b, 1)

local hhatsRegion = aura_env.region
hhatsRegion:Color(hhatsColor.r, hhatsColor.g, hhatsColor.b, 1)
onyx cargo
#

you want the bar to be class colors?

spice ice
#

indeed

onyx cargo
#

add a trigger that checks class

#

then make a conditions that changes the bar color

spice ice
#

ideally without using animations (everywhere i looked said that is a bad way of doing it) or having 14 conditions checking a single class trigger, for eavery single WA i have

onyx cargo
#

you can copy conditions

spice ice
#

i wanted to read the info from the target, not make 14 conditions for each bar i wanted to behave this way

#

the other bars are already set up and would hav etheir overwritten to paste the 14 colour ones in

onyx cargo
#

the trigger is getting the info

#

well using conditions is the suggested way of doing it. The other ways of changing it are janky work arounds

spice ice
#

i only have a trigger looking at an aura, lifebloom in this case

onyx cargo
#

add a player/unit info trigger

spice ice
#

i had it that way in a previous iteration yeah

#

but i was having problems with my variables always being nil or tables being empty

onyx cargo
#

you shouldn't need any variables

spice ice
#

only way i could get it to read it was if it was the same state as the hot i was tracking

onyx cargo
spice ice
#

sorry, the %2.unit, unitName, unitClass etc were always empty

onyx cargo
#

sorry dont use that one

#

that's the best way to do it

spice ice
#

from memory i was using smartgroup when it wasnt working

#

its for lifebloom, i dont want it to only show player which would always be me and have class of druid, i want it to show the class colour of the person lifebloom is on

onyx cargo
#

ya

#

then you would need to use auto-clone

#

should work still

spice ice
#

would autoclone just swap it out for the different contition activations but keep the bar in the same spot?

onyx cargo
#

well you need auto-clone for your aura

spice ice
#

my end goal is to have an efflo icon in the middle and then each lifebloom independantly on each side progressing inwards

#

and i couldnt for the life of me figure out how to have the bars in different locations with different behaviours properly

#

so ive just got 2 auras atm

onyx cargo
#

if you have two bars you should have two auras

spice ice
#

found it

#

this is what led me down this path, was the closest thing i could find after like hours of searching

#

its not ideal, i wanted "lifebloom 1" to always be on left and "lifebloom 2" to always be on right

#

but when using least remaining and most remaining the oldest one always swaps to the other side

onyx cargo
#

yeah you can't really differentiate between them like that

spice ice
#

is there a better way of getting them to be handled as 2 independant hots, as if it was like rejuv on left? and lifebloom on right bar?

#

F

onyx cargo
#

You technically COULD do it

#

but you'd have to rewrite all of the functionality of the aura trigger to do it

spice ice
#

like, the WA aura trigger?

onyx cargo
#

ya

spice ice
#

or the trigger i have

#

yeah i assumed thats what you meant lol

onyx cargo
#

each aura has a unique auraID and you could track it by that

#

but it would be a HUGE pain

spice ice
#

i just managed to debug nothing working because i was using aussy colour instead of US color - baby steps

#

oh really? interesting

#

and that would be a globally unique value i imagine?

onyx cargo
#

yeah same as npcID or guidID

#

!hard for sure though

whole mortarBOT
#

what you are asking for has a bad ratio of difficulty to usefulness. It simply requires too much work to build, and doesn't provide much of any utility to speak of. Sorry!

spice ice
#

problem for another day

#

should i move any of my custom condition lua to the action init?

#

things like fetching and storing the RAID_CLASS_COLORS table?

#

your mastery WA was invaluable too btw, was a perfect intro to custom triggers and how states actually work

onyx cargo
#

raid class colors is a global table

spice ice
#

yeah

#

was just curious if querying a global table every time an aura updates is a bad thing to do, instead of just saving it locally on init

onyx cargo
#

its fine to query the table

spice ice
#

sick

spice ice
onyx cargo
#

one of your addons or auras is trying to do a protected function causing UI Taint. Usually happens with clickable auras

#

!clickable

whole mortarBOT
spice ice
#

I only have icons and progress bars

#

The top error says it's buggrabber doing it no?

onyx cargo
#

UI Taint can manifest in any weakaura or addon and spread

spice ice
#

Oops this was meant to me in here not the random other thread soz

ummm, i loaded into a dungeo and wow said an addon was accessing private protected info and then disabled all my addons, is that common?

onyx cargo
#

the error you get can have nothing to do with the source

spice ice
#

Ahhh

#

Yeah I only have your mastery wa, asakawa's template one with comment in the code blocks and then ones I made by clicking the new icon or progress bar wa

#

Details was throwing a bunch of errors about bars, not framea

onyx cargo
#

once a UI element has become tainted it stays tained until you /reload

spice ice
#

Could it be because I attached a aura to an action bar button using the attach to frame picker in the display tab?

onyx cargo
#

could be any of your addons. Do you have any addons that interact with LFG?

spice ice
#

Nope, literally only have details and wa

#

And a world quest one actually

spice ice
#

But that was only temporary as well so I could the move another thing out of the way and then re attach it to another WA icon frame

onyx cargo
#

treat as parent shouldn't inherit anything that is protected

spice ice
#

Oh and the 2bug ones

spice ice
spice ice
#

wait weakauras has the standard lua math libary too, could just use that as well

onyx cargo
spice ice
#

oooohhhhhh, i thought you meant weakauras technically had it but it was hidden/inaccessible without modifying triggers.lua

onyx cargo
#

weakauras has some helper functions for dealing with that though

spice ice
#

HUGE

#

omg you made my day

onyx cargo
#

spellID does not equal auraID

spice ice
#

yeah the api call you linked needs an auraInstanceID and a unitID

#

that was the only thing i could find that would return auraInstanceID

#

are you saying this WA_GetUnitAura(unit, spell, filter) returns that?