mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update some more (still needs more work)
This commit is contained in:
@@ -0,0 +1,244 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
local LSM = LibStub("LibSharedMedia-3.0");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local assert, select, pairs, unpack = assert, select, pairs, unpack
|
||||
local tinsert, wipe = tinsert, wipe
|
||||
local getn = table.getn
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local UnitBuff = UnitBuff
|
||||
|
||||
function UF:Construct_AuraWatch(frame)
|
||||
local auras = CreateFrame("Frame", nil, frame)
|
||||
auras:SetFrameLevel(frame.RaisedElementParent:GetFrameLevel() + 10)
|
||||
E:SetInside(auras, frame.Health)
|
||||
auras.presentAlpha = 1
|
||||
auras.missingAlpha = 0
|
||||
auras.icons = {}
|
||||
|
||||
return auras
|
||||
end
|
||||
|
||||
local counterOffsets = {
|
||||
["TOPLEFT"] = {6, 1},
|
||||
["TOPRIGHT"] = {-6, 1},
|
||||
["BOTTOMLEFT"] = {6, 1},
|
||||
["BOTTOMRIGHT"] = {-6, 1},
|
||||
["LEFT"] = {6, 1},
|
||||
["RIGHT"] = {-6, 1},
|
||||
["TOP"] = {0, 0},
|
||||
["BOTTOM"] = {0, 0}
|
||||
}
|
||||
|
||||
local textCounterOffsets = {
|
||||
["TOPLEFT"] = {"LEFT", "RIGHT", -2, 0},
|
||||
["TOPRIGHT"] = {"RIGHT", "LEFT", 2, 0},
|
||||
["BOTTOMLEFT"] = {"LEFT", "RIGHT", -2, 0},
|
||||
["BOTTOMRIGHT"] = {"RIGHT", "LEFT", 2, 0},
|
||||
["LEFT"] = {"LEFT", "RIGHT", -2, 0},
|
||||
["RIGHT"] = {"RIGHT", "LEFT", 2, 0},
|
||||
["TOP"] = {"RIGHT", "LEFT", 2, 0},
|
||||
["BOTTOM"] = {"RIGHT", "LEFT", 2, 0}
|
||||
}
|
||||
|
||||
function UF:UpdateAuraWatchFromHeader(group, petOverride)
|
||||
assert(self[group], "Invalid group specified.")
|
||||
group = self[group]
|
||||
for i = 1, group:GetNumChildren() do
|
||||
local frame = select(i, group:GetChildren())
|
||||
if frame and frame.Health then
|
||||
UF:UpdateAuraWatch(frame, petOverride, group.db)
|
||||
elseif frame then
|
||||
for n = 1, frame:GetNumChildren() do
|
||||
local child = select(n, frame:GetChildren())
|
||||
if child and child.Health then
|
||||
UF:UpdateAuraWatch(child, petOverride, group.db)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local buffs = {}
|
||||
function UF:UpdateAuraWatch(frame, petOverride, db)
|
||||
wipe(buffs)
|
||||
local auras = frame.AuraWatch
|
||||
db = db and db.buffIndicator or frame.db.buffIndicator
|
||||
|
||||
if not db.enable then
|
||||
auras:Hide()
|
||||
return
|
||||
else
|
||||
auras:Show()
|
||||
end
|
||||
|
||||
if frame.unit == "pet" and not petOverride then
|
||||
local petWatch = E.global.unitframe.buffwatch.PET or {}
|
||||
for _, value in pairs(petWatch) do
|
||||
if value.style == "text" then value.style = "NONE" end --depreciated
|
||||
tinsert(buffs, value)
|
||||
end
|
||||
else
|
||||
local buffWatch = not db.profileSpecific and (E.global.unitframe.buffwatch[E.myclass] or {}) or (E.db.unitframe.filters.buffwatch or {})
|
||||
for _, value in pairs(buffWatch) do
|
||||
if value.style == "text" then value.style = "NONE" end --depreciated
|
||||
tinsert(buffs, value)
|
||||
end
|
||||
end
|
||||
|
||||
--CLEAR CACHE
|
||||
if auras.icons then
|
||||
for i = 1, getn(auras.icons) do
|
||||
local matchFound = false
|
||||
for j = 1, getn(buffs) do
|
||||
if buffs[j].id and buffs[j].id == auras.icons[i] then
|
||||
matchFound = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not matchFound then
|
||||
auras.icons[i]:Hide()
|
||||
auras.icons[i] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local unitframeFont = LSM:Fetch("font", E.db.unitframe.font)
|
||||
|
||||
for i = 1, getn(buffs) do
|
||||
if buffs[i].id then
|
||||
local name, _, image = UnitBuff(frame.unit, buffs[i].id)
|
||||
if name then
|
||||
local icon
|
||||
if not auras.icons[buffs[i].id] then
|
||||
icon = CreateFrame("Frame", nil, auras)
|
||||
else
|
||||
icon = auras.icons[buffs[i].id]
|
||||
end
|
||||
icon.name = name
|
||||
icon.image = image
|
||||
icon.spellID = buffs[i].id
|
||||
icon.style = buffs[i].style
|
||||
icon.onlyShowMissing = buffs[i].onlyShowMissing
|
||||
icon.presentAlpha = icon.onlyShowMissing and 0 or 1
|
||||
icon.missingAlpha = icon.onlyShowMissing and 1 or 0
|
||||
icon.textThreshold = buffs[i].textThreshold or -1
|
||||
icon.displayText = buffs[i].displayText
|
||||
icon.decimalThreshold = buffs[i].decimalThreshold
|
||||
icon.size = (buffs[i].sizeOverride ~= nil and buffs[i].sizeOverride > 0 and buffs[i].sizeOverride or db.size)
|
||||
|
||||
icon:SetWidth(icon.size)
|
||||
icon:SetHeight(icon.size)
|
||||
--Protect against missing .point value
|
||||
if not buffs[i].point then buffs[i].point = "TOPLEFT" end
|
||||
|
||||
icon:ClearAllPoints()
|
||||
E:Point(icon, buffs[i].point or "TOPLEFT", frame.Health, buffs[i].point or "TOPLEFT", buffs[i].xOffset, buffs[i].yOffset)
|
||||
|
||||
if not icon.icon then
|
||||
icon.icon = icon:CreateTexture(nil, "BORDER")
|
||||
icon.icon:SetAllPoints(icon)
|
||||
end
|
||||
|
||||
if not icon.text then
|
||||
local f = CreateFrame("Frame", nil, icon)
|
||||
f:SetFrameLevel(icon:GetFrameLevel() + 50)
|
||||
icon.text = f:CreateFontString(nil, "BORDER")
|
||||
end
|
||||
|
||||
if not icon.border then
|
||||
icon.border = icon:CreateTexture(nil, "BACKGROUND")
|
||||
E:Point(icon.border, "TOPLEFT", -E.mult, E.mult)
|
||||
E:Point(icon.border, "BOTTOMRIGHT", E.mult, -E.mult)
|
||||
icon.border:SetTexture(E.media.blankTex)
|
||||
icon.border:SetVertexColor(0, 0, 0)
|
||||
end
|
||||
|
||||
if not icon.cd then
|
||||
icon.cd = CreateFrame("Cooldown", nil, icon, "CooldownFrameTemplate")
|
||||
icon.cd:SetAllPoints(icon)
|
||||
icon.cd.noOCC = true
|
||||
icon.cd.noCooldownCount = true
|
||||
icon.cd:SetReverse(true)
|
||||
icon.cd:SetFrameLevel(icon:GetFrameLevel())
|
||||
end
|
||||
|
||||
if icon.style == "coloredIcon" then
|
||||
icon.icon:SetTexture(E.media.blankTex)
|
||||
|
||||
if buffs[i].color then
|
||||
icon.icon:SetVertexColor(buffs[i].color.r, buffs[i].color.g, buffs[i].color.b)
|
||||
else
|
||||
icon.icon:SetVertexColor(0.8, 0.8, 0.8)
|
||||
end
|
||||
icon.icon:Show()
|
||||
icon.border:Show()
|
||||
icon.cd:SetAlpha(1)
|
||||
elseif icon.style == "texturedIcon" then
|
||||
icon.icon:SetVertexColor(1, 1, 1)
|
||||
icon.icon:SetTexCoord(unpack(E.TexCoords))
|
||||
icon.icon:SetTexture(icon.image)
|
||||
icon.icon:Show()
|
||||
icon.border:Show()
|
||||
icon.cd:SetAlpha(1)
|
||||
else
|
||||
icon.border:Hide()
|
||||
icon.icon:Hide()
|
||||
icon.cd:SetAlpha(0)
|
||||
end
|
||||
|
||||
if icon.displayText then
|
||||
icon.text:Show()
|
||||
local r, g, b = 1, 1, 1
|
||||
if buffs[i].textColor then
|
||||
r, g, b = buffs[i].textColor.r, buffs[i].textColor.g, buffs[i].textColor.b
|
||||
end
|
||||
|
||||
icon.text:SetTextColor(r, g, b)
|
||||
else
|
||||
icon.text:Hide()
|
||||
end
|
||||
|
||||
if not icon.count then
|
||||
icon.count = icon:CreateFontString(nil, "OVERLAY")
|
||||
end
|
||||
|
||||
icon.count:ClearAllPoints()
|
||||
if icon.displayText then
|
||||
local point, anchorPoint, x, y = unpack(textCounterOffsets[buffs[i].point])
|
||||
E:Point(icon.count, point, icon.text, anchorPoint, x, y)
|
||||
else
|
||||
E:Point(icon.count, "CENTER", unpack(counterOffsets[buffs[i].point]))
|
||||
end
|
||||
|
||||
E:FontTemplate(icon.count, unitframeFont, db.fontSize, E.db.unitframe.fontOutline)
|
||||
E:FontTemplate(icon.text, unitframeFont, db.fontSize, E.db.unitframe.fontOutline)
|
||||
icon.text:ClearAllPoints()
|
||||
E:Point(icon.text, buffs[i].point, icon, buffs[i].point)
|
||||
|
||||
if buffs[i].enabled then
|
||||
auras.icons[buffs[i].id] = icon
|
||||
if auras.watched then
|
||||
auras.watched[buffs[i].id] = icon
|
||||
end
|
||||
else
|
||||
auras.icons[buffs[i].id] = nil
|
||||
if auras.watched then
|
||||
auras.watched[buffs[i].id] = nil
|
||||
end
|
||||
icon:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if frame.AuraWatch.Update then
|
||||
frame.AuraWatch.Update(frame)
|
||||
end
|
||||
|
||||
frame:UpdateElement("AuraWatch")
|
||||
end
|
||||
@@ -80,14 +80,14 @@ function UF:Configure_ClassBar(frame)
|
||||
end
|
||||
else --Detached
|
||||
CLASSBAR_WIDTH = db.classbar.detachedWidth - ((frame.BORDER + frame.SPACING)*2)
|
||||
bars.Holder:Size(db.classbar.detachedWidth, db.classbar.height)
|
||||
E:Size(bars.Holder, db.classbar.detachedWidth, db.classbar.height)
|
||||
|
||||
if not bars.Holder.mover then
|
||||
bars:Width(CLASSBAR_WIDTH)
|
||||
bars:Height(frame.CLASSBAR_HEIGHT - ((frame.BORDER+frame.SPACING)*2))
|
||||
bars:SerWidth(CLASSBAR_WIDTH)
|
||||
bars:SetHeight(frame.CLASSBAR_HEIGHT - ((frame.BORDER+frame.SPACING)*2))
|
||||
bars:ClearAllPoints()
|
||||
E:Point(bars, "BOTTOMLEFT", bars.Holder, "BOTTOMLEFT", frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING)
|
||||
E:CreateMover(bars.Holder, "ClassBarMover", L["Classbar"], nil, nil, nil, "ALL,SOLO")
|
||||
E:CreateMover(bars.Holder, "ClassBarMover", L["Classbar"], nil, nil, nil, "ALL,SOLO", nil, "unitframe,player,classbar")
|
||||
else
|
||||
bars:ClearAllPoints()
|
||||
E:Point(bars, "BOTTOMLEFT", bars.Holder, "BOTTOMLEFT", frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING)
|
||||
@@ -114,8 +114,8 @@ function UF:Configure_ClassBar(frame)
|
||||
end
|
||||
end
|
||||
|
||||
bars:Width(CLASSBAR_WIDTH)
|
||||
bars:Height(frame.CLASSBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
|
||||
bars:SetWidth(CLASSBAR_WIDTH)
|
||||
bars:SetHeight(frame.CLASSBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
|
||||
|
||||
if frame.ClassBar == "DruidAltMana" then
|
||||
if frame.CLASSBAR_DETACHED and db.classbar.verticalOrientation then
|
||||
@@ -137,6 +137,7 @@ function UF:Configure_ClassBar(frame)
|
||||
end
|
||||
|
||||
local function ToggleResourceBar(bars, overrideVisibility)
|
||||
local bars = bars or this
|
||||
local frame = bars.origParent or bars:GetParent()
|
||||
local db = frame.db
|
||||
if not db then return end
|
||||
@@ -177,13 +178,13 @@ function UF:Construct_DruidAltMana(frame)
|
||||
druidAltMana.colorPower = true
|
||||
druidAltMana.PostUpdate = UF.PostUpdateDruidAltMana
|
||||
druidAltMana.PostUpdateVisibility = UF.PostVisibilityDruidAltMana
|
||||
druidAltMana:CreateBackdrop("Default")
|
||||
UF["statusbars"][druidAltMana] = true
|
||||
druidAltMana:SetStatusBarTexture(E["media"].blankTex)
|
||||
E:CreateBackdrop(druidAltMana, "Default")
|
||||
UF.statusbars[druidAltMana] = true
|
||||
druidAltMana:SetStatusBarTexture(E.media.blankTex)
|
||||
|
||||
druidAltMana.bg = druidAltMana:CreateTexture(nil, "BORDER")
|
||||
druidAltMana.bg:SetAllPoints(druidAltMana)
|
||||
druidAltMana.bg:SetTexture(E["media"].blankTex)
|
||||
druidAltMana.bg:SetTexture(E.media.blankTex)
|
||||
druidAltMana.bg.multiplier = 0.3
|
||||
|
||||
druidAltMana.text = druidAltMana:CreateFontString(nil, "OVERLAY")
|
||||
@@ -195,17 +196,18 @@ function UF:Construct_DruidAltMana(frame)
|
||||
return druidAltMana
|
||||
end
|
||||
|
||||
function UF:PostUpdateDruidAltMana(_, min, max, event)
|
||||
function UF:PostUpdateDruidAltMana(_, cur, max, event)
|
||||
local frame = self.origParent or self:GetParent()
|
||||
local db = frame.db
|
||||
|
||||
if frame.USE_CLASSBAR and ((min ~= max or (not db.classbar.autoHide)) and (event ~= "ElementDisable")) then
|
||||
--if frame.USE_CLASSBAR and ((cur ~= max or (not db.classbar.autoHide)) and (event ~= "ElementDisable")) then
|
||||
if frame.USE_CLASSBAR and ((cur ~= max or (not db.classbar.autoHide)) and (event ~= "ElementDisable")) then
|
||||
if db.classbar.additionalPowerText then
|
||||
local powerValue = frame.Power.value
|
||||
local powerValueText = powerValue:GetText()
|
||||
local powerValueParent = powerValue:GetParent()
|
||||
local powerTextPosition = db.power.position
|
||||
local color = ElvUF["colors"].power[0]
|
||||
local color = ElvUF.colors.power[0]
|
||||
color = E:RGBToHex(color[1], color[2], color[3])
|
||||
|
||||
--Attempt to remove |cFFXXXXXX color codes in order to determine if power text is really empty
|
||||
@@ -224,27 +226,27 @@ function UF:PostUpdateDruidAltMana(_, min, max, event)
|
||||
if (powerValueText and (powerValueText ~= "" and powerValueText ~= " ")) then
|
||||
if find(powerTextPosition, "RIGHT") then
|
||||
E:Point(self.text, "RIGHT", powerValue, "LEFT", 3, 0)
|
||||
self.text:SetText(format(color.."%d%%|r |cffD7BEA5- |r", floor(min / max * 100)))
|
||||
self.text:SetText(format(color.."%d%%|r |cffD7BEA5- |r", floor(cur / max * 100)))
|
||||
elseif find(powerTextPosition, "LEFT") then
|
||||
E:Point(self.text, "LEFT", powerValue, "RIGHT", -3, 0)
|
||||
self.text:SetText(format("|cffD7BEA5 -|r"..color.." %d%%|r", floor(min / max * 100)))
|
||||
self.text:SetText(format("|cffD7BEA5 -|r"..color.." %d%%|r", floor(cur / max * 100)))
|
||||
else
|
||||
if select(4, powerValue:GetPoint()) <= 0 then
|
||||
E:Point(self.text, "LEFT", powerValue, "RIGHT", -3, 0)
|
||||
self.text:SetText(format(" |cffD7BEA5-|r"..color.." %d%%|r", floor(min / max * 100)))
|
||||
self.text:SetText(format(" |cffD7BEA5-|r"..color.." %d%%|r", floor(cur / max * 100)))
|
||||
else
|
||||
E:Point(self.text, "RIGHT", powerValue, "LEFT", 3, 0)
|
||||
self.text:SetText(format(color.."%d%%|r |cffD7BEA5- |r", floor(min / max * 100)))
|
||||
self.text:SetText(format(color.."%d%%|r |cffD7BEA5- |r", floor(cur / max * 100)))
|
||||
end
|
||||
end
|
||||
else
|
||||
E:Point(self.text, powerValue:GetPoint())
|
||||
self.text:SetText(format(color.."%d%%|r", floor(min / max * 100)))
|
||||
self.text:SetText(format(color.."%d%%|r", floor(cur / max * 100)))
|
||||
end
|
||||
else
|
||||
self.text:SetParent(self)
|
||||
self.text:SetParent(frame.RaisedElementParent)
|
||||
E:Point(self.text, "CENTER", self)
|
||||
self.text:SetText(format(color.."%d%%|r", floor(min / max * 100)))
|
||||
self.text:SetText(format(color.."%d%%|r", floor(cur / max * 100)))
|
||||
end
|
||||
else --Text disabled
|
||||
self.text:SetText()
|
||||
@@ -264,6 +266,6 @@ function UF:PostVisibilityDruidAltMana(enabled, stateChanged)
|
||||
UF:Configure_ClassBar(frame)
|
||||
UF:Configure_HealthBar(frame)
|
||||
UF:Configure_Power(frame)
|
||||
UF:Configure_InfoPanel(frame, true) --2nd argument is to prevent it from setting template, which removes threat border
|
||||
UF:Configure_InfoPanel(frame)
|
||||
end
|
||||
end
|
||||
@@ -12,9 +12,9 @@ function UF:Construct_CombatIndicator(frame)
|
||||
end
|
||||
|
||||
function UF:Configure_CombatIndicator(frame)
|
||||
if frame.db.combatIcon and not frame:IsElementEnabled('CombatIndicator') then
|
||||
if frame.db.combatIcon and not frame:IsElementEnabled("CombatIndicator") then
|
||||
frame:EnableElement("CombatIndicator")
|
||||
elseif not frame.db.combatIcon and frame:IsElementEnabled('CombatIndicator') then
|
||||
elseif not frame.db.combatIcon and frame:IsElementEnabled("CombatIndicator") then
|
||||
frame:DisableElement("CombatIndicator")
|
||||
frame.CombatIndicator:Hide()
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
function UF:Construct_HealthBar(frame, bg, text, textPos)
|
||||
local health = CreateFrame("StatusBar", nil, frame)
|
||||
UF["statusbars"][health] = true
|
||||
UF.statusbars[health] = true
|
||||
|
||||
health:SetFrameLevel(10) --Make room for Portrait and Power which should be lower by default
|
||||
health.PostUpdate = self.PostUpdateHealth
|
||||
@@ -202,7 +202,7 @@ function UF:PostUpdateHealth(unit, min, max)
|
||||
end
|
||||
|
||||
local r, g, b = self:GetStatusBarColor()
|
||||
local colors = E.db["unitframe"]["colors"]
|
||||
local colors = E.db.unitframe.colors
|
||||
if ((colors.healthclass == true and colors.colorhealthbyvalue == true) or (colors.colorhealthbyvalue and parent.isForced)) and not (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
|
||||
local newr, newg, newb = ElvUF.ColorGradient(min, max, 1, 0, 0, 1, 1, 0, r, g, b)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="Auras.lua"/>
|
||||
<Script file="BuffIndicator.lua"/>
|
||||
<Script file="Castbar.lua"/>
|
||||
<Script file="Classbars.lua"/>
|
||||
<Script file="CombatIndicator.lua"/>
|
||||
@@ -15,11 +16,9 @@
|
||||
<Script file="InfoPanel.lua"/>
|
||||
<Script file="PvPIcon.lua"/>
|
||||
<Script file="PvPIndicator.lua"/>
|
||||
<Script file="RaidDebuffs.lua"/>
|
||||
<Script file="RaidIcon.lua"/>
|
||||
<Script file="RaidRoleIcons.lua"/>
|
||||
<Script file="Range.lua"/>
|
||||
<Script file="ReadyCheckIcon.lua"/>
|
||||
<Script file="RestingIndicator.lua"/>
|
||||
<Script file="ResurrectionIcon.lua"/>
|
||||
<Script file="FrameGlow.lua"/>
|
||||
</Ui>
|
||||
@@ -241,4 +241,9 @@ function UF:PostUpdatePower(unit, cur, max)
|
||||
if db and db.power and db.power.hideonnpc then
|
||||
UF:PostNamePosition(parent, unit)
|
||||
end
|
||||
|
||||
--Force update to DruidAltMana in order to reposition text if necessary
|
||||
if parent:IsElementEnabled("DruidAltMana") then
|
||||
E:Delay(0.01, parent.DruidAltMana.ForceUpdate, parent.DruidAltMana) --Delay it slightly so Power text has a chance to clear itself first
|
||||
end
|
||||
end
|
||||
@@ -1,11 +1,6 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
|
||||
--WoW API / Variables
|
||||
|
||||
function UF:Construct_PvPIndicator(frame)
|
||||
local pvp = frame.RaisedElementParent:CreateFontString(nil, "OVERLAY")
|
||||
UF:Configure_FontString(pvp)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local unpack = unpack
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
|
||||
function UF:Construct_RaidDebuffs(frame)
|
||||
local rdebuff = CreateFrame("Frame", nil, frame.RaisedElementParent)
|
||||
E:SetTemplate(rdebuff, "Default", nil, nil, UF.thinBorders, true)
|
||||
rdebuff:SetFrameLevel(frame.RaisedElementParent:GetFrameLevel() + 20) --Make them appear above regular buffs or debuffs
|
||||
|
||||
local offset = UF.thinBorders and E.mult or E.Border
|
||||
rdebuff.icon = rdebuff:CreateTexture(nil, "OVERLAY")
|
||||
rdebuff.icon:SetTexCoord(unpack(E.TexCoords))
|
||||
E:SetInside(rdebuff.icon, rdebuff, offset, offset)
|
||||
|
||||
rdebuff.count = rdebuff:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(rdebuff.count, nil, 10, "OUTLINE")
|
||||
E:Point(rdebuff.count, "BOTTOMRIGHT", 0, 2)
|
||||
rdebuff.count:SetTextColor(1, .9, 0)
|
||||
|
||||
rdebuff.time = rdebuff:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(rdebuff.time, nil, 10, "OUTLINE")
|
||||
E:Point(rdebuff.time, "CENTER")
|
||||
rdebuff.time:SetTextColor(1, .9, 0)
|
||||
|
||||
return rdebuff
|
||||
end
|
||||
|
||||
function UF:Configure_RaidDebuffs(frame)
|
||||
if not frame.VARIABLES_SET then return end
|
||||
local db = frame.db
|
||||
local rdebuffs = frame.RaidDebuffs
|
||||
|
||||
if db.rdebuffs.enable then
|
||||
local stackColor = db.rdebuffs.stack.color
|
||||
local durationColor = db.rdebuffs.duration.color
|
||||
local rdebuffsFont = UF.LSM:Fetch("font", db.rdebuffs.font)
|
||||
if not frame:IsElementEnabled("RaidDebuffs") then
|
||||
frame:EnableElement("RaidDebuffs")
|
||||
end
|
||||
|
||||
rdebuffs.showDispellableDebuff = db.rdebuffs.showDispellableDebuff
|
||||
rdebuffs.forceShow = frame.forceShowAuras
|
||||
E:Size(rdebuffs, db.rdebuffs.size)
|
||||
E:Point(rdebuffs, "BOTTOM", frame, "BOTTOM", db.rdebuffs.xOffset, db.rdebuffs.yOffset + frame.SPACING)
|
||||
|
||||
E:FontTemplate(rdebuffs.count, rdebuffsFont, db.rdebuffs.fontSize, db.rdebuffs.fontOutline)
|
||||
rdebuffs.count:ClearAllPoints()
|
||||
E:Point(rdebuffs.count, db.rdebuffs.stack.position, db.rdebuffs.stack.xOffset, db.rdebuffs.stack.yOffset)
|
||||
rdebuffs.count:SetTextColor(stackColor.r, stackColor.g, stackColor.b, stackColor.a)
|
||||
|
||||
E:FontTemplate(rdebuffs.time, rdebuffsFont, db.rdebuffs.fontSize, db.rdebuffs.fontOutline)
|
||||
rdebuffs.time:ClearAllPoints()
|
||||
E:Point(rdebuffs.time, db.rdebuffs.duration.position, db.rdebuffs.duration.xOffset, db.rdebuffs.duration.yOffset)
|
||||
rdebuffs.time:SetTextColor(durationColor.r, durationColor.g, durationColor.b, durationColor.a)
|
||||
elseif frame:IsElementEnabled("RaidDebuffs") then
|
||||
frame:DisableElement("RaidDebuffs")
|
||||
rdebuffs:Hide()
|
||||
end
|
||||
end
|
||||
@@ -1,95 +0,0 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
|
||||
local ns = oUF
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
function UF:Construct_RaidRoleFrames(frame)
|
||||
local anchor = CreateFrame("Frame", nil, frame.RaisedElementParent)
|
||||
frame.LeaderIndicator = anchor:CreateTexture(nil, "OVERLAY")
|
||||
frame.AssistantIndicator = anchor:CreateTexture(nil, "OVERLAY")
|
||||
frame.MasterLooterIndicator = anchor:CreateTexture(nil, "OVERLAY")
|
||||
|
||||
anchor:SetWidth(24)
|
||||
anchor:SetHeight(12)
|
||||
frame.LeaderIndicator:SetWidth(12)
|
||||
frame.LeaderIndicator:SetHeight(12)
|
||||
frame.AssistantIndicator:SetWidth(12)
|
||||
frame.AssistantIndicator:SetHeight(12)
|
||||
frame.MasterLooterIndicator:SetWidth(11)
|
||||
frame.MasterLooterIndicator:SetHeight(11)
|
||||
|
||||
frame.LeaderIndicator.PostUpdate = UF.RaidRoleUpdate
|
||||
frame.AssistantIndicator.PostUpdate = UF.RaidRoleUpdate
|
||||
frame.MasterLooterIndicator.PostUpdate = UF.RaidRoleUpdate
|
||||
|
||||
return anchor
|
||||
end
|
||||
|
||||
function UF:Configure_RaidRoleIcons(frame)
|
||||
local raidRoleFrameAnchor = frame.RaidRoleFramesAnchor
|
||||
|
||||
if frame.db.raidRoleIcons.enable then
|
||||
raidRoleFrameAnchor:Show()
|
||||
if not frame:IsElementEnabled("LeaderIndicator") then
|
||||
frame:EnableElement("LeaderIndicator")
|
||||
frame:EnableElement("MasterLooterIndicator")
|
||||
frame:EnableElement("AssistantIndicator")
|
||||
end
|
||||
|
||||
raidRoleFrameAnchor:ClearAllPoints()
|
||||
if frame.db.raidRoleIcons.position == "TOPLEFT" then
|
||||
raidRoleFrameAnchor:SetPoint("LEFT", frame.Health, "TOPLEFT", 2, 0)
|
||||
else
|
||||
raidRoleFrameAnchor:SetPoint("RIGHT", frame, "TOPRIGHT", -2, 0)
|
||||
end
|
||||
elseif frame:IsElementEnabled("LeaderIndicator") then
|
||||
raidRoleFrameAnchor:Hide()
|
||||
frame:DisableElement("LeaderIndicator")
|
||||
frame:DisableElement("MasterLooterIndicator")
|
||||
frame:DisableElement("AssistantIndicator")
|
||||
end
|
||||
end
|
||||
|
||||
function UF:RaidRoleUpdate()
|
||||
local anchor = self:GetParent()
|
||||
local frame = anchor:GetParent():GetParent()
|
||||
local leader = frame.LeaderIndicator
|
||||
local assistant = frame.AssistantIndicator
|
||||
local masterLooter = frame.MasterLooterIndicator
|
||||
|
||||
if not leader or not masterLooter or not assistant then return; end
|
||||
|
||||
local db = frame.db
|
||||
local isLeader = leader:IsShown()
|
||||
local isMasterLooter = masterLooter:IsShown()
|
||||
local isAssist = assistant:IsShown()
|
||||
|
||||
leader:ClearAllPoints()
|
||||
assistant:ClearAllPoints()
|
||||
masterLooter:ClearAllPoints()
|
||||
|
||||
if db and db.raidRoleIcons then
|
||||
if isLeader and db.raidRoleIcons.position == "TOPLEFT" then
|
||||
leader:SetPoint("LEFT", anchor, "LEFT")
|
||||
masterLooter:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
elseif isLeader and db.raidRoleIcons.position == "TOPRIGHT" then
|
||||
leader:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
masterLooter:SetPoint("LEFT", anchor, "LEFT")
|
||||
elseif isAssist and db.raidRoleIcons.position == "TOPLEFT" then
|
||||
assistant:SetPoint("LEFT", anchor, "LEFT")
|
||||
masterLooter:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
elseif isAssist and db.raidRoleIcons.position == "TOPRIGHT" then
|
||||
assistant:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
masterLooter:SetPoint("LEFT", anchor, "LEFT")
|
||||
elseif isMasterLooter and db.raidRoleIcons.position == "TOPLEFT" then
|
||||
masterLooter:SetPoint("LEFT", anchor, "LEFT")
|
||||
else
|
||||
masterLooter:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
function UF:Construct_ReadyCheckIcon(frame)
|
||||
local tex = frame.RaisedElementParent.TextureParent:CreateTexture(nil, "OVERLAY")
|
||||
E:Size(tex, 12)
|
||||
E:Point(tex, "BOTTOM", frame.Health, "BOTTOM", 0, 2)
|
||||
|
||||
return tex
|
||||
end
|
||||
|
||||
function UF:Configure_ReadyCheckIcon(frame)
|
||||
local ReadyCheckIndicator = frame.ReadyCheckIndicator
|
||||
local db = frame.db
|
||||
|
||||
if db.readycheckIcon.enable then
|
||||
if not frame:IsElementEnabled("ReadyCheckIndicator") then
|
||||
frame:EnableElement("ReadyCheckIndicator")
|
||||
end
|
||||
|
||||
local attachPoint = self:GetObjectAnchorPoint(frame, db.readycheckIcon.attachTo)
|
||||
ReadyCheckIndicator:ClearAllPoints()
|
||||
E:Point(ReadyCheckIndicator, db.readycheckIcon.position, attachPoint, db.readycheckIcon.position, db.readycheckIcon.xOffset, db.readycheckIcon.yOffset)
|
||||
E:Size(ReadyCheckIndicator, db.readycheckIcon.size)
|
||||
else
|
||||
frame:DisableElement("ReadyCheckIndicator")
|
||||
end
|
||||
end
|
||||
@@ -1,34 +0,0 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
function UF:Construct_ResurrectionIcon(frame)
|
||||
local tex = frame.RaisedElementParent.TextureParent:CreateTexture(nil, "OVERLAY")
|
||||
tex:SetTexture([[Interface\AddOns\ElvUI\media\textures\Raid-Icon-Rez]])
|
||||
E:Point(tex, "CENTER", frame.Health, "CENTER")
|
||||
E:Size(tex, 30)
|
||||
tex:SetDrawLayer("OVERLAY", 7)
|
||||
|
||||
return tex
|
||||
end
|
||||
|
||||
function UF:Configure_ResurrectionIcon(frame)
|
||||
local RI = frame.ResurrectIndicator
|
||||
local db = frame.db
|
||||
|
||||
if db.resurrectIcon.enable then
|
||||
if not frame:IsElementEnabled("ResurrectIndicator") then
|
||||
frame:EnableElement("ResurrectIndicator")
|
||||
end
|
||||
RI:Show()
|
||||
E:Size(RI, db.resurrectIcon.size)
|
||||
|
||||
local attachPoint = self:GetObjectAnchorPoint(frame, db.resurrectIcon.attachToObject)
|
||||
RI:ClearAllPoints()
|
||||
E:Point(RI, db.resurrectIcon.attachTo, attachPoint, db.resurrectIcon.attachTo, db.resurrectIcon.xOffset, db.resurrectIcon.yOffset)
|
||||
else
|
||||
if frame:IsElementEnabled("ResurrectIndicator") then
|
||||
frame:DisableElement("ResurrectIndicator")
|
||||
end
|
||||
RI:Hide()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user