Skip to content

Commit 4f7af02

Browse files
committed
Update for oUF 9.0.1
This update is retroactive with oUF 8.0.2 Added support for enabling/disabling arena buffs/debuffs
1 parent 69839d3 commit 4f7af02

File tree

5 files changed

+69
-54
lines changed

5 files changed

+69
-54
lines changed

oUF_Farva/Farva.lua

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,20 +1026,37 @@ end,
10261026
self:Tag(htext, '[player:hp]')
10271027
self.Power.value:SetPoint("TOPRIGHT", htext, "BOTTOMRIGHT", 0, -2)
10281028

1029-
local Auras = CreateFrame("Frame", nil, self)
1030-
Auras:SetHeight(cfg.heightPA)
1031-
Auras:SetPoint("TOPRIGHT", self, "TOPLEFT", 300, 30)
1032-
Auras.initialAnchor = "TOPLEFT"
1033-
Auras.size = cfg.BuffSize
1034-
Auras:SetWidth(Auras.size * 13)
1035-
Auras.gap = false
1036-
Auras.numBuffs = 8
1037-
Auras.numDebuffs = 4
1038-
Auras.spacing = 2
1039-
Auras["growth-x"] = "RIGHT"
1040-
1041-
Auras.PostCreateIcon = PostCreateIcon
1042-
self.Auras = Auras
1029+
if cfg.showArenaBuffs then
1030+
createBuffs(self)
1031+
self.Buffs:SetPoint("BOTTOMLEFT", self.Health, "TOPLEFT", 0, 4)
1032+
self.Buffs.initialAnchor = "BOTTOMLEFT"
1033+
self.Buffs["growth-x"] = "RIGHT"
1034+
self.Buffs["growth-y"] = "UP"
1035+
self.Buffs.num = 7
1036+
self.Buffs.size = cfg.BuffSize
1037+
self.Buffs.spacing = 5
1038+
self.Buffs:SetSize(cfg.widthPA, self.Buffs.size)
1039+
1040+
if cfg.onlyShowPlayerBuffsFocus then
1041+
self.Buffs.onlyShowPlayer = true
1042+
end
1043+
end
1044+
1045+
if cfg.showArenaDebuffs then
1046+
createDebuffs(self)
1047+
self.Debuffs:SetPoint("LEFT", self.Health, "LEFT", (cfg.DebuffSize*-1)-4, -3)
1048+
self.Debuffs.initialAnchor = "LEFT"
1049+
self.Debuffs["growth-x"] = "LEFT"
1050+
self.Debuffs["growth-y"] = "UP"
1051+
self.Debuffs.num = 6
1052+
self.Debuffs.size = cfg.DebuffSize
1053+
self.Debuffs.spacing = 4
1054+
self.Debuffs:SetSize(self.Debuffs.size*self.Debuffs.num+(self.Debuffs.spacing*self.Debuffs.num), self.Debuffs.size)
1055+
1056+
if cfg.onlyShowPlayerDebuffsFocus then
1057+
self.Debuffs.onlyShowPlayer = true
1058+
end
1059+
end
10431060

10441061
-- plugins
10451062
SpellRange(self)
@@ -1235,27 +1252,6 @@ local spawnHelper = function(self, unit, ...)
12351252
end
12361253
end
12371254

1238-
if cfg.ArenaFrames then
1239-
oUF:RegisterStyle('oUF_Farva_Arena', UnitSpecific.arenaframes)
1240-
oUF:SetActiveStyle('oUF_Farva_Arena')
1241-
local arena = {}
1242-
local arenatarget = {}
1243-
for i = 1, 5 do
1244-
arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
1245-
if i == 1 then
1246-
arena[i]:SetPoint('LEFT', UIParent, 'LEFT', 250, -200)
1247-
else
1248-
arena[i]:SetPoint("BOTTOMRIGHT", arena[i-1], "TOPRIGHT", 0, 50)
1249-
end
1250-
end
1251-
1252-
oUF:RegisterStyle("oUF_Farva_ArenaTarget", UnitSpecific.arenatargets)
1253-
oUF:SetActiveStyle("oUF_Farva_ArenaTarget")
1254-
for i = 1, 5 do
1255-
arenatarget[i] = oUF:Spawn("arena"..i.."target", "oUF_Arena"..i.."target"):SetPoint("TOPLEFT",arena[i], "TOPRIGHT", 8, 0)
1256-
end
1257-
end
1258-
12591255
oUF:Factory(function(self)
12601256
local player = spawnHelper(self, 'player', "BOTTOM", -338, 233)
12611257
spawnHelper(self, 'pet', "RIGHT", player, "LEFT", -10, 0)
@@ -1264,9 +1260,33 @@ oUF:Factory(function(self)
12641260
local focus = spawnHelper(self, 'focus', "CENTER", 360, -164)
12651261
spawnHelper(self, 'focustarget', "CENTER", 436, -209)
12661262

1263+
local arena = {}
1264+
local arenatarget = {}
1265+
12671266
local spec = GetSpecialization()
12681267
local class = UnitClass("Player")
12691268

1269+
if cfg.ArenaFrames then
1270+
self:RegisterStyle('oUF_Farva_Arena', UnitSpecific.arenaframes)
1271+
self:SetActiveStyle('oUF_Farva_Arena')
1272+
1273+
for i = 1, 5 do
1274+
arena[i] = self:Spawn("arena"..i, "oUF_Arena"..i)
1275+
arena[i]:SetAttribute('oUF-enableArenaPrep', false)
1276+
1277+
if i == 1 then
1278+
arena[i]:SetPoint('LEFT', UIParent, 'LEFT', 250, -200)
1279+
else
1280+
arena[i]:SetPoint("BOTTOMRIGHT", arena[i-1], "TOPRIGHT", 0, 50)
1281+
end
1282+
end
1283+
self:RegisterStyle("oUF_Farva_ArenaTarget", UnitSpecific.arenatargets)
1284+
self:SetActiveStyle("oUF_Farva_ArenaTarget")
1285+
for i = 1, 5 do
1286+
arenatarget[i] = self:Spawn("arena"..i.."target", "oUF_Arena"..i.."target"):SetPoint("TOPLEFT",arena[i], "TOPRIGHT", 8, 0)
1287+
end
1288+
end
1289+
12701290
if cfg.PartyFrames then
12711291
local EventFrame = CreateFrame("Frame")
12721292
EventFrame:RegisterEvent("PLAYER_TALENT_UPDATE")
@@ -1352,6 +1372,7 @@ oUF:Factory(function(self)
13521372
arenaprepupdate:RegisterEvent('ARENA_OPPONENT_UPDATE')
13531373
arenaprepupdate:RegisterEvent('ARENA_PREP_OPPONENT_SPECIALIZATIONS')
13541374
arenaprepupdate:SetScript('OnEvent', function(self, event)
1375+
13551376
if event == 'PLAYER_LOGIN' then
13561377
for i = 1, 5 do
13571378
arenaprep[i]:SetAllPoints(_G['oUF_Arena'..i])
@@ -1365,22 +1386,14 @@ oUF:Factory(function(self)
13651386
if numOpps > 0 then
13661387
for i = 1, 5 do
13671388
local f = arenaprep[i]
1368-
13691389
if i <= numOpps then
13701390
local s = GetArenaOpponentSpec(i)
13711391
local _, spec, class = nil, 'UNKNOWN', 'UNKNOWN'
1372-
13731392
if s and s > 0 then
13741393
_, spec, _, _, _, class = GetSpecializationInfoByID(s)
13751394
end
1376-
13771395
if class and spec then
1378-
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
1379-
if cfg.class_colorbars and color then
1380-
f.Health:SetStatusBarColor(color.r, color.g, color.b)
1381-
else
13821396
f.Health:SetStatusBarColor(40/255, 40/255, 40/255)
1383-
end
13841397
f.Spec:SetText(spec..' - '..LOCALIZED_CLASS_NAMES_MALE[class])
13851398
f:Show()
13861399
end

oUF_Farva/Farva_Config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ cfg.texture = mediaFolder.."texture.tga"
135135
-----------
136136

137137
cfg.ArenaFrames = true -- enable/disable arena frames
138+
cfg.showArenaBuffs = true -- enable/disable arena buffs
139+
cfg.showArenaDebuffs = true -- enable/disable arena debuffs
138140

139141
---------------
140142
-- main tank --

oUF_Farva/Farva_Tags.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ oUF.Tags.Events['tankdc'] = 'UNIT_CONNECTION'
103103

104104
oUF.Tags.Methods['color'] = function(u, r)
105105
local reaction = UnitReaction(u, 'player')
106-
if (UnitIsPlayer(u)) and not cfg.class_colorbars then
106+
if (UnitIsPlayer(u)) then
107107
local _, class = UnitClass(u)
108108
return hex(oUF.colors.class[class])
109109
elseif reaction and not (UnitIsPlayer(u)) then

oUF_Farva/module/oUF_Experience.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ end
149149

150150
local function ElementEnable(self)
151151
local element = self.Experience
152-
self:RegisterEvent('PLAYER_XP_UPDATE', Path)
153-
self:RegisterEvent('HONOR_XP_UPDATE', Path)
154-
self:RegisterEvent('ZONE_CHANGED', Path)
155-
self:RegisterEvent('ZONE_CHANGED_NEW_AREA', Path)
152+
self:RegisterEvent('PLAYER_XP_UPDATE', Path, true)
153+
self:RegisterEvent('HONOR_XP_UPDATE', Path, true)
154+
self:RegisterEvent('ZONE_CHANGED', Path, true)
155+
self:RegisterEvent('ZONE_CHANGED_NEW_AREA', Path, true)
156156

157157
if(element.Rested) then
158-
self:RegisterEvent('UPDATE_EXHAUSTION', Path)
158+
self:RegisterEvent('UPDATE_EXHAUSTION', Path, true)
159159
end
160160

161161
element:Show()
@@ -222,7 +222,7 @@ local function Enable(self, unit)
222222
element.restedAlpha = element.restedAlpha or 0.15
223223

224224
self:RegisterEvent('PLAYER_LEVEL_UP', VisibilityPath, true)
225-
self:RegisterEvent('HONOR_LEVEL_UPDATE', VisibilityPath)
225+
self:RegisterEvent('HONOR_LEVEL_UPDATE', VisibilityPath, true)
226226
self:RegisterEvent('DISABLE_XP_GAIN', VisibilityPath, true)
227227
self:RegisterEvent('ENABLE_XP_GAIN', VisibilityPath, true)
228228

oUF_Farva/module/oUF_ThreatBar.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ local function enable(self)
6565
bar:Hide()
6666
bar:SetMinMaxValues(0, bar.maxThreatVal or 100)
6767

68-
self:RegisterEvent("PLAYER_ENTERING_WORLD", OnEvent)
69-
self:RegisterEvent("PLAYER_REGEN_ENABLED", OnEvent)
70-
self:RegisterEvent("PLAYER_REGEN_DISABLED", OnEvent)
71-
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", OnEvent)
68+
self:RegisterEvent("PLAYER_ENTERING_WORLD", OnEvent, true)
69+
self:RegisterEvent("PLAYER_REGEN_ENABLED", OnEvent, true)
70+
self:RegisterEvent("PLAYER_REGEN_DISABLED", OnEvent, true)
71+
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", OnEvent, true)
7272

7373
bar:SetScript("OnUpdate", update)
7474

0 commit comments

Comments
 (0)