mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-02 17:06:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
494f176f18 |
+22
-9
@@ -671,7 +671,8 @@ pfUI:RegisterModule("nameplates", function ()
|
|||||||
local function CreateDebuffIcon(plate, index)
|
local function CreateDebuffIcon(plate, index)
|
||||||
local icon = CreateFrame("Frame", plate.platename.."Debuff"..index, plate)
|
local icon = CreateFrame("Frame", plate.platename.."Debuff"..index, plate)
|
||||||
icon:Hide()
|
icon:Hide()
|
||||||
icon:SetFrameLevel(4)
|
-- relative: a raised target plate can grow icons too
|
||||||
|
icon:SetFrameLevel(plate.health:GetFrameLevel())
|
||||||
|
|
||||||
icon.icon = icon:CreateTexture(nil, "BACKGROUND")
|
icon.icon = icon:CreateTexture(nil, "BACKGROUND")
|
||||||
icon.icon:SetColorTexture(.3,1,.8,1)
|
icon.icon:SetColorTexture(.3,1,.8,1)
|
||||||
@@ -684,7 +685,7 @@ pfUI:RegisterModule("nameplates", function ()
|
|||||||
icon.stacks:SetTextColor(1,1,0)
|
icon.stacks:SetTextColor(1,1,0)
|
||||||
|
|
||||||
icon.cd = CreateCooldown(icon, "nameplate", plate.platename.."Debuff"..index.."Cooldown")
|
icon.cd = CreateCooldown(icon, "nameplate", plate.platename.."Debuff"..index.."Cooldown")
|
||||||
icon.cd:SetFrameLevel(6)
|
icon.cd:SetFrameLevel(icon:GetFrameLevel() + 2)
|
||||||
|
|
||||||
plate.debuffs[index] = icon
|
plate.debuffs[index] = icon
|
||||||
end
|
end
|
||||||
@@ -799,11 +800,22 @@ pfUI:RegisterModule("nameplates", function ()
|
|||||||
plate:SetAlpha(alpha)
|
plate:SetAlpha(alpha)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateStrata(plate)
|
-- The engine's plates draw in the world frame's stratum, under every UI
|
||||||
local strata = plate.istarget and "LOW" or "BACKGROUND"
|
-- stratum, and the overlay inherits it; a SetFrameStrata would lift it into
|
||||||
if plate.strata == strata then return end
|
-- the UI's and over the chat. The target rises above the other plates by
|
||||||
plate.strata = strata
|
-- level instead: raise the engine frame, then re-parent the overlay, which
|
||||||
plate:SetFrameStrata(strata)
|
-- moves its whole subtree to the new parent level.
|
||||||
|
local TARGET_RAISE = 20
|
||||||
|
|
||||||
|
local function UpdateStacking(plate)
|
||||||
|
local raised = plate.istarget and true or nil
|
||||||
|
if plate.raised == raised then return end
|
||||||
|
plate.raised = raised
|
||||||
|
local parent = plate.parent
|
||||||
|
parent:SetFrameLevel(plate.baselevel + (raised and TARGET_RAISE or 0))
|
||||||
|
-- SetParent does nothing for the same parent, so it goes through nil
|
||||||
|
plate:SetParent(nil)
|
||||||
|
plate:SetParent(parent)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
@@ -957,7 +969,7 @@ pfUI:RegisterModule("nameplates", function ()
|
|||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
local function SetTarget(plate, istarget)
|
local function SetTarget(plate, istarget)
|
||||||
plate.istarget = istarget
|
plate.istarget = istarget
|
||||||
UpdateStrata(plate)
|
UpdateStacking(plate)
|
||||||
UpdateBorder(plate)
|
UpdateBorder(plate)
|
||||||
UpdateLayout(plate)
|
UpdateLayout(plate)
|
||||||
UpdateCombo(plate)
|
UpdateCombo(plate)
|
||||||
@@ -1028,7 +1040,7 @@ pfUI:RegisterModule("nameplates", function ()
|
|||||||
UpdateLayout(plate)
|
UpdateLayout(plate)
|
||||||
UpdateDebuffs(plate)
|
UpdateDebuffs(plate)
|
||||||
UpdateCombo(plate)
|
UpdateCombo(plate)
|
||||||
UpdateStrata(plate)
|
UpdateStacking(plate)
|
||||||
UpdateAlpha(plate)
|
UpdateAlpha(plate)
|
||||||
UpdateCast(plate)
|
UpdateCast(plate)
|
||||||
if cfg.targetzoom and plate.istarget then StartZoom(plate, true) end
|
if cfg.targetzoom and plate.istarget then StartZoom(plate, true) end
|
||||||
@@ -1160,6 +1172,7 @@ pfUI:RegisterModule("nameplates", function ()
|
|||||||
nameplate.platename = platename
|
nameplate.platename = platename
|
||||||
nameplate:EnableMouse(false)
|
nameplate:EnableMouse(false)
|
||||||
nameplate.parent = parent
|
nameplate.parent = parent
|
||||||
|
nameplate.baselevel = parent:GetFrameLevel()
|
||||||
nameplate.cache = {}
|
nameplate.cache = {}
|
||||||
|
|
||||||
-- Each plate watches its own unit. With RegisterUnitEvent the token IS the
|
-- Each plate watches its own unit. With RegisterUnitEvent the token IS the
|
||||||
|
|||||||
Reference in New Issue
Block a user