mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
test nameplate
This commit is contained in:
@@ -1,39 +1,124 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI)
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
local mod = E:GetModule("NamePlates")
|
local mod = E:GetModule("NamePlates");
|
||||||
local LSM = LibStub("LibSharedMedia-3.0")
|
local LSM = LibStub("LibSharedMedia-3.0");
|
||||||
|
|
||||||
|
--Cache global variables
|
||||||
|
--Lua functions
|
||||||
|
--WoW API / Variables
|
||||||
local CreateFrame = CreateFrame
|
local CreateFrame = CreateFrame
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Target Glow Style Option Variables
|
||||||
|
style1 - Border
|
||||||
|
style2 - Background
|
||||||
|
style3 - Top Arrow Only
|
||||||
|
style4 - Side Arrows Only
|
||||||
|
style5 - Border + Top Arrow
|
||||||
|
style6 - Background + Top Arrow
|
||||||
|
style7 - Border + Side Arrows
|
||||||
|
style8 - Background + Side Arrows
|
||||||
|
]]
|
||||||
|
|
||||||
|
function mod:UpdatePoisiton_Arrow(frame, shouldShow)
|
||||||
|
if frame.TopArrow and (shouldShow ~= 2) and (self.db.targetGlow == "style3" or self.db.targetGlow == "style5" or self.db.targetGlow == "style6") then -- top arrow
|
||||||
|
local topArrowSpace = -3
|
||||||
|
if self.db.units[frame.UnitType].showName and (frame.Name:GetText() ~= nil and frame.Name:GetText() ~= "") then
|
||||||
|
topArrowSpace = self.db.fontSize + topArrowSpace
|
||||||
|
end
|
||||||
|
frame.TopArrow:SetPoint("BOTTOM", frame.HealthBar, "TOP", 0, topArrowSpace)
|
||||||
|
|
||||||
|
if shouldShow then
|
||||||
|
frame.TopArrow:Show()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if (frame.LeftArrow and frame.RightArrow) and (shouldShow ~= 2) and (self.db.targetGlow == "style4" or self.db.targetGlow == "style7" or self.db.targetGlow == "style8") then -- side arrows
|
||||||
|
frame.RightArrow:SetPoint("RIGHT", frame.HealthBar, "LEFT", 3, 0)
|
||||||
|
frame.LeftArrow:SetPoint("LEFT", frame.HealthBar, "RIGHT", -3, 0)
|
||||||
|
|
||||||
|
if shouldShow then
|
||||||
|
frame.RightArrow:Show()
|
||||||
|
frame.LeftArrow:Show()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function mod:UpdatePosition_Glow(frame, shouldShow)
|
||||||
|
local castBar = frame.CastBar and frame.CastBar:IsShown() and frame.CastBar
|
||||||
|
local iconPosition = castBar and (castBar.Icon and castBar.Icon:IsShown()) and (frame.UnitType and self.db.units[frame.UnitType].castbar.iconPosition)
|
||||||
|
|
||||||
|
if frame.Glow and (self.db.targetGlow == "style1" or self.db.targetGlow == "style5" or self.db.targetGlow == "style7") then -- original glow
|
||||||
|
local offset = (E.PixelMode and E.mult*6) or E.mult*8 -- edgeSize is 6 (not attached to the backdrop needs +1 for pixel mode or +3 for non pixel mode)
|
||||||
|
if self.db.units[frame.UnitType].castbar.offset < 4 then
|
||||||
|
E:SetOutside(frame.Glow, (iconPosition == "LEFT" and castBar.Icon) or frame.HealthBar, offset, offset, (iconPosition == "RIGHT" and castBar.Icon) or castBar)
|
||||||
|
else
|
||||||
|
E:SetOutside(frame.Glow, frame.HealthBar, offset, offset)
|
||||||
|
end
|
||||||
|
|
||||||
|
if shouldShow then
|
||||||
|
frame.Glow:Show()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if frame.Glow2 and (self.db.targetGlow == "style2" or self.db.targetGlow == "style6" or self.db.targetGlow == "style8") then -- new background glow
|
||||||
|
local scale = 1
|
||||||
|
if self.db.useTargetScale then
|
||||||
|
if self.db.targetScale >= 0.75 then
|
||||||
|
scale = self.db.targetScale
|
||||||
|
else
|
||||||
|
scale = 0.75
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local size = (E.Border+14+(castBar and 3 or 0))*scale
|
||||||
|
frame.Glow2:SetPoint("TOPLEFT", (iconPosition == "LEFT" and castBar.Icon) or frame.HealthBar, "TOPLEFT", -(size*2), size)
|
||||||
|
frame.Glow2:SetPoint("BOTTOMRIGHT", (iconPosition == "RIGHT" and castBar.Icon) or castBar or frame.HealthBar, "BOTTOMRIGHT", size*2, -size)
|
||||||
|
|
||||||
|
if shouldShow then
|
||||||
|
frame.Glow2:Show()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function mod:UpdateElement_Glow(frame)
|
function mod:UpdateElement_Glow(frame)
|
||||||
|
if frame.TopArrow:IsShown() then frame.TopArrow:Hide() end
|
||||||
|
if frame.LeftArrow:IsShown() then frame.LeftArrow:Hide() end
|
||||||
|
if frame.RightArrow:IsShown() then frame.RightArrow:Hide() end
|
||||||
|
if frame.Glow2:IsShown() then frame.Glow2:Hide() end
|
||||||
|
if frame.Glow:IsShown() then frame.Glow:Hide() end
|
||||||
if not frame.HealthBar:IsShown() then return end
|
if not frame.HealthBar:IsShown() then return end
|
||||||
|
|
||||||
local r, g, b, shouldShow
|
local shouldShow, r, g, b, a = 0
|
||||||
if frame.isTarget and self.db.useTargetGlow then
|
if frame.isTarget and self.db.targetGlow ~= "none" then
|
||||||
r, g, b = 1, 1, 1
|
r, g, b, a = self.db.glowColor.r, self.db.glowColor.g, self.db.glowColor.b, self.db.glowColor.a
|
||||||
shouldShow = true
|
shouldShow = 1
|
||||||
else
|
elseif self.db.lowHealthThreshold > 0 then
|
||||||
local health = frame.oldHealthBar:GetValue()
|
local health = frame.oldHealthBar:GetValue()
|
||||||
local _, maxHealth = frame.oldHealthBar:GetMinMaxValues()
|
local _, maxHealth = frame.oldHealthBar:GetMinMaxValues()
|
||||||
local perc = health / maxHealth
|
local perc = health / maxHealth
|
||||||
if perc <= self.db.lowHealthThreshold then
|
if perc <= self.db.lowHealthThreshold then
|
||||||
if perc <= self.db.lowHealthThreshold / 2 then
|
if perc <= self.db.lowHealthThreshold / 2 then
|
||||||
r, g, b = 1, 0, 0
|
r, g, b, a = 1, 0, 0, 1
|
||||||
else
|
else
|
||||||
r, g, b = 1, 1, 0
|
r, g, b, a = 1, 1, 0, 1
|
||||||
end
|
end
|
||||||
|
|
||||||
shouldShow = true
|
shouldShow = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if shouldShow then
|
if shouldShow ~= 0 then
|
||||||
frame.Glow:Show()
|
self:UpdatePosition_Glow(frame, shouldShow)
|
||||||
if r ~= frame.Glow.r or g ~= frame.Glow.g or b ~= frame.Glow.b then
|
self:UpdatePoisiton_Arrow(frame, shouldShow)
|
||||||
frame.Glow:SetBackdropBorderColor(r, g, b)
|
|
||||||
frame.Glow.r, frame.Glow.g, frame.Glow.b = r, g, b
|
if frame.Glow and (r ~= frame.Glow.r or g ~= frame.Glow.g or b ~= frame.Glow.b or a ~= frame.Glow.a) then
|
||||||
|
frame.Glow:SetBackdropBorderColor(r, g, b, a)
|
||||||
|
frame.Glow2:SetVertexColor(r, g, b, a)
|
||||||
|
frame.TopArrow:SetVertexColor(r, g, b, a)
|
||||||
|
frame.LeftArrow:SetVertexColor(r, g, b, a)
|
||||||
|
frame.RightArrow:SetVertexColor(r, g, b, a)
|
||||||
|
frame.Glow.r, frame.Glow.g, frame.Glow.b, frame.Glow.a = r, g, b, a
|
||||||
end
|
end
|
||||||
elseif frame.Glow:IsShown() then
|
|
||||||
frame.Glow:Hide()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -44,13 +129,34 @@ end
|
|||||||
function mod:ConstructElement_Glow(frame)
|
function mod:ConstructElement_Glow(frame)
|
||||||
local f = CreateFrame("Frame", nil, frame)
|
local f = CreateFrame("Frame", nil, frame)
|
||||||
f:SetFrameLevel(frame.HealthBar:GetFrameLevel() - 1)
|
f:SetFrameLevel(frame.HealthBar:GetFrameLevel() - 1)
|
||||||
E:SetOutside(f, frame.HealthBar, 3, 3)
|
f:SetBackdrop({edgeFile = LSM:Fetch("border", "ElvUI GlowBorder"), edgeSize = E:Scale(6)})
|
||||||
f:SetBackdrop({
|
|
||||||
edgeFile = LSM:Fetch("border", "ElvUI GlowBorder"), edgeSize = E:Scale(3),
|
|
||||||
insets = {left = E:Scale(5), right = E:Scale(5), top = E:Scale(5), bottom = E:Scale(5)}
|
|
||||||
})
|
|
||||||
|
|
||||||
f:SetScale(E.PixelMode and 1.5 or 2)
|
|
||||||
f:Hide()
|
f:Hide()
|
||||||
|
|
||||||
|
local glow = frame:CreateTexture(nil, "BACKGROUND")
|
||||||
|
glow:SetTexture([[Interface\AddOns\ElvUI\media\textures\spark.tga]])
|
||||||
|
glow:Hide()
|
||||||
|
frame.Glow2 = glow
|
||||||
|
|
||||||
|
local top = frame:CreateTexture(nil, "BACKGROUND")
|
||||||
|
top:SetTexture([[Interface\AddOns\ElvUI\media\textures\nameplateTargetIndicator.tga]])
|
||||||
|
top:SetWidth(45)
|
||||||
|
top:SetHeight(45)
|
||||||
|
top:Hide()
|
||||||
|
frame.TopArrow = top
|
||||||
|
|
||||||
|
local left = frame:CreateTexture(nil, "BACKGROUND")
|
||||||
|
left:SetTexture([[Interface\AddOns\ElvUI\media\textures\nameplateTargetIndicatorLeft.tga]])
|
||||||
|
left:SetWidth(45)
|
||||||
|
left:SetHeight(45)
|
||||||
|
left:Hide()
|
||||||
|
frame.LeftArrow = left
|
||||||
|
|
||||||
|
local right = frame:CreateTexture(nil, "BACKGROUND")
|
||||||
|
right:SetTexture([[Interface\AddOns\ElvUI\media\textures\nameplateTargetIndicatorRight.tga]])
|
||||||
|
right:SetWidth(45)
|
||||||
|
right:SetHeight(45)
|
||||||
|
right:Hide()
|
||||||
|
frame.RightArrow = right
|
||||||
|
|
||||||
return f
|
return f
|
||||||
end
|
end
|
||||||
@@ -165,7 +165,15 @@ end
|
|||||||
function mod:ConstructElement_HealthBar(parent)
|
function mod:ConstructElement_HealthBar(parent)
|
||||||
local frame = CreateFrame("StatusBar", nil, parent)
|
local frame = CreateFrame("StatusBar", nil, parent)
|
||||||
self:StyleFrame(frame)
|
self:StyleFrame(frame)
|
||||||
frame:SetFrameLevel(parent:GetFrameLevel())
|
|
||||||
|
frame:SetScript("OnSizeChanged", function()
|
||||||
|
parent:SetWidth(this:GetWidth())
|
||||||
|
parent:SetHeight(this:GetHeight())
|
||||||
|
|
||||||
|
local health = this:GetValue()
|
||||||
|
local _, maxHealth = this:GetMinMaxValues()
|
||||||
|
this:GetStatusBarTexture():SetPoint("TOPRIGHT", -(this:GetWidth() * ((maxHealth - health) / maxHealth)), 0)
|
||||||
|
end)
|
||||||
|
|
||||||
frame.text = frame:CreateFontString(nil, "OVERLAY")
|
frame.text = frame:CreateFontString(nil, "OVERLAY")
|
||||||
frame.scale = CreateAnimationGroup(frame)
|
frame.scale = CreateAnimationGroup(frame)
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
|
local mod = E:GetModule("NamePlates");
|
||||||
|
local LSM = LibStub("LibSharedMedia-3.0");
|
||||||
|
|
||||||
|
--Cache global variables
|
||||||
|
--Lua functions
|
||||||
|
--WoW API / Variables
|
||||||
|
|
||||||
|
function mod:UpdateElement_Highlight(frame)
|
||||||
|
if frame:IsShown() and frame.isMouseover and (frame.NameOnlyChanged or (not self.db.units[frame.UnitType].healthbar.enable and self.db.units[frame.UnitType].showName)) and not frame.isTarget then
|
||||||
|
frame.Name.NameOnlyGlow:Show()
|
||||||
|
frame.Highlight:Show()
|
||||||
|
elseif frame:IsShown() and frame.isMouseover and (not frame.NameOnlyChanged or self.db.units[frame.UnitType].healthbar.enable) and not frame.isTarget then
|
||||||
|
frame.Highlight.texture:ClearAllPoints()
|
||||||
|
frame.Highlight.texture:SetPoint("TOPLEFT", frame.HealthBar, "TOPLEFT")
|
||||||
|
frame.Highlight.texture:SetPoint("BOTTOMRIGHT", frame.HealthBar:GetStatusBarTexture(), "BOTTOMRIGHT")
|
||||||
|
frame.Highlight.texture:Show()
|
||||||
|
frame.Highlight:Show()
|
||||||
|
else
|
||||||
|
frame.Name.NameOnlyGlow:Hide()
|
||||||
|
frame.Highlight.texture:Hide()
|
||||||
|
frame.Highlight:Hide()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function mod:ConfigureElement_Highlight(frame)
|
||||||
|
if not self.db.units[frame.UnitType].healthbar.enable then return end
|
||||||
|
frame.Highlight.texture:SetTexture(LSM:Fetch("statusbar", self.db.statusbar))
|
||||||
|
end
|
||||||
|
|
||||||
|
function mod:ConstructElement_Highlight(frame)
|
||||||
|
local f = CreateFrame("Frame", nil, frame)
|
||||||
|
f.texture = frame.HealthBar:CreateTexture(nil, "ARTWORK")
|
||||||
|
f.texture:SetVertexColor(1, 1, 1, 0.3)
|
||||||
|
f.texture:Hide()
|
||||||
|
|
||||||
|
f:SetScript("OnHide", function()
|
||||||
|
frame.Name.NameOnlyGlow:Hide()
|
||||||
|
frame.Highlight.texture:Hide()
|
||||||
|
end)
|
||||||
|
|
||||||
|
return f
|
||||||
|
end
|
||||||
@@ -8,4 +8,5 @@
|
|||||||
<Script file="Name.lua"/>
|
<Script file="Name.lua"/>
|
||||||
<Script file="RaidIcon.lua"/>
|
<Script file="RaidIcon.lua"/>
|
||||||
<Script file="HealerIcon.lua"/>
|
<Script file="HealerIcon.lua"/>
|
||||||
|
<Script file="Highlight.lua"/>
|
||||||
</Ui>
|
</Ui>
|
||||||
@@ -36,6 +36,12 @@ function mod:UpdateElement_Name(frame)
|
|||||||
else
|
else
|
||||||
frame.Name:SetTextColor(1, 1, 1)
|
frame.Name:SetTextColor(1, 1, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.db.nameColoredGlow then
|
||||||
|
frame.Name.NameOnlyGlow:SetVertexColor(r - 0.1, g - 0.1, b - 0.1, 1)
|
||||||
|
else
|
||||||
|
frame.Name.NameOnlyGlow:SetVertexColor(self.db.glowColor.r, self.db.glowColor.g, self.db.glowColor.b, self.db.glowColor.a)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:ConfigureElement_Name(frame)
|
function mod:ConfigureElement_Name(frame)
|
||||||
@@ -44,7 +50,7 @@ function mod:ConfigureElement_Name(frame)
|
|||||||
name:SetJustifyH("LEFT")
|
name:SetJustifyH("LEFT")
|
||||||
name:SetJustifyV("BOTTOM")
|
name:SetJustifyV("BOTTOM")
|
||||||
name:ClearAllPoints()
|
name:ClearAllPoints()
|
||||||
if self.db.units[frame.UnitType].healthbar.enable or frame.isTarget then
|
if(self.db.units[frame.UnitType].healthbar.enable or (self.db.alwaysShowTargetHealth and frame.isTarget)) then
|
||||||
name:SetJustifyH("LEFT")
|
name:SetJustifyH("LEFT")
|
||||||
name:SetPoint("BOTTOMLEFT", frame.HealthBar, "TOPLEFT", 0, E.Border*2)
|
name:SetPoint("BOTTOMLEFT", frame.HealthBar, "TOPLEFT", 0, E.Border*2)
|
||||||
name:SetPoint("BOTTOMRIGHT", frame.Level, "BOTTOMLEFT")
|
name:SetPoint("BOTTOMRIGHT", frame.Level, "BOTTOMLEFT")
|
||||||
@@ -58,6 +64,15 @@ end
|
|||||||
|
|
||||||
function mod:ConstructElement_Name(frame)
|
function mod:ConstructElement_Name(frame)
|
||||||
local name = frame:CreateFontString(nil, "OVERLAY")
|
local name = frame:CreateFontString(nil, "OVERLAY")
|
||||||
|
name:SetFont(LSM:Fetch("font", self.db.font), self.db.fontSize, self.db.fontOutline)
|
||||||
|
|
||||||
|
local g = frame:CreateTexture(nil, "BACKGROUND")
|
||||||
|
g:SetTexture([[Interface\AddOns\ElvUI\media\textures\spark.tga]])
|
||||||
|
g:Hide()
|
||||||
|
g:SetPoint("TOPLEFT", name, -20, 8)
|
||||||
|
g:SetPoint("BOTTOMRIGHT", name, 20, -8)
|
||||||
|
|
||||||
|
name.NameOnlyGlow = g
|
||||||
|
|
||||||
return name
|
return name
|
||||||
end
|
end
|
||||||
@@ -20,7 +20,6 @@ local WorldFrame = WorldFrame
|
|||||||
local WorldGetNumChildren, WorldGetChildren = WorldFrame.GetNumChildren, WorldFrame.GetChildren
|
local WorldGetNumChildren, WorldGetChildren = WorldFrame.GetNumChildren, WorldFrame.GetChildren
|
||||||
|
|
||||||
local numChildren = 0
|
local numChildren = 0
|
||||||
local isTarget = false
|
|
||||||
local BORDER = "Interface\\Tooltips\\Nameplate-Border"
|
local BORDER = "Interface\\Tooltips\\Nameplate-Border"
|
||||||
local FSPAT = "^%s*$"
|
local FSPAT = "^%s*$"
|
||||||
local queryList = {}
|
local queryList = {}
|
||||||
@@ -46,7 +45,6 @@ local healClasses = {
|
|||||||
|
|
||||||
mod.CreatedPlates = {}
|
mod.CreatedPlates = {}
|
||||||
mod.VisiblePlates = {}
|
mod.VisiblePlates = {}
|
||||||
mod.Healers = {}
|
|
||||||
|
|
||||||
function mod:CheckFilter(frame)
|
function mod:CheckFilter(frame)
|
||||||
--[[local db = E.global.nameplates["filter"][frame.UnitName]
|
--[[local db = E.global.nameplates["filter"][frame.UnitName]
|
||||||
@@ -78,18 +76,42 @@ function mod:CheckFilter(frame)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:CheckBGHealers()
|
function mod:GetPlateFrameLevel(frame)
|
||||||
local name, class, damageDone, healingDone, _
|
local plateLevel
|
||||||
for i = 1, GetNumBattlefieldScores() do
|
if frame.plateID then
|
||||||
name, _, _, _, _, _, _, _, _, class, damageDone, healingDone = GetBattlefieldScore(i)
|
plateLevel = frame.plateID*mod.levelStep
|
||||||
if name and class and healClasses[class] then
|
end
|
||||||
name = match(name, "(.+)%-.+") or name
|
return plateLevel
|
||||||
if name and healingDone > (damageDone * 2) then
|
end
|
||||||
self.Healers[name] = true
|
|
||||||
elseif name and self.Healers[name] then
|
function mod:SetPlateFrameLevel(frame, level, isTarget)
|
||||||
self.Healers[name] = nil
|
if frame and level then
|
||||||
end
|
if isTarget then
|
||||||
|
level = 890 --10 higher than the max calculated level of 880
|
||||||
|
elseif frame.FrameLevelChanged then
|
||||||
|
--calculate Style Filter FrameLevelChanged leveling
|
||||||
|
--level method: (10*(40*2)) max 800 + max 80 (40*2) = max 880
|
||||||
|
--highest possible should be level 880 and we add 1 to all so 881
|
||||||
|
local leveledCount = mod.CollectedFrameLevelCount or 1
|
||||||
|
level = (frame.FrameLevelChanged*(40*mod.levelStep)) + (leveledCount*mod.levelStep)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
frame:SetFrameLevel(level+1)
|
||||||
|
frame.HealthBar:SetFrameLevel(level+3)
|
||||||
|
frame.Glow:SetFrameLevel(frame:GetFrameLevel()-1)
|
||||||
|
frame.Buffs:SetFrameLevel(level+1)
|
||||||
|
frame.Debuffs:SetFrameLevel(level+1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function mod:ResetNameplateFrameLevel(frame)
|
||||||
|
local isTarget = frame.isTarget --frame.isTarget is not the same here so keep this.
|
||||||
|
local plateLevel = mod:GetPlateFrameLevel(frame)
|
||||||
|
if plateLevel then
|
||||||
|
if frame.FrameLevelChanged then --keep how many plates we change, this is reset to 1 post-ResetNameplateFrameLevel
|
||||||
|
mod.CollectedFrameLevelCount = (mod.CollectedFrameLevelCount and mod.CollectedFrameLevelCount + 1) or 1
|
||||||
|
end
|
||||||
|
self:SetPlateFrameLevel(frame, plateLevel, isTarget)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -106,75 +128,109 @@ function mod:SetFrameScale(frame, scale)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mod:SetTargetFrame(frame)
|
function mod:SetTargetFrame(frame)
|
||||||
if isTarget then return end
|
if frame.isTarget then
|
||||||
|
if not frame.isTargetChanged then
|
||||||
|
frame.isTargetChanged = true
|
||||||
|
|
||||||
|
mod:SetPlateFrameLevel(frame, mod:GetPlateFrameLevel(frame), true)
|
||||||
|
|
||||||
|
if self.db.useTargetScale then
|
||||||
|
self:SetFrameScale(frame, (frame.ThreatScale or 1) * self.db.targetScale)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not frame.isGroupUnit then
|
||||||
|
frame.unit = "target"
|
||||||
|
|
||||||
|
-- self:RegisterEvents(frame)
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.db.units[frame.UnitType].healthbar.enable ~= true and self.db.alwaysShowTargetHealth then
|
||||||
|
frame.Name:ClearAllPoints()
|
||||||
|
frame.Level:ClearAllPoints()
|
||||||
|
frame.HealthBar.r, frame.HealthBar.g, frame.HealthBar.b = nil, nil, nil
|
||||||
|
self:ConfigureElement_HealthBar(frame)
|
||||||
|
-- self:ConfigureElement_CastBar(frame)
|
||||||
|
-- self:ConfigureElement_Glow(frame)
|
||||||
|
-- self:ConfigureElement_Elite(frame)
|
||||||
|
-- self:ConfigureElement_Highlight(frame)
|
||||||
|
self:ConfigureElement_Level(frame)
|
||||||
|
self:ConfigureElement_Name(frame)
|
||||||
|
-- self:RegisterEvents(frame)
|
||||||
|
self:UpdateElement_All(frame, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.hasTarget then
|
||||||
|
frame:SetAlpha(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- TEST
|
||||||
|
-- mod:UpdateElement_Highlight(frame)
|
||||||
|
-- mod:UpdateElement_CPoints(frame)
|
||||||
|
-- mod:UpdateElement_Filters(frame, "PLAYER_TARGET_CHANGED")
|
||||||
|
-- mod:ForEachPlate("ResetNameplateFrameLevel") --keep this after `UpdateElement_Filters`
|
||||||
|
end
|
||||||
|
elseif frame.isTargetChanged then
|
||||||
|
frame.isTargetChanged = false
|
||||||
|
|
||||||
|
mod:SetPlateFrameLevel(frame, mod:GetPlateFrameLevel(frame))
|
||||||
|
|
||||||
local targetExists = UnitExists("target") == 1
|
|
||||||
if targetExists and frame:GetParent():IsShown() and frame:GetParent():GetAlpha() == 1 then
|
|
||||||
if self.db.useTargetScale then
|
if self.db.useTargetScale then
|
||||||
self:SetFrameScale(frame, (frame.CustomScale and frame.CustomScale * self.db.targetScale) or self.db.targetScale)
|
self:SetFrameScale(frame, (frame.ThreatScale or 1))
|
||||||
end
|
|
||||||
frame.isTarget = true
|
|
||||||
frame.unit = "target"
|
|
||||||
|
|
||||||
if self.db.units[frame.UnitType].healthbar.enable ~= true then
|
|
||||||
frame.Name:ClearAllPoints()
|
|
||||||
frame.Level:ClearAllPoints()
|
|
||||||
frame.HealthBar.r, frame.HealthBar.g, frame.HealthBar.b = nil, nil, nil
|
|
||||||
self:ConfigureElement_HealthBar(frame)
|
|
||||||
self:ConfigureElement_CastBar(frame)
|
|
||||||
self:ConfigureElement_Glow(frame)
|
|
||||||
self:ConfigureElement_Level(frame)
|
|
||||||
self:ConfigureElement_Name(frame)
|
|
||||||
|
|
||||||
self:UpdateElement_All(frame, true)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[if UnitCastingInfo("target") then
|
if not frame.isGroupUnit then
|
||||||
frame:GetScript("OnEvent")(frame, "UNIT_SPELLCAST_START", "target")
|
frame.unit = nil
|
||||||
elseif UnitChannelInfo("target") then
|
-- frame:UnregisterAllEvents()
|
||||||
frame:GetScript("OnEvent")(frame, "UNIT_SPELLCAST_CHANNEL_START", "target")
|
|
||||||
end]]
|
|
||||||
|
|
||||||
frame:SetAlpha(1)
|
|
||||||
|
|
||||||
mod:UpdateElement_AurasByUnitID("target")
|
|
||||||
elseif frame.isTarget then
|
|
||||||
if self.db.useTargetScale then
|
|
||||||
self:SetFrameScale(frame, frame.CustomScale or frame.ThreatScale or 1)
|
|
||||||
end
|
end
|
||||||
frame.isTarget = nil
|
|
||||||
frame.unit = nil
|
|
||||||
-- frame.guid = nil
|
|
||||||
if self.db.units[frame.UnitType].healthbar.enable ~= true then
|
if self.db.units[frame.UnitType].healthbar.enable ~= true then
|
||||||
self:UpdateAllFrame(frame)
|
self:UpdateAllFrame(frame)
|
||||||
end
|
end
|
||||||
|
|
||||||
if targetExists then
|
if not frame.AlphaChanged then
|
||||||
frame:SetAlpha(self.db.nonTargetTransparency)
|
if self.hasTarget then
|
||||||
else
|
frame:SetAlpha(self.db.nonTargetTransparency)
|
||||||
frame:SetAlpha(1)
|
else
|
||||||
|
frame:SetAlpha(1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TEST
|
||||||
|
-- mod:UpdateElement_CPoints(frame)
|
||||||
|
-- mod:UpdateElement_Filters(frame, "PLAYER_TARGET_CHANGED")
|
||||||
|
-- mod:ForEachPlate("ResetNameplateFrameLevel") --keep this after `UpdateElement_Filters`
|
||||||
|
elseif frame.oldHighlight:IsShown() then
|
||||||
|
if not frame.isMouseover then
|
||||||
|
frame.isMouseover = true
|
||||||
|
|
||||||
|
if not frame.isGroupUnit then
|
||||||
|
frame.unit = "mouseover"
|
||||||
|
|
||||||
|
-- mod:UpdateElement_AurasByGUID(frame.guid)
|
||||||
|
-- mod:UpdateElement_Highlight(frame)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- mod:UpdateElement_Cast(frame, nil, frame.unit)
|
||||||
|
elseif frame.isMouseover then
|
||||||
|
frame.isMouseover = nil
|
||||||
|
|
||||||
|
if not frame.isGroupUnit then
|
||||||
|
frame.unit = nil
|
||||||
|
-- frame.CastBar:Hide()
|
||||||
|
end
|
||||||
|
--mod:UpdateElement_Highlight(frame)
|
||||||
else
|
else
|
||||||
if targetExists then
|
if not frame.AlphaChanged then
|
||||||
frame:SetAlpha(self.db.nonTargetTransparency)
|
if self.hasTarget then
|
||||||
else
|
frame:SetAlpha(self.db.nonTargetTransparency)
|
||||||
frame:SetAlpha(1)
|
else
|
||||||
|
frame:SetAlpha(1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
mod:UpdateElement_HealthColor(frame)
|
--self:UpdateElement_Glow(frame)
|
||||||
mod:UpdateElement_Glow(frame)
|
--self:UpdateElement_HealthColor(frame)
|
||||||
mod:UpdateElement_CPoints(frame)
|
|
||||||
|
|
||||||
return frame.isTarget
|
|
||||||
end
|
|
||||||
|
|
||||||
function mod:GetNumVisiblePlates()
|
|
||||||
local i = 0
|
|
||||||
for _ in pairs(mod.VisiblePlates) do
|
|
||||||
i = i + 1
|
|
||||||
end
|
|
||||||
return i
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:StyleFrame(parent, noBackdrop, point)
|
function mod:StyleFrame(parent, noBackdrop, point)
|
||||||
@@ -331,8 +387,6 @@ function mod:GetUnitInfo(frame)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mod:OnShow(self)
|
function mod:OnShow(self)
|
||||||
isTarget = false
|
|
||||||
|
|
||||||
self:SetWidth(0.01)
|
self:SetWidth(0.01)
|
||||||
self:SetHeight(0.01)
|
self:SetHeight(0.01)
|
||||||
|
|
||||||
@@ -353,11 +407,7 @@ function mod:OnShow(self)
|
|||||||
self.UnitFrame.UnitType = unitType
|
self.UnitFrame.UnitType = unitType
|
||||||
end
|
end
|
||||||
|
|
||||||
if not mod:CheckFilter(self.UnitFrame) then return end
|
--if not mod:CheckFilter(self.UnitFrame) then return end
|
||||||
|
|
||||||
if unitType == "ENEMY_PLAYER" then
|
|
||||||
mod:UpdateElement_HealerIcon(self.UnitFrame)
|
|
||||||
end
|
|
||||||
|
|
||||||
self.UnitFrame.Level:ClearAllPoints()
|
self.UnitFrame.Level:ClearAllPoints()
|
||||||
self.UnitFrame.Name:ClearAllPoints()
|
self.UnitFrame.Name:ClearAllPoints()
|
||||||
@@ -407,32 +457,43 @@ function mod:OnHide(self)
|
|||||||
mod.VisiblePlates[self.UnitFrame] = nil
|
mod.VisiblePlates[self.UnitFrame] = nil
|
||||||
|
|
||||||
self.UnitFrame.unit = nil
|
self.UnitFrame.unit = nil
|
||||||
|
--self.UnitFrame.isGroupUnit = nil
|
||||||
|
|
||||||
mod:HideAuraIcons(self.UnitFrame.Buffs)
|
mod:HideAuraIcons(self.UnitFrame.Buffs)
|
||||||
mod:HideAuraIcons(self.UnitFrame.Debuffs)
|
mod:HideAuraIcons(self.UnitFrame.Debuffs)
|
||||||
|
--mod:ClearStyledPlate(self.UnitFrame)
|
||||||
|
self.UnitFrame:UnregisterAllEvents()
|
||||||
self.UnitFrame.Glow.r, self.UnitFrame.Glow.g, self.UnitFrame.Glow.b = nil, nil, nil
|
self.UnitFrame.Glow.r, self.UnitFrame.Glow.g, self.UnitFrame.Glow.b = nil, nil, nil
|
||||||
self.UnitFrame.Glow:Hide()
|
self.UnitFrame.Glow:Hide()
|
||||||
|
self.UnitFrame.Glow2:Hide()
|
||||||
|
self.UnitFrame.TopArrow:Hide()
|
||||||
|
self.UnitFrame.LeftArrow:Hide()
|
||||||
|
self.UnitFrame.RightArrow:Hide()
|
||||||
self.UnitFrame.HealthBar.r, self.UnitFrame.HealthBar.g, self.UnitFrame.HealthBar.b = nil, nil, nil
|
self.UnitFrame.HealthBar.r, self.UnitFrame.HealthBar.g, self.UnitFrame.HealthBar.b = nil, nil, nil
|
||||||
self.UnitFrame.HealthBar:Hide()
|
self.UnitFrame.HealthBar:Hide()
|
||||||
--self.UnitFrame.CastBar:Hide()
|
self.UnitFrame.HealthBar.currentScale = nil
|
||||||
self.UnitFrame.Level:ClearAllPoints()
|
self.UnitFrame.Level:ClearAllPoints()
|
||||||
self.UnitFrame.Level:SetText("")
|
self.UnitFrame.Level:SetText("")
|
||||||
|
self.UnitFrame.Name.r, self.UnitFrame.Name.g, self.UnitFrame.Name.b = nil, nil, nil
|
||||||
self.UnitFrame.Name:ClearAllPoints()
|
self.UnitFrame.Name:ClearAllPoints()
|
||||||
self.UnitFrame.Name:SetText("")
|
self.UnitFrame.Name:SetText("")
|
||||||
|
self.UnitFrame.Name.NameOnlyGlow:Hide()
|
||||||
|
self.UnitFrame.Highlight:Hide()
|
||||||
self.UnitFrame.CPoints:Hide()
|
self.UnitFrame.CPoints:Hide()
|
||||||
self.UnitFrame:Hide()
|
self.UnitFrame:Hide()
|
||||||
self.UnitFrame.isTarget = nil
|
self.UnitFrame.isTarget = nil
|
||||||
self.UnitFrame.displayedUnit = nil
|
self.UnitFrame.isTargetChanged = false
|
||||||
self.ThreatData = nil
|
self.UnitFrame.isMouseover = nil
|
||||||
self.UnitFrame.UnitName = nil
|
self.UnitFrame.UnitName = nil
|
||||||
self.UnitFrame.UnitType = nil
|
self.UnitFrame.UnitType = nil
|
||||||
|
self.UnitFrame.UnitClass = nil
|
||||||
|
self.UnitFrame.UnitReaction = nil
|
||||||
|
self.UnitFrame.TopLevelFrame = nil
|
||||||
|
self.UnitFrame.TopOffset = nil
|
||||||
self.UnitFrame.ThreatScale = nil
|
self.UnitFrame.ThreatScale = nil
|
||||||
|
self.UnitFrame.ActionScale = nil
|
||||||
self.UnitFrame.ThreatReaction = nil
|
self.UnitFrame.ThreatReaction = nil
|
||||||
self.UnitFrame.guid = nil
|
|
||||||
self.UnitFrame.RaidIconType = nil
|
self.UnitFrame.RaidIconType = nil
|
||||||
self.UnitFrame.CustomColor = nil
|
|
||||||
self.UnitFrame.CustomScale = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:UpdateAllFrame(frame)
|
function mod:UpdateAllFrame(frame)
|
||||||
@@ -455,60 +516,81 @@ function mod:ForEachPlate(functionToRun, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:UpdateElement_All(frame, noTargetFrame)
|
function mod:ForEachVisiblePlate(functionToRun, ...)
|
||||||
if self.db.units[frame.UnitType].healthbar.enable or frame.isTarget then
|
for frame in pairs(self.VisiblePlates) do
|
||||||
self:UpdateElement_Health(frame)
|
self[functionToRun](self, frame, unpack(arg))
|
||||||
self:UpdateElement_HealthColor(frame)
|
|
||||||
self:UpdateElement_Auras(frame)
|
|
||||||
end
|
|
||||||
self:UpdateElement_RaidIcon(frame)
|
|
||||||
self:UpdateElement_HealerIcon(frame)
|
|
||||||
self:UpdateElement_Name(frame)
|
|
||||||
self:UpdateElement_Level(frame)
|
|
||||||
|
|
||||||
if not noTargetFrame then
|
|
||||||
mod:ScheduleTimer("ForEachPlate", 0.25, "SetTargetFrame")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function mod:UpdateElement_All(frame, noTargetFrame, filterIgnore)
|
||||||
|
local healthShown = (frame.UnitType and self.db.units[frame.UnitType].healthbar.enable) or (frame.isTarget and self.db.alwaysShowTargetHealth)
|
||||||
|
|
||||||
|
if healthShown then
|
||||||
|
mod:UpdateElement_Health(frame)
|
||||||
|
mod:UpdateElement_HealthColor(frame)
|
||||||
|
mod:UpdateElement_Cast(frame, nil, frame.unit)
|
||||||
|
mod:UpdateElement_Auras(frame)
|
||||||
|
end
|
||||||
|
mod:UpdateElement_RaidIcon(frame)
|
||||||
|
mod:UpdateElement_Name(frame)
|
||||||
|
mod:UpdateElement_Level(frame)
|
||||||
|
mod:UpdateElement_Highlight(frame)
|
||||||
|
|
||||||
|
if healthShown then
|
||||||
|
mod:UpdateElement_Glow(frame)
|
||||||
|
else
|
||||||
|
-- make sure we hide the arrows and/or glow after disabling the healthbar
|
||||||
|
if frame.TopArrow and frame.TopArrow:IsShown() then frame.TopArrow:Hide() end
|
||||||
|
if frame.LeftArrow and frame.LeftArrow:IsShown() then frame.LeftArrow:Hide() end
|
||||||
|
if frame.RightArrow and frame.RightArrow:IsShown() then frame.RightArrow:Hide() end
|
||||||
|
if frame.Glow2 and frame.Glow2:IsShown() then frame.Glow2:Hide() end
|
||||||
|
if frame.Glow and frame.Glow:IsShown() then frame.Glow:Hide() end
|
||||||
|
end
|
||||||
|
|
||||||
|
if not noTargetFrame then
|
||||||
|
mod:SetTargetFrame(frame)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not filterIgnore then
|
||||||
|
-- mod:UpdateElement_Filters(frame, "UpdateElement_All")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local plateID = 0
|
||||||
function mod:OnCreated(frame)
|
function mod:OnCreated(frame)
|
||||||
isTarget = false
|
plateID = plateID + 1
|
||||||
local HealthBar, CastBar = frame:GetChildren()
|
local HealthBar = frame:GetChildren()
|
||||||
local Border, Highlight, Name, Level, BossIcon, RaidIcon = frame:GetRegions()
|
local Border, Highlight, Name, Level, BossIcon, RaidIcon = frame:GetRegions()
|
||||||
|
|
||||||
frame.UnitFrame = CreateFrame("Button", nil, frame)
|
frame.UnitFrame = CreateFrame("Button", format("ElvUI_NamePlate%d", plateID), frame)
|
||||||
E:Size(frame.UnitFrame, 100, 20)
|
E:Size(frame.UnitFrame, 100, 20)
|
||||||
frame.UnitFrame:SetPoint("CENTER", 0, 0)
|
frame.UnitFrame:SetPoint("CENTER", 0, 0)
|
||||||
|
frame.UnitFrame.plateID = plateID
|
||||||
|
|
||||||
frame.UnitFrame:SetScript("OnEvent", self.OnEvent)
|
frame.UnitFrame:SetScript("OnEvent", self.OnEvent)
|
||||||
frame.UnitFrame:SetScript("OnClick", function()
|
frame.UnitFrame:SetScript("OnClick", function()
|
||||||
frame:Click()
|
frame:Click()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
frame.UnitFrame.HealthBar = self:ConstructElement_HealthBar(frame.UnitFrame)
|
frame.UnitFrame.HealthBar = self:ConstructElement_HealthBar(frame.UnitFrame)
|
||||||
frame.UnitFrame.CastBar = self:ConstructElement_CastBar(frame.UnitFrame)
|
|
||||||
frame.UnitFrame.Level = self:ConstructElement_Level(frame.UnitFrame)
|
frame.UnitFrame.Level = self:ConstructElement_Level(frame.UnitFrame)
|
||||||
frame.UnitFrame.Name = self:ConstructElement_Name(frame.UnitFrame)
|
frame.UnitFrame.Name = self:ConstructElement_Name(frame.UnitFrame)
|
||||||
|
frame.UnitFrame.CastBar = self:ConstructElement_CastBar(frame.UnitFrame)
|
||||||
frame.UnitFrame.Glow = self:ConstructElement_Glow(frame.UnitFrame)
|
frame.UnitFrame.Glow = self:ConstructElement_Glow(frame.UnitFrame)
|
||||||
frame.UnitFrame.Buffs = self:ConstructElement_Auras(frame.UnitFrame, "LEFT")
|
frame.UnitFrame.Buffs = self:ConstructElement_Auras(frame.UnitFrame, "LEFT")
|
||||||
frame.UnitFrame.Debuffs = self:ConstructElement_Auras(frame.UnitFrame, "RIGHT")
|
frame.UnitFrame.Debuffs = self:ConstructElement_Auras(frame.UnitFrame, "RIGHT")
|
||||||
frame.UnitFrame.HealerIcon = self:ConstructElement_HealerIcon(frame.UnitFrame)
|
frame.UnitFrame.HealerIcon = self:ConstructElement_HealerIcon(frame.UnitFrame)
|
||||||
frame.UnitFrame.CPoints = self:ConstructElement_CPoints(frame.UnitFrame)
|
frame.UnitFrame.CPoints = self:ConstructElement_CPoints(frame.UnitFrame)
|
||||||
|
frame.UnitFrame.Highlight = self:ConstructElement_Highlight(frame.UnitFrame)
|
||||||
|
|
||||||
--self:QueueObject(CastBarBorder)
|
|
||||||
--self:QueueObject(CastBarIcon)
|
|
||||||
self:QueueObject(HealthBar)
|
self:QueueObject(HealthBar)
|
||||||
--self:QueueObject(CastBar)
|
|
||||||
self:QueueObject(Level)
|
self:QueueObject(Level)
|
||||||
self:QueueObject(Name)
|
self:QueueObject(Name)
|
||||||
self:QueueObject(Border)
|
self:QueueObject(Border)
|
||||||
self:QueueObject(Highlight)
|
self:QueueObject(Highlight)
|
||||||
--CastBar:Kill()
|
|
||||||
--CastBarIcon:SetParent(E.HiddenFrame)
|
|
||||||
BossIcon:SetAlpha(0)
|
BossIcon:SetAlpha(0)
|
||||||
|
|
||||||
frame.UnitFrame.oldHealthBar = HealthBar
|
frame.UnitFrame.oldHealthBar = HealthBar
|
||||||
frame.UnitFrame.oldCastBar = CastBar
|
|
||||||
--frame.UnitFrame.oldCastBar.Icon = CastBarIcon
|
|
||||||
frame.UnitFrame.oldName = Name
|
frame.UnitFrame.oldName = Name
|
||||||
frame.UnitFrame.oldHighlight = Highlight
|
frame.UnitFrame.oldHighlight = Highlight
|
||||||
frame.UnitFrame.oldLevel = Level
|
frame.UnitFrame.oldLevel = Level
|
||||||
@@ -548,32 +630,45 @@ function mod:QueueObject(object)
|
|||||||
object:Hide()
|
object:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:OnUpdate(elapsed)
|
function mod:GetChildren(...)
|
||||||
local count = WorldGetNumChildren(WorldFrame)
|
local count = WorldGetNumChildren(WorldFrame)
|
||||||
if count ~= numChildren then
|
if count ~= numChildren then
|
||||||
|
local frame, region
|
||||||
for i = numChildren + 1, count do
|
for i = numChildren + 1, count do
|
||||||
local frame = select(i, WorldGetChildren(WorldFrame))
|
frame = arg[i]
|
||||||
local region = frame:GetRegions()
|
region = frame:GetRegions()
|
||||||
|
if not mod.CreatedPlates[frame] and region and region:GetObjectType() == "Texture" and region:GetTexture() == BORDER then
|
||||||
if(not mod.CreatedPlates[frame] and region and region:GetObjectType() == "Texture" and region:GetTexture() == BORDER) then
|
|
||||||
mod:OnCreated(frame)
|
mod:OnCreated(frame)
|
||||||
end
|
end
|
||||||
|
numChildren = count
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function mod:OnUpdate()
|
||||||
|
local count = WorldGetNumChildren(WorldFrame)
|
||||||
|
if count ~= numChildren then
|
||||||
|
local frame, region
|
||||||
|
for i = numChildren + 1, count do
|
||||||
|
frame = select(i, WorldGetChildren(WorldFrame))
|
||||||
|
region = frame:GetRegions()
|
||||||
|
if not mod.CreatedPlates[frame] and region and region:GetObjectType() == "Texture" and region:GetTexture() == BORDER then
|
||||||
|
mod:OnCreated(frame)
|
||||||
|
end
|
||||||
|
numChildren = count
|
||||||
end
|
end
|
||||||
numChildren = count
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local i = 0
|
|
||||||
for frame in pairs(mod.VisiblePlates) do
|
for frame in pairs(mod.VisiblePlates) do
|
||||||
i = i + 1
|
if mod.hasTarget then
|
||||||
|
frame.alpha = frame:GetParent():GetAlpha()
|
||||||
local getTarget = mod:SetTargetFrame(frame)
|
else
|
||||||
if not getTarget then
|
frame.alpha = 1
|
||||||
frame:GetParent():SetAlpha(1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if i == mod:GetNumVisiblePlates() then
|
frame:GetParent():SetAlpha(1)
|
||||||
isTarget = true
|
|
||||||
end
|
frame.isTarget = mod.hasTarget and frame.alpha == 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -651,21 +746,10 @@ end
|
|||||||
|
|
||||||
function mod:PLAYER_ENTERING_WORLD()
|
function mod:PLAYER_ENTERING_WORLD()
|
||||||
self:CleanAuraLists()
|
self:CleanAuraLists()
|
||||||
twipe(self.Healers)
|
|
||||||
local inInstance, instanceType = IsInInstance()
|
|
||||||
if inInstance and instanceType == "pvp" and self.db.units.ENEMY_PLAYER.markHealers then
|
|
||||||
self.CheckHealerTimer = self:ScheduleRepeatingTimer("CheckBGHealers", 3)
|
|
||||||
self:CheckBGHealers()
|
|
||||||
else
|
|
||||||
if self.CheckHealerTimer then
|
|
||||||
self:CancelTimer(self.CheckHealerTimer)
|
|
||||||
self.CheckHealerTimer = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:PLAYER_TARGET_CHANGED()
|
function mod:PLAYER_TARGET_CHANGED()
|
||||||
isTarget = false
|
self.hasTarget = UnitExists("target") == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function mod:UNIT_AURA(_, unit)
|
function mod:UNIT_AURA(_, unit)
|
||||||
@@ -731,6 +815,10 @@ function mod:Initialize()
|
|||||||
self.db = E.db["nameplates"]
|
self.db = E.db["nameplates"]
|
||||||
if E.private["nameplates"].enable ~= true then return end
|
if E.private["nameplates"].enable ~= true then return end
|
||||||
|
|
||||||
|
self.hasTarget = false
|
||||||
|
|
||||||
|
self.levelStep = 2
|
||||||
|
|
||||||
self:UpdateCVars()
|
self:UpdateCVars()
|
||||||
|
|
||||||
self.Frame = CreateFrame("Frame"):SetScript("OnUpdate", self.OnUpdate)
|
self.Frame = CreateFrame("Frame"):SetScript("OnUpdate", self.OnUpdate)
|
||||||
@@ -745,6 +833,8 @@ function mod:Initialize()
|
|||||||
|
|
||||||
self:RegisterMessage("ClassCacheQueryResult")
|
self:RegisterMessage("ClassCacheQueryResult")
|
||||||
|
|
||||||
|
self:ScheduleRepeatingTimer("ForEachVisiblePlate", 0.1, "SetTargetFrame")
|
||||||
|
|
||||||
E.NamePlates = self
|
E.NamePlates = self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+69
-42
@@ -99,23 +99,42 @@ P["databars"] = {
|
|||||||
|
|
||||||
P["nameplates"] = {
|
P["nameplates"] = {
|
||||||
["statusbar"] = "ElvUI Norm",
|
["statusbar"] = "ElvUI Norm",
|
||||||
["font"] = "Homespun",
|
["font"] = "PT Sans Narrow",
|
||||||
["fontSize"] = 8,
|
["fontSize"] = 11,
|
||||||
["fontOutline"] = "MONOCHROMEOUTLINE",
|
["fontOutline"] = "OUTLINE",
|
||||||
|
["healthFont"] = "PT Sans Narrow",
|
||||||
|
["healthFontSize"] = 11,
|
||||||
|
["healthFontOutline"] = "OUTLINE",
|
||||||
|
["durationFont"] = "PT Sans Narrow",
|
||||||
|
["durationFontSize"] = 10,
|
||||||
|
["durationFontOutline"] = "OUTLINE",
|
||||||
|
["durationPosition"] = "CENTER",
|
||||||
|
["stackFont"] = "PT Sans Narrow",
|
||||||
|
["stackFontSize"] = 8,
|
||||||
|
["stackFontOutline"] = "OUTLINE",
|
||||||
["useTargetScale"] = true,
|
["useTargetScale"] = true,
|
||||||
["targetScale"] = 1.15,
|
["targetScale"] = 1.15,
|
||||||
["nonTargetTransparency"] = 0.35,
|
["nonTargetTransparency"] = 0.35,
|
||||||
["motionType"] = "OVERLAP",
|
["motionType"] = "OVERLAP",
|
||||||
["lowHealthThreshold"] = 0.4,
|
["lowHealthThreshold"] = 0.4,
|
||||||
|
|
||||||
["showFriendlyCombat"] = "DISABLED",
|
["showFriendlyCombat"] = "DISABLED",
|
||||||
["showEnemyCombat"] = "DISABLED",
|
["showEnemyCombat"] = "DISABLED",
|
||||||
|
["targetGlow"] = "style2",
|
||||||
["clampToScreen"] = false,
|
["glowColor"] = {r = 77/255, g = 179/255, b = 255/255, a = 1},
|
||||||
["useTargetGlow"] = true,
|
["nameColoredGlow"] = false,
|
||||||
|
["alwaysShowTargetHealth"] = true,
|
||||||
["castColor"] = {r = 1, g = 208/255, b = 0},
|
["castColor"] = {r = 1, g = 208/255, b = 0},
|
||||||
|
["castNoInterruptColor"] = {r = 0.78, g = 0.25, b = 0.25},
|
||||||
["comboPoints"] = true,
|
["comboPoints"] = true,
|
||||||
|
["cooldown"] = {
|
||||||
|
["threshold"] = 4,
|
||||||
|
["override"] = true,
|
||||||
|
["expiringColor"] = {r = 1, g = 0, b = 0},
|
||||||
|
["secondsColor"] = {r = 1, g = 1, b = 1},
|
||||||
|
["minutesColor"] = {r = 1, g = 1, b = 1},
|
||||||
|
["hoursColor"] = {r = 1, g = 1, b = 1},
|
||||||
|
["daysColor"] = {r = 1, g = 1, b = 1},
|
||||||
|
},
|
||||||
["reactions"] = {
|
["reactions"] = {
|
||||||
["friendlyPlayer"] = {r = 0.31, g = 0.45, b = 0.63},
|
["friendlyPlayer"] = {r = 0.31, g = 0.45, b = 0.63},
|
||||||
["tapped"] = {r = 0.6, g = 0.6, b = 0.6},
|
["tapped"] = {r = 0.6, g = 0.6, b = 0.6},
|
||||||
@@ -128,12 +147,19 @@ P["nameplates"] = {
|
|||||||
["badColor"] = {r = 0.78, g = 0.25, b = 0.25},
|
["badColor"] = {r = 0.78, g = 0.25, b = 0.25},
|
||||||
["goodTransition"] = {r = 218/255, g = 197/255, b = 92/255},
|
["goodTransition"] = {r = 218/255, g = 197/255, b = 92/255},
|
||||||
["badTransition"] = {r = 235/255, g = 163/255, b = 40/255},
|
["badTransition"] = {r = 235/255, g = 163/255, b = 40/255},
|
||||||
["beingTankedByTankColor"] = {r = .8, g = 0.1,b = 1},
|
["beingTankedByTankColor"] = {r = .8, g = 0.1, b = 1},
|
||||||
["beingTankedByTank"] = true,
|
["beingTankedByTank"] = true,
|
||||||
["goodScale"] = 0.8,
|
["goodScale"] = 0.8,
|
||||||
["badScale"] = 1.2,
|
["badScale"] = 1.2,
|
||||||
["useThreatColor"] = true,
|
["useThreatColor"] = true,
|
||||||
},
|
},
|
||||||
|
["filters"] = {
|
||||||
|
["Boss"] = {
|
||||||
|
["triggers"] = {
|
||||||
|
["enable"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
["units"] = {
|
["units"] = {
|
||||||
["FRIENDLY_PLAYER"] = {
|
["FRIENDLY_PLAYER"] = {
|
||||||
@@ -158,15 +184,16 @@ P["nameplates"] = {
|
|||||||
["hideTime"] = false,
|
["hideTime"] = false,
|
||||||
["castTimeFormat"] = "CURRENT",
|
["castTimeFormat"] = "CURRENT",
|
||||||
["channelTimeFormat"] = "CURRENT",
|
["channelTimeFormat"] = "CURRENT",
|
||||||
["timeToHold"] = 0
|
["timeToHold"] = 0,
|
||||||
|
["iconPosition"] = "RIGHT",
|
||||||
},
|
},
|
||||||
["buffs"] = {
|
["buffs"] = {
|
||||||
["enable"] = true,
|
["enable"] = true,
|
||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "TurtleBuffs"
|
["priority"] = "Blacklist,blockNoDuration,Personal,TurtleBuffs" --NamePlate FriendlyPlayer Buffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["debuffs"] = {
|
["debuffs"] = {
|
||||||
@@ -174,9 +201,9 @@ P["nameplates"] = {
|
|||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["baseHeight"] = 18,
|
["baseHeight"] = 18,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "CCDebuffs"
|
["priority"] = "Blacklist,blockNoDuration,Personal,CCDebuffs" --NamePlate FriendlyPlayer Debuffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["name"] = {
|
["name"] = {
|
||||||
@@ -206,16 +233,17 @@ P["nameplates"] = {
|
|||||||
["hideTime"] = false,
|
["hideTime"] = false,
|
||||||
["castTimeFormat"] = "CURRENT",
|
["castTimeFormat"] = "CURRENT",
|
||||||
["channelTimeFormat"] = "CURRENT",
|
["channelTimeFormat"] = "CURRENT",
|
||||||
["timeToHold"] = 0
|
["timeToHold"] = 0,
|
||||||
|
["iconPosition"] = "RIGHT",
|
||||||
},
|
},
|
||||||
["buffs"] = {
|
["buffs"] = {
|
||||||
["enable"] = true,
|
["enable"] = true,
|
||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["baseHeight"] = 18,
|
["baseHeight"] = 18,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "TurtleBuffs"
|
["priority"] = "Blacklist,PlayerBuffs,TurtleBuffs" --NamePlate EnemyPlayer Buffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["debuffs"] = {
|
["debuffs"] = {
|
||||||
@@ -223,9 +251,9 @@ P["nameplates"] = {
|
|||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["baseHeight"] = 18,
|
["baseHeight"] = 18,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "CCDebuffs"
|
["priority"] = "Blacklist,blockNoDuration,Personal,CCDebuffs,RaidDebuffs" --NamePlate EnemyPlayer Debuffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["name"] = {
|
["name"] = {
|
||||||
@@ -253,16 +281,17 @@ P["nameplates"] = {
|
|||||||
["hideTime"] = false,
|
["hideTime"] = false,
|
||||||
["castTimeFormat"] = "CURRENT",
|
["castTimeFormat"] = "CURRENT",
|
||||||
["channelTimeFormat"] = "CURRENT",
|
["channelTimeFormat"] = "CURRENT",
|
||||||
["timeToHold"] = 0
|
["timeToHold"] = 0,
|
||||||
|
["iconPosition"] = "RIGHT",
|
||||||
},
|
},
|
||||||
["buffs"] = {
|
["buffs"] = {
|
||||||
["enable"] = true,
|
["enable"] = true,
|
||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["baseHeight"] = 18,
|
["baseHeight"] = 18,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "TurtleBuffs"
|
["priority"] = "Blacklist,blockNoDuration,Personal,TurtleBuffs" --NamePlate FriendlyNPC Buffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["debuffs"] = {
|
["debuffs"] = {
|
||||||
@@ -270,9 +299,9 @@ P["nameplates"] = {
|
|||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["baseHeight"] = 18,
|
["baseHeight"] = 18,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "CCDebuffs"
|
["priority"] = "Blacklist,CCDebuffs,RaidDebuffs" --NamePlate FriendlyNPC Debuffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["eliteIcon"] = {
|
["eliteIcon"] = {
|
||||||
@@ -304,16 +333,17 @@ P["nameplates"] = {
|
|||||||
["hideTime"] = false,
|
["hideTime"] = false,
|
||||||
["castTimeFormat"] = "CURRENT",
|
["castTimeFormat"] = "CURRENT",
|
||||||
["channelTimeFormat"] = "CURRENT",
|
["channelTimeFormat"] = "CURRENT",
|
||||||
["timeToHold"] = 0
|
["timeToHold"] = 0,
|
||||||
|
["iconPosition"] = "RIGHT",
|
||||||
},
|
},
|
||||||
["buffs"] = {
|
["buffs"] = {
|
||||||
["enable"] = true,
|
["enable"] = true,
|
||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["baseHeight"] = 18,
|
["baseHeight"] = 18,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "TurtleBuffs"
|
["priority"] = "Blacklist,blockNoDuration,PlayerBuffs,TurtleBuffs" --NamePlate EnemyNPC Buffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["debuffs"] = {
|
["debuffs"] = {
|
||||||
@@ -321,9 +351,9 @@ P["nameplates"] = {
|
|||||||
["numAuras"] = 4,
|
["numAuras"] = 4,
|
||||||
["baseHeight"] = 18,
|
["baseHeight"] = 18,
|
||||||
["filters"] = {
|
["filters"] = {
|
||||||
["personal"] = true,
|
["minDuration"] = 0,
|
||||||
["maxDuration"] = 120,
|
["maxDuration"] = 0,
|
||||||
["filter"] = "CCDebuffs"
|
["priority"] = "Blacklist,Personal,CCDebuffs" --NamePlate EnemyNPC Debuffs
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["eliteIcon"] = {
|
["eliteIcon"] = {
|
||||||
@@ -333,11 +363,8 @@ P["nameplates"] = {
|
|||||||
["xOffset"] = 15,
|
["xOffset"] = 15,
|
||||||
["yOffset"] = 0,
|
["yOffset"] = 0,
|
||||||
},
|
},
|
||||||
["detection"] = {
|
},
|
||||||
["enable"] = true,
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
--Auras
|
--Auras
|
||||||
|
|||||||
Reference in New Issue
Block a user