23 lines
1.2 KiB
Lua
23 lines
1.2 KiB
Lua
-- OctoTextSize: addon-local factory; Blizzard CreateFrame is unchanged.
|
|
local CreateFrame = OctoTextSize and OctoTextSize.WrapFactory(CreateFrame) or CreateFrame
|
|
-- Owner 2026-11-24: nameplates must not show through walls / upper-lower floors; only raid marks may.
|
|
-- The client fades line-of-sight-occluded nameplates by nameplateOccludedAlphaMult (default 0.4): 0 hides them.
|
|
-- The raid mark is a child of the plate, so it ignores the plate's alpha and stays visible.
|
|
local f = CreateFrame("Frame")
|
|
local function keepMark(plate)
|
|
local uf = plate and plate.UnitFrame
|
|
if not uf or (uf.IsForbidden and uf:IsForbidden()) then return end
|
|
local mark = uf.RaidTargetFrame
|
|
if mark and mark.SetIgnoreParentAlpha then pcall(mark.SetIgnoreParentAlpha, mark, true) end
|
|
end
|
|
f:RegisterEvent("PLAYER_LOGIN")
|
|
f:RegisterEvent("NAME_PLATE_UNIT_ADDED")
|
|
f:SetScript("OnEvent", function(_, event, unit)
|
|
if event == "PLAYER_LOGIN" then
|
|
if GetCVar("nameplateOccludedAlphaMult") ~= "0" then SetCVar("nameplateOccludedAlphaMult", "0") end
|
|
for _, plate in ipairs(C_NamePlate.GetNamePlates() or {}) do keepMark(plate) end
|
|
else
|
|
keepMark(C_NamePlate.GetNamePlateForUnit(unit))
|
|
end
|
|
end)
|