From 3161e840cb11358f7ac77b4991d25f37d9db011a Mon Sep 17 00:00:00 2001 From: Solor Date: Wed, 6 Apr 2022 16:31:56 +0800 Subject: [PATCH] add options for unit frame aura per row --- config/config.lua | 12 +-- gui/extra.lua | 175 ++++++++++++++++++------------------ gui/options.lua | 30 +++---- modules/unitframe/auras.lua | 16 +++- modules/unitframe/units.lua | 2 + 5 files changed, 128 insertions(+), 107 deletions(-) diff --git a/config/config.lua b/config/config.lua index cd07ba3fd..a1ae87c08 100644 --- a/config/config.lua +++ b/config/config.lua @@ -195,7 +195,7 @@ C.CharacterSettings = { PlayerWidth = 160, PlayerHealthHeight = 4, PlayerPowerHeight = 1, - PlayerAuraPerRow = 6, + PlayerAuraPerRow = 0, PetWidth = 60, PetHealthHeight = 4, @@ -220,12 +220,12 @@ C.CharacterSettings = { FocusTargetWidth = 60, FocusTargetHealthHeight = 4, FocusTargetPowerHeight = 1, + FocusTargetAuraPerRow = 0, - ShowAura = true, - OnlyShowPlayer = true, - DesaturateIcon = true, - DebuffTypeColor = true, - StealableBuffs = true, + OnlyShowPlayer = true, + DesaturateIcon = true, + DebuffTypeColor = true, + StealableBuffs = true, SimpleMode = false, SMRScale = 10, diff --git a/gui/extra.lua b/gui/extra.lua index afb2020c1..4d0ba64e1 100644 --- a/gui/extra.lua +++ b/gui/extra.lua @@ -1243,8 +1243,8 @@ function GUI:SetupSimpleRaidFrame(parent) CreateOptionDropdown(scroll, L['Group By'], offset - 110, {_G.GROUP, _G.CLASS, _G.ROLE}, nil, mKey, 'SMRGroupBy', 1, UpdateSimpleRaidFrameSize) end -function GUI:SetupUnitFrameSize(parent) - local guiName = 'FreeUIGUIUnitFrameSize' +function GUI:SetupUnitFrame(parent) + local guiName = 'FreeUIGUISetupUnitFrame' TogglePanel(guiName) if extraGUIs[guiName] then return @@ -1256,92 +1256,95 @@ function GUI:SetupUnitFrameSize(parent) local mKey = 'Unitframe' local db = C.CharacterSettings.Unitframe - local playerDatas = { - [1] = {key = 'PlayerWidth', value = db.PlayerWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'PlayerHealthHeight', value = db.PlayerHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'PlayerPowerHeight', value = db.PlayerPowerHeight, text = L['Power Height'], min = 1, max = 40}, - } - - local petDatas = { - [1] = {key = 'PetWidth', value = db.PetWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'PetHealthHeight', value = db.PetHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'PetPowerHeight', value = db.PetPowerHeight, text = L['Power Height'], min = 1, max = 40}, - } - - local targetDatas = { - [1] = {key = 'TargetWidth', value = db.TargetWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'TargetHealthHeight', value = db.TargetHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'TargetPowerHeight', value = db.TargetPowerHeight, text = L['Power Height'], min = 1, max = 40}, - } - - local totDatas = { - [1] = {key = 'TargetTargetWidth', value = db.TargetTargetWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'TargetTargetHealthHeight', value = db.TargetTargetHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'TargetTargetPowerHeight', value = db.TargetTargetPowerHeight, text = L['Power Height'], min = 1, max = 40}, - } - - local focusDatas = { - [1] = {key = 'FocusWidth', value = db.FocusWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'FocusHealthHeight', value = db.FocusHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'FocusPowerHeight', value = db.FocusPowerHeight, text = L['Power Height'], min = 1, max = 40}, - } - - local tofDatas = { - [1] = {key = 'FocusTargetWidth', value = db.FocusTargetWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'FocusTargetHealthHeight', value = db.FocusTargetHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'FocusTargetPowerHeight', value = db.FocusTargetPowerHeight, text = L['Power Height'], min = 1, max = 40}, + local datas = { + player = { + [1] = {key = 'PlayerWidth', value = db.PlayerWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'PlayerHealthHeight', value = db.PlayerHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'PlayerPowerHeight', value = db.PlayerPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'PlayerAuraPerRow' , value = db.PlayerAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1} + }, + pet = { + [1] = {key = 'PetWidth', value = db.PetWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'PetHealthHeight', value = db.PetHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'PetPowerHeight', value = db.PetPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'PetAuraPerRow' , value = db.PetAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1} + }, + target = { + [1] = {key = 'TargetWidth', value = db.TargetWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'TargetHealthHeight', value = db.TargetHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'TargetPowerHeight', value = db.TargetPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'TargetAuraPerRow' , value = db.TargetAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1} + }, + tot = { + [1] = {key = 'TargetTargetWidth', value = db.TargetTargetWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'TargetTargetHealthHeight', value = db.TargetTargetHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'TargetTargetPowerHeight', value = db.TargetTargetPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'TargetTargetAuraPerRow' , value = db.TargetTargetAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1} + }, + focus = { + [1] = {key = 'FocusWidth', value = db.FocusWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'FocusHealthHeight', value = db.FocusHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'FocusPowerHeight', value = db.FocusPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'FocusAuraPerRow' , value = db.FocusAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1} + }, + tof = { + [1] = {key = 'FocusTargetWidth', value = db.FocusTargetWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'FocusTargetHealthHeight', value = db.FocusTargetHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'FocusTargetPowerHeight', value = db.FocusTargetPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'FocusTargetAuraPerRow' , value = db.FocusTargetAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1} + } } local offset = -10 - for _, v in ipairs(playerDatas) do + for _, v in ipairs(datas.player) do CreateGroupTitle(scroll, L['Player Frame'], offset) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 50, UpdateUnitFrameSize) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50, UpdateUnitFrameSize) offset = offset - 65 end scroll.groupTitle = nil - for _, v in ipairs(petDatas) do + for _, v in ipairs(datas.pet) do CreateGroupTitle(scroll, L['Pet Frame'], offset - 50) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 100, UpdateUnitFrameSize) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 100, UpdateUnitFrameSize) offset = offset - 65 end scroll.groupTitle = nil - for _, v in ipairs(targetDatas) do + for _, v in ipairs(datas.target) do CreateGroupTitle(scroll, L['Target Frame'], offset - 100) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 150, UpdateUnitFrameSize) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 150, UpdateUnitFrameSize) offset = offset - 65 end scroll.groupTitle = nil - for _, v in ipairs(totDatas) do + for _, v in ipairs(datas.tot) do CreateGroupTitle(scroll, L['Target of Target Frame'], offset - 150) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 200, UpdateUnitFrameSize) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 200, UpdateUnitFrameSize) offset = offset - 65 end scroll.groupTitle = nil - for _, v in ipairs(focusDatas) do + for _, v in ipairs(datas.focus) do CreateGroupTitle(scroll, L['Focus Frame'], offset - 200) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 250, UpdateUnitFrameSize) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 250, UpdateUnitFrameSize) offset = offset - 65 end scroll.groupTitle = nil - for _, v in ipairs(tofDatas) do + for _, v in ipairs(datas.tof) do CreateGroupTitle(scroll, L['Target of Focus Frame'], offset - 250) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 300, UpdateUnitFrameSize) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 300, UpdateUnitFrameSize) offset = offset - 65 end end -function GUI:SetupBossFrameSize(parent) - local guiName = 'FreeUIGUIBossFrameSize' +function GUI:SetupBossFrame(parent) + local guiName = 'FreeUIGUISetupBossFrame' TogglePanel(guiName) if extraGUIs[guiName] then return @@ -1354,22 +1357,23 @@ function GUI:SetupBossFrameSize(parent) local db = C.CharacterSettings.Unitframe local bossDatas = { - [1] = {key = 'BossWidth', value = db.BossWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'BossHealthHeight', value = db.BossHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'BossPowerHeight', value = db.BossPowerHeight, text = L['Power Height'], min = 1, max = 40}, - [4] = {key = 'BossGap', value = db.BossGap, text = L['Spacing'], min = 10, max = 40}, + [1] = {key = 'BossWidth', value = db.BossWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'BossHealthHeight', value = db.BossHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'BossPowerHeight', value = db.BossPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'BossAuraPerRow' , value = db.BossAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1}, + [5] = {key = 'BossGap', value = db.BossGap, text = L['Gap'], min = 10, max = 100, step = 1}, } local offset = -10 for _, v in ipairs(bossDatas) do CreateGroupTitle(scroll, L['Boss Frame'], offset) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 50) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50) offset = offset - 65 end end -function GUI:SetupArenaFrameSize(parent) - local guiName = 'FreeUIGUIArenaFrameSize' +function GUI:SetupArenaFrame(parent) + local guiName = 'FreeUIGUISetupArenaFrame' TogglePanel(guiName) if extraGUIs[guiName] then return @@ -1382,22 +1386,23 @@ function GUI:SetupArenaFrameSize(parent) local db = C.CharacterSettings.Unitframe local bossDatas = { - [1] = {key = 'ArenaWidth', value = db.ArenaWidth, text = L['Width'], min = 10, max = 400}, - [2] = {key = 'ArenaHealthHeight', value = db.ArenaHealthHeight, text = L['Health Height'], min = 1, max = 40}, - [3] = {key = 'ArenaPowerHeight', value = db.ArenaPowerHeight, text = L['Power Height'], min = 1, max = 40}, - [4] = {key = 'ArenaGap', value = db.ArenaGap, text = L['Spacing'], min = 10, max = 40}, + [1] = {key = 'ArenaWidth', value = db.ArenaWidth, text = L['Width'], min = 10, max = 400, step = 1}, + [2] = {key = 'ArenaHealthHeight', value = db.ArenaHealthHeight, text = L['Health Height'], min = 1, max = 40, step = 1}, + [3] = {key = 'ArenaPowerHeight', value = db.ArenaPowerHeight, text = L['Power Height'], min = 1, max = 40, step = 1}, + [4] = {key = 'ArenaAuraPerRow' , value = db.ArenaAuraPerRow, text = L['Aura Per Row'], min = 0, max = 10, step = 1}, + [5] = {key = 'ArenaGap', value = db.ArenaGap, text = L['Gap'], min = 10, max = 100, step = 1}, } local offset = -10 for _, v in ipairs(bossDatas) do CreateGroupTitle(scroll, L['Arena Frame'], offset) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 50) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50) offset = offset - 65 end end -function GUI:SetupClassPowerSize(parent) - local guiName = 'FreeUIGUIClassPower' +function GUI:SetupClassPower(parent) + local guiName = 'FreeUIGUISetupClassPower' TogglePanel(guiName) if extraGUIs[guiName] then return @@ -1484,8 +1489,8 @@ function GUI:SetupUnitFrameRangeCheck(parent) CreateSlider(scroll, 'Unitframe', datas.key, datas.text, datas.min, datas.max, datas.step, datas.value, 20, offset - 50) end -function GUI:SetupCastbarSize(parent) - local guiName = 'FreeUIGUICastbarSize' +function GUI:SetupCastbar(parent) + local guiName = 'FreeUIGUISetupCastbar' TogglePanel(guiName) if extraGUIs[guiName] then return @@ -1497,41 +1502,41 @@ function GUI:SetupCastbarSize(parent) local mKey = 'Unitframe' local db = C.CharacterSettings.Unitframe - local playerDatas = { - [1] = {key = 'PlayerCastbarWidth', value = db.PlayerCastbarWidth, text = L['Width'], min = 60, max = 400}, - [2] = {key = 'PlayerCastbarHeight', value = db.PlayerCastbarHeight, text = L['Height'], min = 6, max = 40}, - } - - local targetDatas = { - [1] = {key = 'TargetCastbarWidth', value = db.TargetCastbarWidth, text = L['Width'], min = 60, max = 400}, - [2] = {key = 'TargetCastbarHeight', value = db.TargetCastbarHeight, text = L['Height'], min = 6, max = 40}, - } - - local focusDatas = { - [1] = {key = 'FocusCastbarWidth', value = db.FocusCastbarWidth, text = L['Width'], min = 60, max = 400}, - [2] = {key = 'FocusCastbarHeight', value = db.FocusCastbarHeight, text = L['Height'], min = 6, max = 40}, + local datas = { + player = { + [1] = {key = 'PlayerCastbarWidth', value = db.PlayerCastbarWidth, text = L['Width'], min = 60, max = 400, step = 1}, + [2] = {key = 'PlayerCastbarHeight', value = db.PlayerCastbarHeight, text = L['Height'], min = 6, max = 40, step = 1}, + }, + target = { + [1] = {key = 'TargetCastbarWidth', value = db.TargetCastbarWidth, text = L['Width'], min = 60, max = 400, step = 1}, + [2] = {key = 'TargetCastbarHeight', value = db.TargetCastbarHeight, text = L['Height'], min = 6, max = 40, step = 1}, + }, + focus = { + [1] = {key = 'FocusCastbarWidth', value = db.FocusCastbarWidth, text = L['Width'], min = 60, max = 400, step = 1}, + [2] = {key = 'FocusCastbarHeight', value = db.FocusCastbarHeight, text = L['Height'], min = 6, max = 40, step = 1}, + } } local offset = -10 - for _, v in ipairs(playerDatas) do + for _, v in ipairs(datas.player) do CreateGroupTitle(scroll, L['Player Castbar'], offset) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 50) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50) offset = offset - 65 end scroll.groupTitle = nil - for _, v in ipairs(targetDatas) do + for _, v in ipairs(datas.target) do CreateGroupTitle(scroll, L['Target Castbar'], offset - 50) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 100) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 100) offset = offset - 65 end scroll.groupTitle = nil - for _, v in ipairs(focusDatas) do + for _, v in ipairs(datas.focus) do CreateGroupTitle(scroll, L['Focus Castbar'], offset - 100) - CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, 1, v.value, 20, offset - 150) + CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 150) offset = offset - 65 end end diff --git a/gui/options.lua b/gui/options.lua index ab64c952f..e27d2f80c 100644 --- a/gui/options.lua +++ b/gui/options.lua @@ -178,32 +178,32 @@ local function UpdateHealthColor() end end -local function SetupUnitFrameSize() - GUI:SetupUnitFrameSize(GUI.Page[11]) +local function SetupUnitFrame() + GUI:SetupUnitFrame(GUI.Page[11]) end -local function SetupBossFrameSize() - GUI:SetupBossFrameSize(GUI.Page[11]) +local function SetupBossFrame() + GUI:SetupBossFrame(GUI.Page[11]) end -local function SetupArenaFrameSize() - GUI:SetupArenaFrameSize(GUI.Page[11]) +local function SetupArenaFrame() + GUI:SetupArenaFrame(GUI.Page[11]) end local function SetupUnitFrameFader() GUI:SetupUnitFrameFader(GUI.Page[11]) end -local function SetupCastbarSize() - GUI:SetupCastbarSize(GUI.Page[11]) +local function SetupCastbar() + GUI:SetupCastbar(GUI.Page[11]) end local function SetupCastbarColor() GUI:SetupCastbarColor(GUI.Page[11]) end -local function SetupClassPowerSize() - GUI:SetupClassPowerSize(GUI.Page[11]) +local function SetupClassPower() + GUI:SetupClassPower(GUI.Page[11]) end local function SetupUnitFrameRangeCheck() @@ -562,7 +562,7 @@ GUI.OptionsList = { {1, 'Tooltip', 'DomiRank', L['Show Rank of Domination Shards']}, }, [11] = { -- unitframe - {1, 'Unitframe', 'Enable', L['Enable Unitframes'], nil, SetupUnitFrameSize}, + {1, 'Unitframe', 'Enable', L['Enable Unitframes'], nil, SetupUnitFrame}, {4, 'Unitframe', 'TextureStyle', L['Texture Style'], nil, {}}, {4, 'Unitframe', 'ColorStyle', L['Health Color'], true, {L['Default White'], L['Class Color'], L['Percentage Gradient']}, UpdateHealthColor}, @@ -574,7 +574,7 @@ GUI.OptionsList = { {1, 'Unitframe', 'Portrait', L['Portrait'], nil, nil, UpdateGroupElements, L['Show dynamic portrait on unit frame.']}, {1, 'Unitframe', 'GCDIndicator', L['GCD Indicator'], true, nil, UpdateGCDTicker, L['Show global cooldown ticker above the player frame.']}, {1, 'Unitframe', 'AbbrName', L['Abbreviate Name'], nil, nil, UpdateUnitTags}, - {1, 'Unitframe', 'ClassPower', L['Class Power'], true, SetupClassPowerSize, nil, L['Show special resources of the class, such as Combo Points, Holy Power, Chi, Runes, etc.']}, + {1, 'Unitframe', 'ClassPower', L['Class Power'], true, SetupClassPower, nil, L['Show special resources of the class, such as Combo Points, Holy Power, Chi, Runes, etc.']}, {}, {1, 'Unitframe', 'OnlyShowPlayer', L['Player Debuffs Only'], nil, nil, nil, L['Display debuffs cast by player only.']}, {1, 'Unitframe', 'DesaturateIcon', L['Desaturate Debuffs'], true, nil, nil, L['Desaturate debuffs cast by others.']}, @@ -582,10 +582,10 @@ GUI.OptionsList = { {1, 'Unitframe', 'StealableBuffs', L['Purgeable Buffs'], true, nil, nil, L['Display purgeable buffs.']}, {}, {1, 'Unitframe', 'Castbar', L['Enable Castbar'], nil, SetupCastbarColor, nil, L['Uncheck this if you want to use other castbar addon.']}, - {1, 'Unitframe', 'SeparateCastbar', L['Separate Castbar'], true, SetupCastbarSize, nil, L['If disabled, the castbar will be overlapped on the healthbar.|nNote that the spell name and time are only available with separate castbar.']}, + {1, 'Unitframe', 'SeparateCastbar', L['Separate Castbar'], true, SetupCastbar, nil, L['If disabled, the castbar will be overlapped on the healthbar.|nNote that the spell name and time are only available with separate castbar.']}, {}, - {1, 'Unitframe', 'Boss', L['Enable boss frames'], nil, SetupBossFrameSize, nil, L['Uncheck this if you want to use other BossFrame addon.']}, - {1, 'Unitframe', 'Arena', L['Enable arena frames'], true, SetupArenaFrameSize, nil, L['Uncheck this if you want to use other ArenaFrame addon.']}, + {1, 'Unitframe', 'Boss', L['Enable boss frames'], nil, SetupBossFrame, nil, L['Uncheck this if you want to use other BossFrame addon.']}, + {1, 'Unitframe', 'Arena', L['Enable arena frames'], true, SetupArenaFrame, nil, L['Uncheck this if you want to use other ArenaFrame addon.']}, }, [12] = { -- groupframe {1, 'Unitframe', 'RaidFrame', L['Enable RaidFrame'], nil, SetupRaidFrame}, diff --git a/modules/unitframe/auras.lua b/modules/unitframe/auras.lua index e301ebc13..4ce1666fd 100644 --- a/modules/unitframe/auras.lua +++ b/modules/unitframe/auras.lua @@ -281,7 +281,14 @@ function UNITFRAME:CreateAuras(self) bu.numTotal = 32 bu.disableCooldown = true - if style == 'pet' then + if style == 'player' then + bu.initialAnchor = 'TOPLEFT' + bu:SetPoint('TOP', self.Power, 'BOTTOM', 0, -4) + bu['growth-x'] = 'RIGHT' + bu['growth-y'] = 'DOWN' + bu.__value = 'Player' + UNITFRAME:ConfigureAuras(bu) + elseif style == 'pet' then bu.initialAnchor = 'TOPLEFT' bu:SetPoint('TOP', self.Power, 'BOTTOM', 0, -4) bu['growth-x'] = 'RIGHT' @@ -309,6 +316,13 @@ function UNITFRAME:CreateAuras(self) bu['growth-y'] = 'DOWN' bu.__value = 'Focus' UNITFRAME:ConfigureAuras(bu) + elseif style == 'focustarget' then + bu.initialAnchor = 'TOPRIGHT' + bu:SetPoint('TOP', self.Power, 'BOTTOM', 0, -4) + bu['growth-x'] = 'LEFT' + bu['growth-y'] = 'DOWN' + bu.__value = 'FocusTarget' + UNITFRAME:ConfigureAuras(bu) elseif style == 'boss' then bu.initialAnchor = 'TOPLEFT' bu:SetPoint('TOP', self.Power, 'BOTTOM', 0, -4) diff --git a/modules/unitframe/units.lua b/modules/unitframe/units.lua index 2c3de5b6d..4342a5e54 100644 --- a/modules/unitframe/units.lua +++ b/modules/unitframe/units.lua @@ -32,6 +32,7 @@ local function CreatePlayerStyle(self) UNITFRAME:CreateGCDTicker(self) UNITFRAME:CreateClassPowerBar(self) UNITFRAME:CreatePlayerTags(self) + UNITFRAME:CreateAuras(self) end function UNITFRAME:SpawnPlayer() @@ -143,6 +144,7 @@ local function CreateFocusTargetStyle(self) UNITFRAME:CreatePowerBar(self) UNITFRAME:CreateNameTag(self) UNITFRAME:CreateRangeCheck(self) + UNITFRAME:CreateAuras(self) end function UNITFRAME:SpawnFocusTarget()