Thread Tools Display Modes
11-04-19, 03:42 PM   #1
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
oUF auras module improvements

I've added some code to my personal oUF auras.lua file to enable as many auras/buffs/debuffs element groups as a person wants per unit frame. In addition, I've added an option to allow "reverse fill" on the cooldown spiral.

Relevant code changes:

In the opening ## Options list:
Lua Code:
  1. --.reverse          - Reverse fills the cooldown swirl overlay; only works if .disableCooldown is nil or false (boolean)

In the createAuraIcon function:
Lua Code:
  1. local cd = CreateFrame('Cooldown', '$parentCooldown', button, 'CooldownFrameTemplate')
  2. cd:SetAllPoints()
  3. if element.reverse then
  4.     cd:SetReverse(true)
  5. end

In the UpdateAuras, Update, and Enable functions:
Lua Code:
  1. if (self.Auras or self.multiAuras) then
  2.     for i = 1, (self.Auras and 1) or (self.multiAuras and #self.multiAuras) do
  3.         local auras = (self.multiAuras and self.multiAuras[i]) or self.Auras
  4.         if(auras) then ...

Lua Code:
  1. if (self.Buffs or self.multiBuffs) then
  2.     for i = 1, (self.Buffs and 1) or (self.multiBuffs and #self.multiBuffs) do
  3.         local buffs = (self.multiBuffs and self.multiBuffs[i]) or self.Buffs
  4.         if(buffs) then ...

Lua Code:
  1. if (self.Debuffs or self.multiDebuffs) then
  2.     for i = 1, (self.Debuffs and 1) or (self.multiDebuffs and #self.multiDebuffs) do
  3.         local debuffs = (self.multiDebuffs and self.multiDebuffs[i]) or self.Debuffs
  4.         if(debuffs) then ...

In case you want to compare the full file, here is a pastebin link: https://pastebin.com/pLRBZ37q

Two things: if there is a better way to achieve what I want, that is the ability to add many different auras/buffs/debuffs elements per unit as well as the reverse cooldown fill, I'd greatly appreciate the feedback. If this is arguably the most efficient, then I'd like to go about inquiring how to submit it for review and addition to the oUF addon release.

The way I've written it should allow for anyone who uses oUF to not have to update how they make their buff, debuff, and aura tables. They can either use self.Buffs = Buffs or they can use self.multiBuffs = Buffs[n]

Thank you!

Last edited by Terenna : 11-04-19 at 09:49 PM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF auras module improvements

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off