init
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
local _G = _G
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
|
||||
local ArenaHeader = CreateFrame("Frame", "ArenaHeader", UIParent)
|
||||
ArenaHeader:SetFrameStrata("LOW")
|
||||
|
||||
function UF:Construct_ArenaFrames(frame)
|
||||
frame.RaisedElementParent = CreateFrame("Frame", nil, frame)
|
||||
frame.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, frame.RaisedElementParent)
|
||||
frame.RaisedElementParent:SetFrameLevel(frame:GetFrameLevel() + 100)
|
||||
|
||||
frame.Health = self:Construct_HealthBar(frame, true, true, "RIGHT")
|
||||
frame.Name = self:Construct_NameText(frame)
|
||||
|
||||
frame.Power = self:Construct_PowerBar(frame, true, true, "LEFT")
|
||||
|
||||
frame.Portrait3D = self:Construct_Portrait(frame, "model")
|
||||
frame.Portrait2D = self:Construct_Portrait(frame, "texture")
|
||||
frame.Buffs = self:Construct_Buffs(frame)
|
||||
frame.Debuffs = self:Construct_Debuffs(frame)
|
||||
frame.Castbar = self:Construct_Castbar(frame)
|
||||
frame.HealCommBar = self:Construct_HealComm(frame)
|
||||
frame.MouseGlow = self:Construct_MouseGlow(frame)
|
||||
frame.TargetGlow = self:Construct_TargetGlow(frame)
|
||||
frame.Trinket = self:Construct_Trinket(frame)
|
||||
frame.Fader = self:Construct_Fader()
|
||||
frame.Cutaway = self:Construct_Cutaway(frame)
|
||||
frame:SetAttribute("type2", "focus")
|
||||
|
||||
frame.customTexts = {}
|
||||
frame.InfoPanel = self:Construct_InfoPanel(frame)
|
||||
frame.unitframeType = "arena"
|
||||
|
||||
ArenaHeader:Point("BOTTOMRIGHT", E.UIParent, "RIGHT", -105, -165)
|
||||
E:CreateMover(ArenaHeader, ArenaHeader:GetName().."Mover", L["Arena Frames"], nil, nil, nil, "ALL,ARENA", nil, "unitframe,arena,generalGroup")
|
||||
frame.mover = ArenaHeader.mover
|
||||
end
|
||||
|
||||
function UF:Update_ArenaFrames(frame, db)
|
||||
frame.db = db
|
||||
|
||||
do
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
|
||||
|
||||
frame.USE_POWERBAR = db.power.enable
|
||||
frame.POWERBAR_DETACHED = db.power.detachFromFrame
|
||||
frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
|
||||
frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
|
||||
frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
|
||||
frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
|
||||
|
||||
frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
|
||||
frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
|
||||
|
||||
frame.USE_PORTRAIT = db.portrait and db.portrait.enable
|
||||
frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT
|
||||
frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
|
||||
|
||||
frame.CLASSBAR_YOFFSET = 0
|
||||
|
||||
frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
|
||||
frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
|
||||
|
||||
frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
frame.colors = ElvUF.colors
|
||||
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
|
||||
UF:Configure_InfoPanel(frame)
|
||||
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
--Power
|
||||
UF:Configure_Power(frame)
|
||||
--Portrait
|
||||
UF:Configure_Portrait(frame)
|
||||
--Auras
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
--Castbar
|
||||
UF:Configure_Castbar(frame)
|
||||
--Trinket
|
||||
UF:Configure_Trinket(frame)
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
--Heal Prediction
|
||||
UF:Configure_HealComm(frame)
|
||||
|
||||
--CustomTexts
|
||||
UF:Configure_CustomTexts(frame)
|
||||
|
||||
frame:ClearAllPoints()
|
||||
if frame.index == 1 then
|
||||
local ArenaHeaderMover = ArenaHeaderMover
|
||||
if db.growthDirection == "UP" then
|
||||
frame:Point("BOTTOMRIGHT", ArenaHeaderMover, "BOTTOMRIGHT")
|
||||
elseif db.growthDirection == "RIGHT" then
|
||||
frame:Point("LEFT", ArenaHeaderMover, "LEFT")
|
||||
elseif db.growthDirection == "LEFT" then
|
||||
frame:Point("RIGHT", ArenaHeaderMover, "RIGHT")
|
||||
else --Down
|
||||
frame:Point("TOPRIGHT", ArenaHeaderMover, "TOPRIGHT")
|
||||
end
|
||||
else
|
||||
if db.growthDirection == "UP" then
|
||||
frame:Point("BOTTOMRIGHT", _G["ElvUF_Arena"..frame.index-1], "TOPRIGHT", 0, db.spacing)
|
||||
elseif db.growthDirection == "RIGHT" then
|
||||
frame:Point("LEFT", _G["ElvUF_Arena"..frame.index-1], "RIGHT", db.spacing, 0)
|
||||
elseif db.growthDirection == "LEFT" then
|
||||
frame:Point("RIGHT", _G["ElvUF_Arena"..frame.index-1], "LEFT", -db.spacing, 0)
|
||||
else --Down
|
||||
frame:Point("TOPRIGHT", _G["ElvUF_Arena"..frame.index-1], "BOTTOMRIGHT", 0, -db.spacing)
|
||||
end
|
||||
end
|
||||
|
||||
if db.growthDirection == "UP" or db.growthDirection == "DOWN" then
|
||||
ArenaHeader:Width(frame.UNIT_WIDTH)
|
||||
ArenaHeader:Height(frame.UNIT_HEIGHT + ((frame.UNIT_HEIGHT + db.spacing) * 4))
|
||||
elseif db.growthDirection == "LEFT" or db.growthDirection == "RIGHT" then
|
||||
ArenaHeader:Width(frame.UNIT_WIDTH + ((frame.UNIT_WIDTH + db.spacing) * 4))
|
||||
ArenaHeader:Height(frame.UNIT_HEIGHT)
|
||||
end
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
UF.unitgroupstoload.arena = {5}
|
||||
@@ -0,0 +1,189 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
local max = math.max
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
|
||||
function UF:Construct_AssistFrames()
|
||||
self:SetScript("OnEnter", UnitFrame_OnEnter)
|
||||
self:SetScript("OnLeave", UnitFrame_OnLeave)
|
||||
|
||||
self.RaisedElementParent = CreateFrame("Frame", nil, self)
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
|
||||
self.Health = UF:Construct_HealthBar(self, true)
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.ThreatIndicator = UF:Construct_Threat(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
self.MouseGlow = UF:Construct_MouseGlow(self)
|
||||
self.TargetGlow = UF:Construct_TargetGlow(self)
|
||||
self.Fader = UF:Construct_Fader()
|
||||
self.Cutaway = UF:Construct_Cutaway(self)
|
||||
|
||||
if not self.isChild then
|
||||
self.Buffs = UF:Construct_Buffs(self)
|
||||
self.Debuffs = UF:Construct_Debuffs(self)
|
||||
self.AuraWatch = UF:Construct_AuraWatch(self)
|
||||
self.RaidDebuffs = UF:Construct_RaidDebuffs(self)
|
||||
self.DebuffHighlight = UF:Construct_DebuffHighlight(self)
|
||||
|
||||
self.unitframeType = "assist"
|
||||
else
|
||||
self.unitframeType = "assisttarget"
|
||||
end
|
||||
|
||||
self.originalParent = self:GetParent()
|
||||
|
||||
UF:Update_StatusBars()
|
||||
UF:Update_FontStrings()
|
||||
|
||||
self.db = UF.db.units.assist
|
||||
self.PostCreate = UF.Update_AssistFrames
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function UF:Update_AssistHeader(header, db)
|
||||
header:Hide()
|
||||
header.db = db
|
||||
|
||||
RegisterStateDriver(header, "visibility", "show")
|
||||
RegisterStateDriver(header, "visibility", "[@raid1,exists] show;hide")
|
||||
|
||||
local width, height = header:GetSize()
|
||||
header.dirtyWidth, header.dirtyHeight = width, max(height, db.height)
|
||||
|
||||
if not header.positioned then
|
||||
header:ClearAllPoints()
|
||||
header:Point("TOPLEFT", E.UIParent, "TOPLEFT", 4, -248)
|
||||
E:CreateMover(header, header:GetName().."Mover", L["MA Frames"], nil, nil, nil, "ALL,RAID", nil, "unitframe,assist,generalGroup")
|
||||
header.mover.positionOverride = "TOPLEFT"
|
||||
header:SetAttribute("minHeight", header.dirtyHeight)
|
||||
header:SetAttribute("minWidth", header.dirtyWidth)
|
||||
header.positioned = true
|
||||
end
|
||||
end
|
||||
|
||||
function UF:Update_AssistFrames(frame, db)
|
||||
if not db then
|
||||
db = frame.db
|
||||
else
|
||||
frame.db = db
|
||||
end
|
||||
|
||||
frame.colors = ElvUF.colors
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
|
||||
do
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
if self.thinBorders then
|
||||
frame.SPACING = 0
|
||||
frame.BORDER = E.mult
|
||||
else
|
||||
frame.BORDER = E.Border
|
||||
frame.SPACING = E.Spacing
|
||||
end
|
||||
frame.SHADOW_SPACING = 3
|
||||
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.height
|
||||
|
||||
frame.USE_POWERBAR = false
|
||||
frame.POWERBAR_DETACHED = false
|
||||
frame.USE_INSET_POWERBAR = false
|
||||
frame.USE_MINI_POWERBAR = false
|
||||
frame.USE_POWERBAR_OFFSET = false
|
||||
frame.POWERBAR_OFFSET = 0
|
||||
frame.POWERBAR_HEIGHT = 0
|
||||
frame.POWERBAR_WIDTH = 0
|
||||
|
||||
frame.USE_PORTRAIT = false
|
||||
frame.USE_PORTRAIT_OVERLAY = false
|
||||
frame.PORTRAIT_WIDTH = 0
|
||||
|
||||
frame.CLASSBAR_YOFFSET = 0
|
||||
frame.BOTTOM_OFFSET = 0
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
if frame.isChild and frame.originalParent then
|
||||
local childDB = db.targetsGroup
|
||||
frame.db = db.targetsGroup
|
||||
if not frame.originalParent.childList then
|
||||
frame.originalParent.childList = {}
|
||||
end
|
||||
frame.originalParent.childList[frame] = true
|
||||
|
||||
if not InCombatLockdown() then
|
||||
if childDB.enable then
|
||||
frame:SetParent(frame.originalParent)
|
||||
RegisterUnitWatch(frame)
|
||||
frame:Size(childDB.width, childDB.height)
|
||||
frame:ClearAllPoints()
|
||||
frame:Point(E.InversePoints[childDB.anchorPoint], frame.originalParent, childDB.anchorPoint, childDB.xOffset, childDB.yOffset)
|
||||
else
|
||||
UnregisterUnitWatch(frame)
|
||||
frame:SetParent(E.HiddenFrame)
|
||||
end
|
||||
else
|
||||
if childDB.enable then
|
||||
frame:SetAttribute("initial-anchor", format("%s,%s,%d,%d", E.InversePoints[childDB.anchorPoint], childDB.anchorPoint, childDB.xOffset, childDB.yOffset))
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
end
|
||||
else
|
||||
if not InCombatLockdown() then
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
else
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
end
|
||||
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
--Threat
|
||||
UF:Configure_Threat(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
if not frame.isChild then
|
||||
--Auras
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
|
||||
--RaidDebuffs
|
||||
UF:Configure_RaidDebuffs(frame)
|
||||
|
||||
--Debuff Highlight
|
||||
UF:Configure_DebuffHighlight(frame)
|
||||
|
||||
--Buff Indicator
|
||||
UF:UpdateAuraWatch(frame)
|
||||
end
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
UF.headerstoload.assist = {"MAINASSIST", "ELVUI_UNITTARGET"}
|
||||
@@ -0,0 +1,152 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
local _G = _G
|
||||
--WoW API / Variables
|
||||
local MAX_BOSS_FRAMES = MAX_BOSS_FRAMES
|
||||
|
||||
local BossHeader = CreateFrame("Frame", "BossHeader", UIParent)
|
||||
BossHeader:SetFrameStrata("LOW")
|
||||
|
||||
function UF:Construct_BossFrames(frame)
|
||||
frame.RaisedElementParent = CreateFrame("Frame", nil, frame)
|
||||
frame.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, frame.RaisedElementParent)
|
||||
frame.RaisedElementParent:SetFrameLevel(frame:GetFrameLevel() + 100)
|
||||
|
||||
frame.Health = self:Construct_HealthBar(frame, true, true, "RIGHT")
|
||||
|
||||
frame.Power = self:Construct_PowerBar(frame, true, true, "LEFT")
|
||||
|
||||
frame.Name = self:Construct_NameText(frame)
|
||||
|
||||
frame.Portrait3D = self:Construct_Portrait(frame, "model")
|
||||
frame.Portrait2D = self:Construct_Portrait(frame, "texture")
|
||||
frame.InfoPanel = self:Construct_InfoPanel(frame)
|
||||
frame.Buffs = self:Construct_Buffs(frame)
|
||||
|
||||
frame.Debuffs = self:Construct_Debuffs(frame)
|
||||
frame.DebuffHighlight = self:Construct_DebuffHighlight(frame)
|
||||
|
||||
frame.Castbar = self:Construct_Castbar(frame)
|
||||
frame.RaidTargetIndicator = self:Construct_RaidIcon(frame)
|
||||
frame.Fader = self:Construct_Fader()
|
||||
frame.Cutaway = self:Construct_Cutaway(frame)
|
||||
frame.MouseGlow = self:Construct_MouseGlow(frame)
|
||||
frame.TargetGlow = self:Construct_TargetGlow(frame)
|
||||
frame:SetAttribute("type2", "focus")
|
||||
frame.customTexts = {}
|
||||
|
||||
BossHeader:Point("BOTTOMRIGHT", E.UIParent, "RIGHT", -105, -165)
|
||||
E:CreateMover(BossHeader, BossHeader:GetName().."Mover", L["Boss Frames"], nil, nil, nil, "ALL,PARTY,RAID", nil, "unitframe,boss,generalGroup")
|
||||
frame.mover = BossHeader.mover
|
||||
|
||||
frame.unitframeType = "boss"
|
||||
end
|
||||
|
||||
function UF:Update_BossFrames(frame, db)
|
||||
frame.db = db
|
||||
|
||||
do
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
|
||||
|
||||
frame.USE_POWERBAR = db.power.enable
|
||||
frame.POWERBAR_DETACHED = db.power.detachFromFrame
|
||||
frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
|
||||
frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
|
||||
frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
|
||||
frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
|
||||
|
||||
frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
|
||||
frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
|
||||
|
||||
frame.USE_PORTRAIT = db.portrait and db.portrait.enable
|
||||
frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
|
||||
frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
|
||||
|
||||
frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
|
||||
frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
|
||||
|
||||
frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
frame.colors = ElvUF.colors
|
||||
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
UF:Configure_InfoPanel(frame)
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
--Power
|
||||
UF:Configure_Power(frame)
|
||||
|
||||
--Portrait
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
--Auras
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
|
||||
--Castbar
|
||||
UF:Configure_Castbar(frame)
|
||||
|
||||
--Raid Icon
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
UF:Configure_DebuffHighlight(frame)
|
||||
|
||||
UF:Configure_CustomTexts(frame)
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
frame:ClearAllPoints()
|
||||
if frame.index == 1 then
|
||||
if db.growthDirection == "UP" then
|
||||
frame:Point("BOTTOMRIGHT", BossHeaderMover, "BOTTOMRIGHT")
|
||||
elseif db.growthDirection == "RIGHT" then
|
||||
frame:Point("LEFT", BossHeaderMover, "LEFT")
|
||||
elseif db.growthDirection == "LEFT" then
|
||||
frame:Point("RIGHT", BossHeaderMover, "RIGHT")
|
||||
else --Down
|
||||
frame:Point("TOPRIGHT", BossHeaderMover, "TOPRIGHT")
|
||||
end
|
||||
else
|
||||
if db.growthDirection == "UP" then
|
||||
frame:Point("BOTTOMRIGHT", _G["ElvUF_Boss"..frame.index-1], "TOPRIGHT", 0, db.spacing)
|
||||
elseif db.growthDirection == "RIGHT" then
|
||||
frame:Point("LEFT", _G["ElvUF_Boss"..frame.index-1], "RIGHT", db.spacing, 0)
|
||||
elseif db.growthDirection == "LEFT" then
|
||||
frame:Point("RIGHT", _G["ElvUF_Boss"..frame.index-1], "LEFT", -db.spacing, 0)
|
||||
else --Down
|
||||
frame:Point("TOPRIGHT", _G["ElvUF_Boss"..frame.index-1], "BOTTOMRIGHT", 0, -db.spacing)
|
||||
end
|
||||
end
|
||||
|
||||
if db.growthDirection == "UP" or db.growthDirection == "DOWN" then
|
||||
BossHeader:Width(frame.UNIT_WIDTH)
|
||||
BossHeader:Height(frame.UNIT_HEIGHT + ((frame.UNIT_HEIGHT + db.spacing) * (MAX_BOSS_FRAMES -1)))
|
||||
elseif db.growthDirection == "LEFT" or db.growthDirection == "RIGHT" then
|
||||
BossHeader:Width(frame.UNIT_WIDTH + ((frame.UNIT_WIDTH + db.spacing) * (MAX_BOSS_FRAMES -1)))
|
||||
BossHeader:Height(frame.UNIT_HEIGHT)
|
||||
end
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
UF.unitgroupstoload.boss = {MAX_BOSS_FRAMES}
|
||||
@@ -0,0 +1,10 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="Party.lua"/>
|
||||
<Script file="Raid.lua"/>
|
||||
<Script file="Raid40.lua"/>
|
||||
<Script file="Arena.lua"/>
|
||||
<Script file="Boss.lua"/>
|
||||
<Script file="Tank.lua"/>
|
||||
<Script file="RaidPets.lua"/>
|
||||
<Script file="Assist.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,290 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
local _G = _G
|
||||
local format = string.format
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local GetInstanceInfo = GetInstanceInfo
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
local UnregisterStateDriver = UnregisterStateDriver
|
||||
|
||||
function UF:Construct_PartyFrames()
|
||||
self:SetScript("OnEnter", UnitFrame_OnEnter)
|
||||
self:SetScript("OnLeave", UnitFrame_OnLeave)
|
||||
|
||||
self.RaisedElementParent = CreateFrame("Frame", nil, self)
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
self.BORDER = E.Border
|
||||
self.SPACING = E.Spacing
|
||||
self.SHADOW_SPACING = 3
|
||||
if self.isChild then
|
||||
self.Health = UF:Construct_HealthBar(self, true)
|
||||
self.MouseGlow = UF:Construct_MouseGlow(self)
|
||||
self.TargetGlow = UF:Construct_TargetGlow(self)
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
|
||||
self.originalParent = self:GetParent()
|
||||
|
||||
self.childType = "pet"
|
||||
if self == _G[self.originalParent:GetName().."Target"] then
|
||||
self.childType = "target"
|
||||
end
|
||||
|
||||
self.unitframeType = "party"..self.childType
|
||||
else
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT")
|
||||
|
||||
self.Power = UF:Construct_PowerBar(self, true, true, "LEFT")
|
||||
self.Power.frequentUpdates = false
|
||||
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model")
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture")
|
||||
self.InfoPanel = UF:Construct_InfoPanel(self)
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.Buffs = UF:Construct_Buffs(self)
|
||||
self.Debuffs = UF:Construct_Debuffs(self)
|
||||
self.AuraWatch = UF:Construct_AuraWatch(self)
|
||||
self.RaidDebuffs = UF:Construct_RaidDebuffs(self)
|
||||
self.DebuffHighlight = UF:Construct_DebuffHighlight(self)
|
||||
self.ResurrectIndicator = UF:Construct_ResurrectionIcon(self)
|
||||
self.GroupRoleIndicator = UF:Construct_RoleIcon(self)
|
||||
self.RaidRoleFramesAnchor = UF:Construct_RaidRoleFrames(self)
|
||||
self.MouseGlow = UF:Construct_MouseGlow(self)
|
||||
self.TargetGlow = UF:Construct_TargetGlow(self)
|
||||
self.ThreatIndicator = UF:Construct_Threat(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
self.ReadyCheckIndicator = UF:Construct_ReadyCheckIcon(self)
|
||||
self.HealCommBar = UF:Construct_HealComm(self)
|
||||
self.GPS = UF:Construct_GPS(self)
|
||||
self.customTexts = {}
|
||||
|
||||
self.Castbar = UF:Construct_Castbar(self)
|
||||
|
||||
self.unitframeType = "party"
|
||||
end
|
||||
|
||||
self.Fader = UF:Construct_Fader()
|
||||
self.Cutaway = UF:Construct_Cutaway(self)
|
||||
|
||||
UF:Update_StatusBars()
|
||||
UF:Update_FontStrings()
|
||||
|
||||
self.db = UF.db.units.party
|
||||
self.PostCreate = UF.Update_PartyFrames
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function UF:Update_PartyHeader(header, db)
|
||||
header.db = db
|
||||
|
||||
local headerHolder = header:GetParent()
|
||||
headerHolder.db = db
|
||||
|
||||
if not headerHolder.positioned then
|
||||
headerHolder:ClearAllPoints()
|
||||
headerHolder:Point("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 4, 195)
|
||||
|
||||
E:CreateMover(headerHolder, headerHolder:GetName().."Mover", L["Party Frames"], nil, nil, nil, "ALL,PARTY,ARENA", nil, "unitframe,party,generalGroup")
|
||||
headerHolder.positioned = true
|
||||
|
||||
headerHolder:RegisterEvent("PLAYER_LOGIN")
|
||||
headerHolder:RegisterEvent("ZONE_CHANGED_NEW_AREA")
|
||||
headerHolder:SetScript("OnEvent", UF.PartySmartVisibility)
|
||||
end
|
||||
|
||||
UF.PartySmartVisibility(headerHolder)
|
||||
end
|
||||
|
||||
function UF:PartySmartVisibility(event)
|
||||
if not self.db or (self.db and not self.db.enable) or (UF.db and not UF.db.smartRaidFilter) or self.isForced then
|
||||
self.blockVisibilityChanges = false
|
||||
return
|
||||
end
|
||||
|
||||
if event == "PLAYER_REGEN_ENABLED" then
|
||||
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
|
||||
end
|
||||
|
||||
if not InCombatLockdown() then
|
||||
local _, instanceType = GetInstanceInfo()
|
||||
if instanceType == "raid" or instanceType == "pvp" then
|
||||
UnregisterStateDriver(self, "visibility")
|
||||
self.blockVisibilityChanges = true
|
||||
self:Hide()
|
||||
elseif self.db.visibility then
|
||||
RegisterStateDriver(self, "visibility", self.db.visibility)
|
||||
self.blockVisibilityChanges = false
|
||||
end
|
||||
else
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED")
|
||||
end
|
||||
end
|
||||
|
||||
function UF:Update_PartyFrames(frame, db)
|
||||
if not db then
|
||||
db = frame.db
|
||||
else
|
||||
frame.db = db
|
||||
end
|
||||
|
||||
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
||||
frame.colors = ElvUF.colors
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
|
||||
do
|
||||
if self.thinBorders then
|
||||
frame.SPACING = 0
|
||||
frame.BORDER = E.mult
|
||||
else
|
||||
frame.BORDER = E.Border
|
||||
frame.SPACING = E.Spacing
|
||||
end
|
||||
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
|
||||
|
||||
frame.USE_POWERBAR = db.power.enable
|
||||
frame.POWERBAR_DETACHED = db.power.detachFromFrame
|
||||
frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
|
||||
frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
|
||||
frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
|
||||
frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
|
||||
|
||||
frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
|
||||
frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
|
||||
|
||||
frame.USE_PORTRAIT = db.portrait and db.portrait.enable
|
||||
frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
|
||||
frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
|
||||
frame.CLASSBAR_YOFFSET = 0
|
||||
|
||||
frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
|
||||
frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
|
||||
|
||||
frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
if frame.isChild then
|
||||
frame.USE_PORTAIT = false
|
||||
frame.USE_PORTRAIT_OVERLAY = false
|
||||
frame.PORTRAIT_WIDTH = 0
|
||||
frame.USE_POWERBAR = false
|
||||
frame.USE_INSET_POWERBAR = false
|
||||
frame.USE_MINI_POWERBAR = false
|
||||
frame.USE_POWERBAR_OFFSET = false
|
||||
frame.POWERBAR_OFFSET = 0
|
||||
|
||||
frame.POWERBAR_HEIGHT = 0
|
||||
frame.POWERBAR_WIDTH = 0
|
||||
|
||||
frame.BOTTOM_OFFSET = 0
|
||||
|
||||
local childDB = db.petsGroup
|
||||
if frame.childType == "target" then
|
||||
childDB = db.targetsGroup
|
||||
end
|
||||
|
||||
frame.UNIT_WIDTH = childDB.width
|
||||
frame.UNIT_HEIGHT = childDB.height
|
||||
|
||||
if not frame.originalParent.childList then
|
||||
frame.originalParent.childList = {}
|
||||
end
|
||||
frame.originalParent.childList[frame] = true
|
||||
|
||||
if not InCombatLockdown() then
|
||||
if childDB.enable then
|
||||
frame:SetParent(frame.originalParent)
|
||||
RegisterUnitWatch(frame)
|
||||
frame:Size(childDB.width, childDB.height)
|
||||
frame:ClearAllPoints()
|
||||
frame:Point(E.InversePoints[childDB.anchorPoint], frame.originalParent, childDB.anchorPoint, childDB.xOffset, childDB.yOffset)
|
||||
else
|
||||
UnregisterUnitWatch(frame)
|
||||
frame:SetParent(E.HiddenFrame)
|
||||
end
|
||||
else
|
||||
if childDB.enable then
|
||||
frame:SetAttribute("initial-anchor", format("%s,%s,%d,%d", E.InversePoints[childDB.anchorPoint], childDB.anchorPoint, childDB.xOffset, childDB.yOffset))
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
end
|
||||
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame, frame.childType)
|
||||
else
|
||||
if not InCombatLockdown() then
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
else
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
|
||||
UF:Configure_InfoPanel(frame)
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
UF:Configure_Power(frame)
|
||||
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
UF:Configure_Threat(frame)
|
||||
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
|
||||
UF:Configure_RaidDebuffs(frame)
|
||||
|
||||
UF:Configure_Castbar(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
UF:Configure_DebuffHighlight(frame)
|
||||
|
||||
UF:Configure_ResurrectionIcon(frame)
|
||||
|
||||
UF:Configure_RoleIcon(frame)
|
||||
|
||||
UF:Configure_HealComm(frame)
|
||||
|
||||
UF:Configure_GPS(frame)
|
||||
|
||||
UF:Configure_RaidRoleIcons(frame)
|
||||
|
||||
UF:UpdateAuraWatch(frame)
|
||||
|
||||
UF:Configure_ReadyCheckIcon(frame)
|
||||
|
||||
UF:Configure_CustomTexts(frame)
|
||||
end
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
UF.headerstoload.party = {nil, "ELVUI_UNITPET, ELVUI_UNITTARGET"}
|
||||
@@ -0,0 +1,243 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local GetInstanceInfo = GetInstanceInfo
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
local UnregisterStateDriver = UnregisterStateDriver
|
||||
|
||||
function UF:Construct_RaidFrames()
|
||||
self:SetScript("OnEnter", UnitFrame_OnEnter)
|
||||
self:SetScript("OnLeave", UnitFrame_OnLeave)
|
||||
|
||||
self.RaisedElementParent = CreateFrame("Frame", nil, self)
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT")
|
||||
|
||||
self.Power = UF:Construct_PowerBar(self, true, true, "LEFT")
|
||||
self.Power.frequentUpdates = false
|
||||
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model")
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture")
|
||||
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.Buffs = UF:Construct_Buffs(self)
|
||||
self.Debuffs = UF:Construct_Debuffs(self)
|
||||
self.AuraWatch = UF:Construct_AuraWatch(self)
|
||||
self.RaidDebuffs = UF:Construct_RaidDebuffs(self)
|
||||
self.DebuffHighlight = UF:Construct_DebuffHighlight(self)
|
||||
self.ResurrectIndicator = UF:Construct_ResurrectionIcon(self)
|
||||
self.RaidRoleFramesAnchor = UF:Construct_RaidRoleFrames(self)
|
||||
self.MouseGlow = UF:Construct_MouseGlow(self)
|
||||
self.TargetGlow = UF:Construct_TargetGlow(self)
|
||||
|
||||
self.ThreatIndicator = UF:Construct_Threat(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
self.ReadyCheckIndicator = UF:Construct_ReadyCheckIcon(self)
|
||||
self.HealCommBar = UF:Construct_HealComm(self)
|
||||
self.GPS = UF:Construct_GPS(self)
|
||||
self.Fader = UF:Construct_Fader()
|
||||
self.Cutaway = UF:Construct_Cutaway(self)
|
||||
|
||||
self.customTexts = {}
|
||||
self.InfoPanel = UF:Construct_InfoPanel(self)
|
||||
|
||||
self.unitframeType = "raid"
|
||||
UF:Update_StatusBars()
|
||||
UF:Update_FontStrings()
|
||||
|
||||
self.db = UF.db.units.raid
|
||||
self.PostCreate = UF.Update_RaidFrames
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function UF:RaidSmartVisibility(event)
|
||||
if not self.db or (self.db and not self.db.enable) or (UF.db and not UF.db.smartRaidFilter) or self.isForced then
|
||||
self.blockVisibilityChanges = false
|
||||
return
|
||||
end
|
||||
|
||||
if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end
|
||||
|
||||
if not InCombatLockdown() then
|
||||
self.isInstanceForced = nil
|
||||
local _, instanceType, _, _, maxPlayers = GetInstanceInfo()
|
||||
if instanceType == "raid" or instanceType == "pvp" then
|
||||
local mapID = GetCurrentMapAreaID()
|
||||
if UF.instanceMapIDs[mapID] then
|
||||
maxPlayers = UF.instanceMapIDs[mapID]
|
||||
end
|
||||
|
||||
UnregisterStateDriver(self, "visibility")
|
||||
|
||||
if maxPlayers < 40 then
|
||||
self:Show()
|
||||
self.isInstanceForced = true
|
||||
self.blockVisibilityChanges = false
|
||||
if ElvUF_Raid.numGroups ~= E:Round(maxPlayers/5) and event then
|
||||
UF:CreateAndUpdateHeaderGroup("raid")
|
||||
end
|
||||
else
|
||||
self.blockVisibilityChanges = true
|
||||
self:Hide()
|
||||
end
|
||||
elseif self.db.visibility then
|
||||
RegisterStateDriver(self, "visibility", self.db.visibility)
|
||||
self.blockVisibilityChanges = false
|
||||
if ElvUF_Raid.numGroups ~= self.db.numGroups then
|
||||
UF:CreateAndUpdateHeaderGroup("raid")
|
||||
end
|
||||
end
|
||||
else
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
function UF:Update_RaidHeader(header, db)
|
||||
header.db = db
|
||||
|
||||
local headerHolder = header:GetParent()
|
||||
headerHolder.db = db
|
||||
|
||||
if not headerHolder.positioned then
|
||||
headerHolder:ClearAllPoints()
|
||||
headerHolder:Point("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 4, 195)
|
||||
|
||||
E:CreateMover(headerHolder, headerHolder:GetName().."Mover", L["Raid Frames"], nil, nil, nil, "ALL,RAID", nil, "unitframe,raid,generalGroup")
|
||||
|
||||
headerHolder:RegisterEvent("PLAYER_LOGIN")
|
||||
headerHolder:RegisterEvent("ZONE_CHANGED_NEW_AREA")
|
||||
headerHolder:SetScript("OnEvent", UF.RaidSmartVisibility)
|
||||
headerHolder.positioned = true
|
||||
end
|
||||
|
||||
UF.RaidSmartVisibility(headerHolder)
|
||||
end
|
||||
|
||||
function UF:Update_RaidFrames(frame, db)
|
||||
if not db then
|
||||
db = frame.db
|
||||
else
|
||||
frame.db = db
|
||||
end
|
||||
|
||||
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
||||
frame.colors = ElvUF.colors
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
|
||||
do
|
||||
if self.thinBorders then
|
||||
frame.SPACING = 0
|
||||
frame.BORDER = E.mult
|
||||
else
|
||||
frame.BORDER = E.Border
|
||||
frame.SPACING = E.Spacing
|
||||
end
|
||||
frame.SHADOW_SPACING = 3
|
||||
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
|
||||
|
||||
frame.USE_POWERBAR = db.power.enable
|
||||
frame.POWERBAR_DETACHED = db.power.detachFromFrame
|
||||
frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
|
||||
frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
|
||||
frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
|
||||
frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
|
||||
|
||||
frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
|
||||
frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
|
||||
|
||||
frame.USE_PORTRAIT = db.portrait and db.portrait.enable
|
||||
frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
|
||||
frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
|
||||
|
||||
frame.CLASSBAR_YOFFSET = 0
|
||||
frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
|
||||
frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
|
||||
|
||||
frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
if not InCombatLockdown() then
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
else
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
|
||||
UF:Configure_InfoPanel(frame)
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
--Power
|
||||
UF:Configure_Power(frame)
|
||||
|
||||
--Portrait
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
--Threat
|
||||
UF:Configure_Threat(frame)
|
||||
|
||||
--Auras
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
|
||||
--RaidDebuffs
|
||||
UF:Configure_RaidDebuffs(frame)
|
||||
|
||||
--Raid Icon
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
--Resurrect Icon
|
||||
UF:Configure_ResurrectionIcon(frame)
|
||||
|
||||
--Debuff Highlight
|
||||
UF:Configure_DebuffHighlight(frame)
|
||||
|
||||
--OverHealing
|
||||
UF:Configure_HealComm(frame)
|
||||
|
||||
--GPS Arrow
|
||||
UF:Configure_GPS(frame)
|
||||
|
||||
--Raid Roles
|
||||
UF:Configure_RaidRoleIcons(frame)
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
--Buff Indicators
|
||||
UF:UpdateAuraWatch(frame)
|
||||
|
||||
--ReadyCheck
|
||||
UF:Configure_ReadyCheckIcon(frame)
|
||||
|
||||
--CustomTexts
|
||||
UF:Configure_CustomTexts(frame)
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
UF.headerstoload.raid = true
|
||||
@@ -0,0 +1,247 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local GetInstanceInfo = GetInstanceInfo
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
local UnregisterStateDriver = UnregisterStateDriver
|
||||
|
||||
function UF:Construct_Raid40Frames()
|
||||
self:SetScript("OnEnter", UnitFrame_OnEnter)
|
||||
self:SetScript("OnLeave", UnitFrame_OnLeave)
|
||||
|
||||
self.RaisedElementParent = CreateFrame("Frame", nil, self)
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT")
|
||||
|
||||
self.Power = UF:Construct_PowerBar(self, true, true, "LEFT")
|
||||
self.Power.frequentUpdates = false
|
||||
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model")
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture")
|
||||
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.Buffs = UF:Construct_Buffs(self)
|
||||
self.Debuffs = UF:Construct_Debuffs(self)
|
||||
self.AuraWatch = UF:Construct_AuraWatch(self)
|
||||
self.RaidDebuffs = UF:Construct_RaidDebuffs(self)
|
||||
self.DebuffHighlight = UF:Construct_DebuffHighlight(self)
|
||||
self.ResurrectIndicator = UF:Construct_ResurrectionIcon(self)
|
||||
self.RaidRoleFramesAnchor = UF:Construct_RaidRoleFrames(self)
|
||||
self.MouseGlow = UF:Construct_MouseGlow(self)
|
||||
self.TargetGlow = UF:Construct_TargetGlow(self)
|
||||
self.InfoPanel = UF:Construct_InfoPanel(self)
|
||||
self.ThreatIndicator = UF:Construct_Threat(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
self.ReadyCheckIndicator = UF:Construct_ReadyCheckIcon(self)
|
||||
self.HealCommBar = UF:Construct_HealComm(self)
|
||||
self.GPS = UF:Construct_GPS(self)
|
||||
self.Fader = UF:Construct_Fader()
|
||||
self.Cutaway = UF:Construct_Cutaway(self)
|
||||
self.customTexts = {}
|
||||
|
||||
self.unitframeType = "raid40"
|
||||
|
||||
UF:Update_StatusBars()
|
||||
UF:Update_FontStrings()
|
||||
|
||||
self.db = UF.db.units.raid40
|
||||
self.PostCreate = UF.Update_Raid40Frames
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function UF:Raid40SmartVisibility(event)
|
||||
if not self.db or (self.db and not self.db.enable) or (UF.db and not UF.db.smartRaidFilter) or self.isForced then
|
||||
self.blockVisibilityChanges = false
|
||||
return
|
||||
end
|
||||
|
||||
if event == "PLAYER_REGEN_ENABLED" then
|
||||
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
|
||||
end
|
||||
|
||||
if not InCombatLockdown() then
|
||||
self.isInstanceForced = nil
|
||||
local _, instanceType, _, _, maxPlayers = GetInstanceInfo()
|
||||
if instanceType == "raid" or instanceType == "pvp" then
|
||||
local mapID = GetCurrentMapAreaID()
|
||||
if UF.instanceMapIDs[mapID] then
|
||||
maxPlayers = UF.instanceMapIDs[mapID]
|
||||
end
|
||||
|
||||
UnregisterStateDriver(self, "visibility")
|
||||
|
||||
if maxPlayers == 40 then
|
||||
self.isInstanceForced = true
|
||||
self.blockVisibilityChanges = false
|
||||
self:Show()
|
||||
|
||||
if ElvUF_Raid40.numGroups ~= E:Round(maxPlayers/5) and event then
|
||||
UF:CreateAndUpdateHeaderGroup("raid40")
|
||||
end
|
||||
else
|
||||
self.blockVisibilityChanges = true
|
||||
self:Hide()
|
||||
end
|
||||
elseif self.db.visibility then
|
||||
RegisterStateDriver(self, "visibility", self.db.visibility)
|
||||
self.blockVisibilityChanges = false
|
||||
|
||||
if ElvUF_Raid40.numGroups ~= self.db.numGroups then
|
||||
UF:CreateAndUpdateHeaderGroup("raid40")
|
||||
end
|
||||
end
|
||||
else
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
function UF:Update_Raid40Header(header, db)
|
||||
header:GetParent().db = db
|
||||
|
||||
local headerHolder = header:GetParent()
|
||||
headerHolder.db = db
|
||||
|
||||
if not headerHolder.positioned then
|
||||
headerHolder:ClearAllPoints()
|
||||
headerHolder:Point("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 4, 195)
|
||||
|
||||
E:CreateMover(headerHolder, headerHolder:GetName().."Mover", L["Raid-40 Frames"], nil, nil, nil, "ALL,RAID", nil, "unitframe,raid40,generalGroup")
|
||||
|
||||
headerHolder:RegisterEvent("PLAYER_LOGIN")
|
||||
headerHolder:RegisterEvent("ZONE_CHANGED_NEW_AREA")
|
||||
headerHolder:SetScript("OnEvent", UF.Raid40SmartVisibility)
|
||||
headerHolder.positioned = true
|
||||
end
|
||||
|
||||
UF.Raid40SmartVisibility(headerHolder)
|
||||
end
|
||||
|
||||
function UF:Update_Raid40Frames(frame, db)
|
||||
if not db then
|
||||
db = frame.db
|
||||
else
|
||||
frame.db = db
|
||||
end
|
||||
|
||||
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
||||
frame.colors = ElvUF.colors
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
|
||||
do
|
||||
if self.thinBorders then
|
||||
frame.SPACING = 0
|
||||
frame.BORDER = E.mult
|
||||
else
|
||||
frame.BORDER = E.Border
|
||||
frame.SPACING = E.Spacing
|
||||
end
|
||||
frame.SHADOW_SPACING = 3
|
||||
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
|
||||
|
||||
frame.USE_POWERBAR = db.power.enable
|
||||
frame.POWERBAR_DETACHED = db.power.detachFromFrame
|
||||
frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
|
||||
frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
|
||||
frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
|
||||
frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
|
||||
|
||||
frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
|
||||
frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
|
||||
|
||||
frame.USE_PORTRAIT = db.portrait and db.portrait.enable
|
||||
frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
|
||||
frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
|
||||
|
||||
frame.CLASSBAR_YOFFSET = 0
|
||||
|
||||
frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
|
||||
frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
|
||||
|
||||
frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
if not InCombatLockdown() then
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
else
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
|
||||
UF:Configure_InfoPanel(frame)
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
--Power
|
||||
UF:Configure_Power(frame)
|
||||
|
||||
--Portrait
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
--Threat
|
||||
UF:Configure_Threat(frame)
|
||||
|
||||
--Auras
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
|
||||
--RaidDebuffs
|
||||
UF:Configure_RaidDebuffs(frame)
|
||||
|
||||
--Raid Icon
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
--Debuff Highlight
|
||||
UF:Configure_DebuffHighlight(frame)
|
||||
|
||||
--Resurrect Highlight
|
||||
UF:Configure_ResurrectionIcon(frame)
|
||||
|
||||
--OverHealing
|
||||
UF:Configure_HealComm(frame)
|
||||
|
||||
--GPS Arrow
|
||||
UF:Configure_GPS(frame)
|
||||
|
||||
--Raid Roles
|
||||
UF:Configure_RaidRoleIcons(frame)
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
--Buff Indicators
|
||||
UF:UpdateAuraWatch(frame)
|
||||
|
||||
--ReadyCheck
|
||||
UF:Configure_ReadyCheckIcon(frame)
|
||||
|
||||
--CustomTexts
|
||||
UF:Configure_CustomTexts(frame)
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
UF.headerstoload.raid40 = true
|
||||
@@ -0,0 +1,189 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local GetInstanceInfo = GetInstanceInfo
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
local UnregisterStateDriver = UnregisterStateDriver
|
||||
|
||||
function UF:Construct_RaidpetFrames()
|
||||
self:SetScript("OnEnter", UnitFrame_OnEnter)
|
||||
self:SetScript("OnLeave", UnitFrame_OnLeave)
|
||||
|
||||
self.RaisedElementParent = CreateFrame("Frame", nil, self)
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT")
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model")
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture")
|
||||
self.Buffs = UF:Construct_Buffs(self)
|
||||
self.Debuffs = UF:Construct_Debuffs(self)
|
||||
self.AuraWatch = UF:Construct_AuraWatch(self)
|
||||
self.RaidDebuffs = UF:Construct_RaidDebuffs(self)
|
||||
self.DebuffHighlight = UF:Construct_DebuffHighlight(self)
|
||||
self.TargetGlow = UF:Construct_TargetGlow(self)
|
||||
self.MouseGlow = UF:Construct_MouseGlow(self)
|
||||
self.ThreatIndicator = UF:Construct_Threat(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
self.HealCommBar = UF:Construct_HealComm(self)
|
||||
self.Fader = UF:Construct_Fader()
|
||||
self.Cutaway = UF:Construct_Cutaway(self)
|
||||
self.customTexts = {}
|
||||
|
||||
self.unitframeType = "raidpet"
|
||||
|
||||
UF:Update_StatusBars()
|
||||
UF:Update_FontStrings()
|
||||
|
||||
self.db = UF.db.units.raidpet
|
||||
self.PostCreate = UF.Update_RaidpetFrames
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--I don"t know if this function is needed or not? But the error I pm'ed you about was because of the missing OnEvent so I just added it.
|
||||
function UF:RaidPetsSmartVisibility(event)
|
||||
if not self.db or (self.db and not self.db.enable) or (UF.db and not UF.db.smartRaidFilter) or self.isForced then return end
|
||||
if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end
|
||||
|
||||
if not InCombatLockdown() then
|
||||
local _, instanceType = GetInstanceInfo()
|
||||
if instanceType == "raid" then
|
||||
UnregisterStateDriver(self, "visibility")
|
||||
self:Show()
|
||||
elseif self.db.visibility then
|
||||
RegisterStateDriver(self, "visibility", self.db.visibility)
|
||||
end
|
||||
else
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
function UF:Update_RaidpetHeader(header, db)
|
||||
header.db = db
|
||||
|
||||
local headerHolder = header:GetParent()
|
||||
headerHolder.db = db
|
||||
|
||||
if not headerHolder.positioned then
|
||||
headerHolder:ClearAllPoints()
|
||||
headerHolder:Point("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 4, 574)
|
||||
|
||||
E:CreateMover(headerHolder, headerHolder:GetName().."Mover", L["Raid Pet Frames"], nil, nil, nil, "ALL,RAID10,RAID25,RAID40", nil, "unitframe,raidpet,generalGroup")
|
||||
headerHolder.positioned = true
|
||||
|
||||
headerHolder:RegisterEvent("PLAYER_LOGIN")
|
||||
headerHolder:RegisterEvent("ZONE_CHANGED_NEW_AREA")
|
||||
headerHolder:SetScript("OnEvent", UF.RaidPetsSmartVisibility)
|
||||
end
|
||||
|
||||
UF.RaidPetsSmartVisibility(headerHolder)
|
||||
end
|
||||
|
||||
function UF:Update_RaidpetFrames(frame, db)
|
||||
if not db then
|
||||
db = frame.db
|
||||
else
|
||||
frame.db = db
|
||||
end
|
||||
|
||||
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
||||
frame.colors = ElvUF.colors
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
|
||||
do
|
||||
if self.thinBorders then
|
||||
frame.SPACING = 0
|
||||
frame.BORDER = E.mult
|
||||
else
|
||||
frame.BORDER = E.Border
|
||||
frame.SPACING = E.Spacing
|
||||
end
|
||||
frame.SHADOW_SPACING = 3
|
||||
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.height
|
||||
|
||||
frame.USE_POWERBAR = false
|
||||
frame.POWERBAR_DETACHED = false
|
||||
frame.USE_INSET_POWERBAR = false
|
||||
frame.USE_MINI_POWERBAR = false
|
||||
frame.USE_POWERBAR_OFFSET = false
|
||||
frame.POWERBAR_OFFSET = 0
|
||||
frame.POWERBAR_HEIGHT = 0
|
||||
frame.POWERBAR_WIDTH = 0
|
||||
|
||||
frame.USE_PORTRAIT = db.portrait and db.portrait.enable
|
||||
frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
|
||||
frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
|
||||
|
||||
frame.CLASSBAR_YOFFSET = 0
|
||||
frame.BOTTOM_OFFSET = 0
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
if not InCombatLockdown() then
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
else
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
--Portrait
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
--Threat
|
||||
UF:Configure_Threat(frame)
|
||||
|
||||
--Auras
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
|
||||
--RaidDebuffs
|
||||
UF:Configure_RaidDebuffs(frame)
|
||||
|
||||
--Raid Icon
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
--Debuff Highlight
|
||||
UF:Configure_DebuffHighlight(frame)
|
||||
|
||||
--OverHealing
|
||||
UF:Configure_HealComm(frame)
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
--BuffIndicator
|
||||
UF:UpdateAuraWatch(frame, true) --2nd argument is the petOverride
|
||||
|
||||
--CustomTexts
|
||||
UF:Configure_CustomTexts(frame)
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
--Added an additional argument at the end, specifying the header Template we want to use
|
||||
UF.headerstoload.raidpet = {nil, nil, "SecureGroupPetHeaderTemplate"}
|
||||
@@ -0,0 +1,189 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
local _, ns = ...
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
--Lua functions
|
||||
local max = math.max
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
|
||||
function UF:Construct_TankFrames()
|
||||
self:SetScript("OnEnter", UnitFrame_OnEnter)
|
||||
self:SetScript("OnLeave", UnitFrame_OnLeave)
|
||||
|
||||
self.RaisedElementParent = CreateFrame("Frame", nil, self)
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
|
||||
self.Health = UF:Construct_HealthBar(self, true)
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.ThreatIndicator = UF:Construct_Threat(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
self.MouseGlow = UF:Construct_MouseGlow(self)
|
||||
self.TargetGlow = UF:Construct_TargetGlow(self)
|
||||
self.Fader = UF:Construct_Fader()
|
||||
self.Cutaway = UF:Construct_Cutaway(self)
|
||||
|
||||
if not self.isChild then
|
||||
self.Buffs = UF:Construct_Buffs(self)
|
||||
self.Debuffs = UF:Construct_Debuffs(self)
|
||||
self.AuraWatch = UF:Construct_AuraWatch(self)
|
||||
self.RaidDebuffs = UF:Construct_RaidDebuffs(self)
|
||||
self.DebuffHighlight = UF:Construct_DebuffHighlight(self)
|
||||
|
||||
self.unitframeType = "tank"
|
||||
else
|
||||
self.unitframeType = "tanktarget"
|
||||
end
|
||||
|
||||
UF:Update_StatusBars()
|
||||
UF:Update_FontStrings()
|
||||
|
||||
self.originalParent = self:GetParent()
|
||||
|
||||
self.db = UF.db.units.tank
|
||||
self.PostCreate = UF.Update_TankFrames
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function UF:Update_TankHeader(header, db)
|
||||
header:Hide()
|
||||
header.db = db
|
||||
|
||||
RegisterStateDriver(header, "visibility", "show")
|
||||
RegisterStateDriver(header, "visibility", "[@raid1,exists] show;hide")
|
||||
|
||||
local width, height = header:GetSize()
|
||||
header.dirtyWidth, header.dirtyHeight = width, max(height, db.height)
|
||||
|
||||
if not header.positioned then
|
||||
header:ClearAllPoints()
|
||||
header:Point("TOPLEFT", E.UIParent, "TOPLEFT", 4, -186)
|
||||
E:CreateMover(header, header:GetName().."Mover", L["MT Frames"], nil, nil, nil, "ALL,RAID", nil, "unitframe,tank,generalGroup")
|
||||
header.mover.positionOverride = "TOPLEFT"
|
||||
header:SetAttribute("minHeight", header.dirtyHeight)
|
||||
header:SetAttribute("minWidth", header.dirtyWidth)
|
||||
header.positioned = true
|
||||
end
|
||||
end
|
||||
|
||||
function UF:Update_TankFrames(frame, db)
|
||||
if not db then
|
||||
db = frame.db
|
||||
else
|
||||
frame.db = db
|
||||
end
|
||||
|
||||
frame.colors = ElvUF.colors
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
|
||||
do
|
||||
frame.ORIENTATION = db.orientation --allow this value to change when unitframes position changes on screen?
|
||||
if self.thinBorders then
|
||||
frame.SPACING = 0
|
||||
frame.BORDER = E.mult
|
||||
else
|
||||
frame.BORDER = E.Border
|
||||
frame.SPACING = E.Spacing
|
||||
end
|
||||
frame.SHADOW_SPACING = 3
|
||||
|
||||
frame.UNIT_WIDTH = db.width
|
||||
frame.UNIT_HEIGHT = db.height
|
||||
|
||||
frame.USE_POWERBAR = false
|
||||
frame.POWERBAR_DETACHED = false
|
||||
frame.USE_INSET_POWERBAR = false
|
||||
frame.USE_MINI_POWERBAR = false
|
||||
frame.USE_POWERBAR_OFFSET = false
|
||||
frame.POWERBAR_OFFSET = 0
|
||||
frame.POWERBAR_HEIGHT = 0
|
||||
frame.POWERBAR_WIDTH = 0
|
||||
|
||||
frame.USE_PORTRAIT = false
|
||||
frame.USE_PORTRAIT_OVERLAY = false
|
||||
frame.PORTRAIT_WIDTH = 0
|
||||
|
||||
frame.CLASSBAR_YOFFSET = 0
|
||||
frame.BOTTOM_OFFSET = 0
|
||||
|
||||
frame.VARIABLES_SET = true
|
||||
end
|
||||
|
||||
if frame.isChild and frame.originalParent then
|
||||
local childDB = db.targetsGroup
|
||||
frame.db = db.targetsGroup
|
||||
if not frame.originalParent.childList then
|
||||
frame.originalParent.childList = {}
|
||||
end
|
||||
frame.originalParent.childList[frame] = true
|
||||
|
||||
if not InCombatLockdown() then
|
||||
if childDB.enable then
|
||||
frame:SetParent(frame.originalParent)
|
||||
RegisterUnitWatch(frame)
|
||||
frame:Size(childDB.width, childDB.height)
|
||||
frame:ClearAllPoints()
|
||||
frame:Point(E.InversePoints[childDB.anchorPoint], frame.originalParent, childDB.anchorPoint, childDB.xOffset, childDB.yOffset)
|
||||
else
|
||||
UnregisterUnitWatch(frame)
|
||||
frame:SetParent(E.HiddenFrame)
|
||||
end
|
||||
else
|
||||
if childDB.enable then
|
||||
frame:SetAttribute("initial-anchor", format("%s,%s,%d,%d", E.InversePoints[childDB.anchorPoint], childDB.anchorPoint, childDB.xOffset, childDB.yOffset))
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
end
|
||||
else
|
||||
if not InCombatLockdown() then
|
||||
frame:Size(frame.UNIT_WIDTH, frame.UNIT_HEIGHT)
|
||||
else
|
||||
frame:SetAttribute("initial-width", frame.UNIT_WIDTH)
|
||||
frame:SetAttribute("initial-height", frame.UNIT_HEIGHT)
|
||||
end
|
||||
end
|
||||
|
||||
--Health
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
--Name
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
--Threat
|
||||
UF:Configure_Threat(frame)
|
||||
|
||||
--Fader
|
||||
UF:Configure_Fader(frame)
|
||||
|
||||
--Cutaway
|
||||
UF:Configure_Cutaway(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
if not frame.isChild then
|
||||
--Auras
|
||||
UF:EnableDisable_Auras(frame)
|
||||
UF:Configure_Auras(frame, "Buffs")
|
||||
UF:Configure_Auras(frame, "Debuffs")
|
||||
|
||||
--RaidDebuffs
|
||||
UF:Configure_RaidDebuffs(frame)
|
||||
|
||||
--Debuff Highlight
|
||||
UF:Configure_DebuffHighlight(frame)
|
||||
|
||||
--Buff Indicator
|
||||
UF:UpdateAuraWatch(frame)
|
||||
end
|
||||
|
||||
frame:UpdateAllElements("ForceUpdate")
|
||||
end
|
||||
|
||||
UF.headerstoload.tank = {"MAINTANK", "ELVUI_UNITTARGET"}
|
||||
Reference in New Issue
Block a user