WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF auras module improvements (https://www.wowinterface.com/forums/showthread.php?t=57660)

Terenna 11-04-19 03:42 PM

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!


All times are GMT -6. The time now is 02:30 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI