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

auras: Update element #624

Merged
merged 14 commits into from Nov 22, 2022
Merged

auras: Update element #624

merged 14 commits into from Nov 22, 2022

Conversation

ls-
Copy link
Member

@ls- ls- commented Nov 15, 2022

This one addresses #620 and #621 and some other concerns brought up in our subforum on wowi.

I tweaked the update process so that it properly fills in the blank spots with auras when possible. There's new .all, .allBuffs, and .allDebuffs to keep track of all auras that aren't filtered out by .*filter. .active* tables no longer carry any aura data, that's what .all* is for, .active*s are just lists of active auras. .sorted* tables are unchanged.

There's the new PostUpdateInfo callback, it's called after the aura update info has been processed, but before the sorting/redrawing happens. It's there to let people make adjustments depending on the contents of .all* and .active* tables.

I also added the new .reanchorIfVisibleChanged option. In some cases, for instance, nameplates, users want to redraw the buttons whenever the number of visible buttons changes, this option will allow them to do exactly that.

@ls- ls- force-pushed the auras-patch branch 3 times, most recently from 1c91fa2 to f8f7f83 Compare November 15, 2022 08:52
@ls-
Copy link
Member Author

ls- commented Nov 16, 2022

K, just pushed prob the biggest (not breaking) change to the new auras.

From now on aura info processing and sorting are completely uncapped. oUF will process all auras on the unit, and trimming to the final number will be happening during the redrawing process. The problem with the current (in master) setup is that we can actually bail out before even reaching important stuff if it's somewhere at the end of the list. So for the love of holy cow, where possible, use filters for pre-filtering.

I still chose to keep both .all*. and .active* tables because I know that many popular layouts have a feature to consolidate auras with the same ID into one button. The most common example is bolstering, it has multiple aura instances for each stack. And to do something like that you'll need the data from .all* while keeping only one copy of bolstering in .active*. And to check what's in .all* and adjust .active even further before things proceed to sorting and redrawing there's PostUpdateInfo. Due to the nature of partial updates, it's harder to use FilterAura for stuff that may rely on other auras (not) being present. Although you still have access to .all* and .active* from FA, so there's a way, it's just way less convenient and prob less efficient as well.

Atm, I have no plans to add aura consolidation to oUF.

@myzb
Copy link

myzb commented Nov 16, 2022

I like the latest iteration. I'll test for a few days, but so far so good. Thank you!

I have one last wish. Could it be possible to add the info on whether the update is a full update to PreUpdate ? E.g.:

local fullupdate = not updateInfo or updateInfo.isFullUpdate
if(auras.PreUpdate) then auras:PreUpdate(unit, fullupdate)

Would be helpful so oUF wiping some tables doesn't catch us with our pants down. Also handy to let us know that we probably should also be doing some cleaning up of our own.

@ls-
Copy link
Member Author

ls- commented Nov 17, 2022

Hmm, sure...

elements/auras.lua Outdated Show resolved Hide resolved
@ls-
Copy link
Member Author

ls- commented Nov 22, 2022

Added element:PostProcessAuraData(unit, data) for when you need to tweak the data, but be careful with it.

@ls- ls- merged commit 14b4946 into master Nov 22, 2022
@ls- ls- deleted the auras-patch branch November 22, 2022 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants