Skip to content

Commit

Permalink
Update for oUF 9.0.1
Browse files Browse the repository at this point in the history
This update is retroactive with oUF 8.0.2
Added support for enabling/disabling arena buffs/debuffs
  • Loading branch information
scrable committed Jan 10, 2019
1 parent 69839d3 commit 4f7af02
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 54 deletions.
99 changes: 56 additions & 43 deletions oUF_Farva/Farva.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1026,20 +1026,37 @@ end,
self:Tag(htext, '[player:hp]')
self.Power.value:SetPoint("TOPRIGHT", htext, "BOTTOMRIGHT", 0, -2)

local Auras = CreateFrame("Frame", nil, self)
Auras:SetHeight(cfg.heightPA)
Auras:SetPoint("TOPRIGHT", self, "TOPLEFT", 300, 30)
Auras.initialAnchor = "TOPLEFT"
Auras.size = cfg.BuffSize
Auras:SetWidth(Auras.size * 13)
Auras.gap = false
Auras.numBuffs = 8
Auras.numDebuffs = 4
Auras.spacing = 2
Auras["growth-x"] = "RIGHT"

Auras.PostCreateIcon = PostCreateIcon
self.Auras = Auras
if cfg.showArenaBuffs then
createBuffs(self)
self.Buffs:SetPoint("BOTTOMLEFT", self.Health, "TOPLEFT", 0, 4)
self.Buffs.initialAnchor = "BOTTOMLEFT"
self.Buffs["growth-x"] = "RIGHT"
self.Buffs["growth-y"] = "UP"
self.Buffs.num = 7
self.Buffs.size = cfg.BuffSize
self.Buffs.spacing = 5
self.Buffs:SetSize(cfg.widthPA, self.Buffs.size)

if cfg.onlyShowPlayerBuffsFocus then
self.Buffs.onlyShowPlayer = true
end
end

if cfg.showArenaDebuffs then
createDebuffs(self)
self.Debuffs:SetPoint("LEFT", self.Health, "LEFT", (cfg.DebuffSize*-1)-4, -3)
self.Debuffs.initialAnchor = "LEFT"
self.Debuffs["growth-x"] = "LEFT"
self.Debuffs["growth-y"] = "UP"
self.Debuffs.num = 6
self.Debuffs.size = cfg.DebuffSize
self.Debuffs.spacing = 4
self.Debuffs:SetSize(self.Debuffs.size*self.Debuffs.num+(self.Debuffs.spacing*self.Debuffs.num), self.Debuffs.size)

if cfg.onlyShowPlayerDebuffsFocus then
self.Debuffs.onlyShowPlayer = true
end
end

-- plugins
SpellRange(self)
Expand Down Expand Up @@ -1235,27 +1252,6 @@ local spawnHelper = function(self, unit, ...)
end
end

if cfg.ArenaFrames then
oUF:RegisterStyle('oUF_Farva_Arena', UnitSpecific.arenaframes)
oUF:SetActiveStyle('oUF_Farva_Arena')
local arena = {}
local arenatarget = {}
for i = 1, 5 do
arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
if i == 1 then
arena[i]:SetPoint('LEFT', UIParent, 'LEFT', 250, -200)
else
arena[i]:SetPoint("BOTTOMRIGHT", arena[i-1], "TOPRIGHT", 0, 50)
end
end

oUF:RegisterStyle("oUF_Farva_ArenaTarget", UnitSpecific.arenatargets)
oUF:SetActiveStyle("oUF_Farva_ArenaTarget")
for i = 1, 5 do
arenatarget[i] = oUF:Spawn("arena"..i.."target", "oUF_Arena"..i.."target"):SetPoint("TOPLEFT",arena[i], "TOPRIGHT", 8, 0)
end
end

oUF:Factory(function(self)
local player = spawnHelper(self, 'player', "BOTTOM", -338, 233)
spawnHelper(self, 'pet', "RIGHT", player, "LEFT", -10, 0)
Expand All @@ -1264,9 +1260,33 @@ oUF:Factory(function(self)
local focus = spawnHelper(self, 'focus', "CENTER", 360, -164)
spawnHelper(self, 'focustarget', "CENTER", 436, -209)

local arena = {}
local arenatarget = {}

local spec = GetSpecialization()
local class = UnitClass("Player")

if cfg.ArenaFrames then
self:RegisterStyle('oUF_Farva_Arena', UnitSpecific.arenaframes)
self:SetActiveStyle('oUF_Farva_Arena')

for i = 1, 5 do
arena[i] = self:Spawn("arena"..i, "oUF_Arena"..i)
arena[i]:SetAttribute('oUF-enableArenaPrep', false)

if i == 1 then
arena[i]:SetPoint('LEFT', UIParent, 'LEFT', 250, -200)
else
arena[i]:SetPoint("BOTTOMRIGHT", arena[i-1], "TOPRIGHT", 0, 50)
end
end
self:RegisterStyle("oUF_Farva_ArenaTarget", UnitSpecific.arenatargets)
self:SetActiveStyle("oUF_Farva_ArenaTarget")
for i = 1, 5 do
arenatarget[i] = self:Spawn("arena"..i.."target", "oUF_Arena"..i.."target"):SetPoint("TOPLEFT",arena[i], "TOPRIGHT", 8, 0)
end
end

if cfg.PartyFrames then
local EventFrame = CreateFrame("Frame")
EventFrame:RegisterEvent("PLAYER_TALENT_UPDATE")
Expand Down Expand Up @@ -1352,6 +1372,7 @@ oUF:Factory(function(self)
arenaprepupdate:RegisterEvent('ARENA_OPPONENT_UPDATE')
arenaprepupdate:RegisterEvent('ARENA_PREP_OPPONENT_SPECIALIZATIONS')
arenaprepupdate:SetScript('OnEvent', function(self, event)

if event == 'PLAYER_LOGIN' then
for i = 1, 5 do
arenaprep[i]:SetAllPoints(_G['oUF_Arena'..i])
Expand All @@ -1365,22 +1386,14 @@ oUF:Factory(function(self)
if numOpps > 0 then
for i = 1, 5 do
local f = arenaprep[i]

if i <= numOpps then
local s = GetArenaOpponentSpec(i)
local _, spec, class = nil, 'UNKNOWN', 'UNKNOWN'

if s and s > 0 then
_, spec, _, _, _, class = GetSpecializationInfoByID(s)
end

if class and spec then
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
if cfg.class_colorbars and color then
f.Health:SetStatusBarColor(color.r, color.g, color.b)
else
f.Health:SetStatusBarColor(40/255, 40/255, 40/255)
end
f.Spec:SetText(spec..' - '..LOCALIZED_CLASS_NAMES_MALE[class])
f:Show()
end
Expand Down
2 changes: 2 additions & 0 deletions oUF_Farva/Farva_Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ cfg.texture = mediaFolder.."texture.tga"
-----------

cfg.ArenaFrames = true -- enable/disable arena frames
cfg.showArenaBuffs = true -- enable/disable arena buffs
cfg.showArenaDebuffs = true -- enable/disable arena debuffs

---------------
-- main tank --
Expand Down
2 changes: 1 addition & 1 deletion oUF_Farva/Farva_Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ oUF.Tags.Events['tankdc'] = 'UNIT_CONNECTION'

oUF.Tags.Methods['color'] = function(u, r)
local reaction = UnitReaction(u, 'player')
if (UnitIsPlayer(u)) and not cfg.class_colorbars then
if (UnitIsPlayer(u)) then
local _, class = UnitClass(u)
return hex(oUF.colors.class[class])
elseif reaction and not (UnitIsPlayer(u)) then
Expand Down
12 changes: 6 additions & 6 deletions oUF_Farva/module/oUF_Experience.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ end

local function ElementEnable(self)
local element = self.Experience
self:RegisterEvent('PLAYER_XP_UPDATE', Path)
self:RegisterEvent('HONOR_XP_UPDATE', Path)
self:RegisterEvent('ZONE_CHANGED', Path)
self:RegisterEvent('ZONE_CHANGED_NEW_AREA', Path)
self:RegisterEvent('PLAYER_XP_UPDATE', Path, true)
self:RegisterEvent('HONOR_XP_UPDATE', Path, true)
self:RegisterEvent('ZONE_CHANGED', Path, true)
self:RegisterEvent('ZONE_CHANGED_NEW_AREA', Path, true)

if(element.Rested) then
self:RegisterEvent('UPDATE_EXHAUSTION', Path)
self:RegisterEvent('UPDATE_EXHAUSTION', Path, true)
end

element:Show()
Expand Down Expand Up @@ -222,7 +222,7 @@ local function Enable(self, unit)
element.restedAlpha = element.restedAlpha or 0.15

self:RegisterEvent('PLAYER_LEVEL_UP', VisibilityPath, true)
self:RegisterEvent('HONOR_LEVEL_UPDATE', VisibilityPath)
self:RegisterEvent('HONOR_LEVEL_UPDATE', VisibilityPath, true)
self:RegisterEvent('DISABLE_XP_GAIN', VisibilityPath, true)
self:RegisterEvent('ENABLE_XP_GAIN', VisibilityPath, true)

Expand Down
8 changes: 4 additions & 4 deletions oUF_Farva/module/oUF_ThreatBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ local function enable(self)
bar:Hide()
bar:SetMinMaxValues(0, bar.maxThreatVal or 100)

self:RegisterEvent("PLAYER_ENTERING_WORLD", OnEvent)
self:RegisterEvent("PLAYER_REGEN_ENABLED", OnEvent)
self:RegisterEvent("PLAYER_REGEN_DISABLED", OnEvent)
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", OnEvent)
self:RegisterEvent("PLAYER_ENTERING_WORLD", OnEvent, true)
self:RegisterEvent("PLAYER_REGEN_ENABLED", OnEvent, true)
self:RegisterEvent("PLAYER_REGEN_DISABLED", OnEvent, true)
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", OnEvent, true)

bar:SetScript("OnUpdate", update)

Expand Down

0 comments on commit 4f7af02

Please sign in to comment.