Delete core directory

This commit is contained in:
Wurmschwanz
2026-09-08 22:00:17 +02:00
committed by GitHub
parent d5cc7e8934
commit d96efe67ff
7 changed files with 0 additions and 2424 deletions
-10
View File
@@ -1,10 +0,0 @@
BNP = BNP or {}
function BNP:RegisterPlate(plate)
plate = plate or this
if not plate then return end
if BNP.plates[plate] then return end
BNP.plates[plate] = true
BNP.detected = BNP.detected + 1
end
-94
View File
@@ -1,94 +0,0 @@
BNP = BNP or {}
-- Robust ShaguTweaks compatibility.
-- BNP owns Scale / Class Colors / Castbar while loaded.
-- ShaguTweaks settings are NOT changed.
BNP.shaguCompat = BNP.shaguCompat or {
patched = {},
registerHooked = false,
}
local wanted = {
["Nameplate Scale"] = true,
["Nameplate Class Colors"] = true,
["Nameplate Castbar"] = true,
}
local function IsWantedTitle(title)
if not title then return false end
if wanted[title] then return true end
if ShaguTweaks and ShaguTweaks.T then
if title == ShaguTweaks.T["Nameplate Scale"] then return true end
if title == ShaguTweaks.T["Nameplate Class Colors"] then return true end
if title == ShaguTweaks.T["Nameplate Castbar"] then return true end
end
return false
end
local function DisableModule(mod)
if not mod or type(mod) ~= "table" then return false end
if not IsWantedTitle(mod.title) then return false end
if mod.BNPCompatibilityPatched then return true end
mod.BNPOriginalEnable = mod.enable
mod.enable = function(self)
return
end
mod.BNPCompatibilityPatched = true
BNP.shaguCompat.patched[mod.title or "?"] = true
return true
end
local function PatchExistingModules()
if not ShaguTweaks or not ShaguTweaks.mods then return end
local title, mod
for title, mod in pairs(ShaguTweaks.mods) do
-- Some registered module tables use localized title as the map key.
if mod and not mod.title then mod.title = title end
DisableModule(mod)
end
end
local function HookRegister()
if not ShaguTweaks or not ShaguTweaks.register then return end
if BNP.shaguCompat.registerHooked then return end
local originalRegister = ShaguTweaks.register
ShaguTweaks.register = function(self, mod)
local registered = originalRegister(self, mod)
DisableModule(registered or mod)
return registered
end
BNP.shaguCompat.registerHooked = true
end
function BNP:ApplyShaguTweaksCompatibility()
if not ShaguTweaks then return false end
-- Covers BNP loading before Shagu's modules register.
HookRegister()
-- Covers BNP loading after Shagu's modules registered.
PatchExistingModules()
return true
end
-- Try immediately in case ShaguTweaks is already loaded.
BNP:ApplyShaguTweaksCompatibility()
-- Also retry after every addon load. This safely covers all Vanilla/Turtle
-- load-order variations without touching ShaguTweaks saved settings.
local loader = CreateFrame("Frame")
loader:RegisterEvent("ADDON_LOADED")
loader:SetScript("OnEvent", function()
BNP:ApplyShaguTweaksCompatibility()
end)
-393
View File
@@ -1,393 +0,0 @@
BNP = BNP or {}
BNP.defaults = BNP.defaults or {
nameplateScale = 1.0,
nameplateYOffset = 0,
comboPointsYOffset = 0,
nameFontSize = 12,
nameFontYOffset = 0,
nonTargetAlpha = 1.0,
iconSize = 18,
ccIconSize = 18,
debuffYOffset = 0,
ccYOffset = 0,
debuffPosition = "top",
ccPosition = "top",
tankMode = false,
classColors = true,
hidePlayerNames = false,
hideNPCNames = false,
castbars = true,
debuffs = true,
crowdControl = true,
separateCCRow = true,
showOtherCCs = true,
pvpImmunities = true,
immunityIconSize = 18,
immunityPosition = "top",
immunityYOffset = 0,
castbarHeight = 6,
castbarSpacing = 4,
minimapAngle = 225,
healthPercent = false,
healthText = "off",
healthTextFontSize = 9,
healthTextOutline = "outline",
targetFocus = true,
targetGlowColor = "white",
targetGlowSize = 0,
targetGlowOpacity = 1.0,
targetArrows = false,
targetArrowColor = "match",
targetArrowSize = 14,
targetArrowThick = false,
targetArrowStyle = "chevron",
comboPoints = true,
totemIndicators = true,
totemIconSize = 24,
}
function BNP:InitConfig()
BNP_DB = BNP_DB or {}
if BNP_DB.nameplateScale == nil then BNP_DB.nameplateScale = self.defaults.nameplateScale end
if BNP_DB.nameplateYOffset == nil then BNP_DB.nameplateYOffset = self.defaults.nameplateYOffset end
if BNP_DB.comboPointsYOffset == nil then BNP_DB.comboPointsYOffset = self.defaults.comboPointsYOffset end
-- nameFontSize intentionally stays nil until the user moves the slider.
-- This preserves the exact font size provided by Blizzard/skin addons on update.
if BNP_DB.nameFontYOffset == nil then BNP_DB.nameFontYOffset = self.defaults.nameFontYOffset end
if BNP_DB.nonTargetAlpha == nil then BNP_DB.nonTargetAlpha = self.defaults.nonTargetAlpha end
if BNP_DB.iconSize == nil then BNP_DB.iconSize = self.defaults.iconSize end
if BNP_DB.ccIconSize == nil then BNP_DB.ccIconSize = BNP_DB.iconSize or self.defaults.ccIconSize end
if BNP_DB.debuffYOffset == nil then BNP_DB.debuffYOffset = self.defaults.debuffYOffset end
if BNP_DB.ccYOffset == nil then BNP_DB.ccYOffset = self.defaults.ccYOffset end
if BNP_DB.debuffPosition == nil then BNP_DB.debuffPosition = self.defaults.debuffPosition end
if BNP_DB.ccPosition == nil then BNP_DB.ccPosition = BNP_DB.debuffPosition or self.defaults.ccPosition end
if BNP_DB.tankMode == nil then BNP_DB.tankMode = self.defaults.tankMode end
if BNP_DB.classColors == nil then BNP_DB.classColors = self.defaults.classColors end
if BNP_DB.hidePlayerNames == nil then BNP_DB.hidePlayerNames = self.defaults.hidePlayerNames end
if BNP_DB.hideNPCNames == nil then BNP_DB.hideNPCNames = self.defaults.hideNPCNames end
if BNP_DB.castbars == nil then BNP_DB.castbars = self.defaults.castbars end
if BNP_DB.debuffs == nil then BNP_DB.debuffs = self.defaults.debuffs end
if BNP_DB.crowdControl == nil then BNP_DB.crowdControl = (BNP_DB.debuffs ~= false) and true or false end
if BNP_DB.separateCCRow == nil then BNP_DB.separateCCRow = self.defaults.separateCCRow end
if BNP_DB.showOtherCCs == nil then BNP_DB.showOtherCCs = self.defaults.showOtherCCs end
if BNP_DB.pvpImmunities == nil then BNP_DB.pvpImmunities = self.defaults.pvpImmunities end
if BNP_DB.immunityIconSize == nil then BNP_DB.immunityIconSize = BNP_DB.iconSize or self.defaults.immunityIconSize end
if BNP_DB.immunityPosition == nil then BNP_DB.immunityPosition = self.defaults.immunityPosition end
if BNP_DB.immunityYOffset == nil then BNP_DB.immunityYOffset = self.defaults.immunityYOffset end
-- Position migration from the temporary all-Bottom test build.
if BNP_DB.debuffPosition == "bottom" then BNP_DB.debuffPosition = "bottom_mid" end
if BNP_DB.ccPosition == "bottom" then BNP_DB.ccPosition = "top" end
if BNP_DB.immunityPosition == "bottom" then BNP_DB.immunityPosition = "top" end
if BNP_DB.castbarHeight == nil then BNP_DB.castbarHeight = self.defaults.castbarHeight end
if BNP_DB.castbarSpacing == nil then BNP_DB.castbarSpacing = self.defaults.castbarSpacing end
if BNP_DB.minimapAngle == nil then BNP_DB.minimapAngle = self.defaults.minimapAngle end
if BNP_DB.healthPercent == nil then BNP_DB.healthPercent = self.defaults.healthPercent end
if BNP_DB.healthText == nil then
-- Backwards-compatible migration from the old Health % checkbox.
BNP_DB.healthText = BNP_DB.healthPercent and "percent" or self.defaults.healthText
end
if BNP_DB.healthTextFontSize == nil then BNP_DB.healthTextFontSize = self.defaults.healthTextFontSize end
if BNP_DB.healthTextOutline == nil then BNP_DB.healthTextOutline = self.defaults.healthTextOutline end
if BNP_DB.targetFocus == nil then BNP_DB.targetFocus = self.defaults.targetFocus end
if BNP_DB.targetGlowColor == nil then BNP_DB.targetGlowColor = self.defaults.targetGlowColor end
if BNP_DB.targetGlowSize == nil then BNP_DB.targetGlowSize = self.defaults.targetGlowSize end
if BNP_DB.targetGlowOpacity == nil then BNP_DB.targetGlowOpacity = self.defaults.targetGlowOpacity end
if BNP_DB.targetArrows == nil then BNP_DB.targetArrows = self.defaults.targetArrows end
if BNP_DB.targetArrowColor == nil then BNP_DB.targetArrowColor = self.defaults.targetArrowColor end
if BNP_DB.targetArrowSize == nil then BNP_DB.targetArrowSize = self.defaults.targetArrowSize end
if BNP_DB.targetArrowThick == nil then BNP_DB.targetArrowThick = self.defaults.targetArrowThick end
if BNP_DB.targetArrowStyle == nil then BNP_DB.targetArrowStyle = self.defaults.targetArrowStyle end
if BNP_DB.comboPoints == nil then BNP_DB.comboPoints = self.defaults.comboPoints end
if BNP_DB.totemIndicators == nil then BNP_DB.totemIndicators = self.defaults.totemIndicators end
if BNP_DB.totemIconSize == nil then BNP_DB.totemIconSize = self.defaults.totemIconSize end
end
function BNP:GetNameplateScale()
return (BNP_DB and tonumber(BNP_DB.nameplateScale)) or self.defaults.nameplateScale
end
function BNP:GetNameplateYOffset()
local value = (BNP_DB and tonumber(BNP_DB.nameplateYOffset)) or self.defaults.nameplateYOffset or 0
if value < 0 then value = 0 end
if value > 50 then value = 50 end
return value
end
local function ClampVisualYOffset(value)
value = tonumber(value) or 0
if value < -50 then value = -50 end
if value > 50 then value = 50 end
return value >= 0 and math.floor(value + 0.5) or math.ceil(value - 0.5)
end
function BNP:GetComboPointsYOffset()
return ClampVisualYOffset(BNP_DB and BNP_DB.comboPointsYOffset or self.defaults.comboPointsYOffset)
end
function BNP:GetNameFontSize()
local explicit = BNP_DB and tonumber(BNP_DB.nameFontSize)
local value = explicit or tonumber(self.defaultNameFontSize) or self.defaults.nameFontSize or 12
if value < 8 then value = 8 end
if value > 24 then value = 24 end
return math.floor(value + 0.5)
end
function BNP:GetNameFontYOffset()
return ClampVisualYOffset(BNP_DB and BNP_DB.nameFontYOffset or self.defaults.nameFontYOffset)
end
function BNP:GetDebuffYOffset()
return ClampVisualYOffset(BNP_DB and BNP_DB.debuffYOffset or self.defaults.debuffYOffset)
end
function BNP:GetCCYOffset()
return ClampVisualYOffset(BNP_DB and BNP_DB.ccYOffset or self.defaults.ccYOffset)
end
function BNP:GetImmunityYOffset()
return ClampVisualYOffset(BNP_DB and BNP_DB.immunityYOffset or self.defaults.immunityYOffset)
end
function BNP:GetNonTargetAlpha()
local value = (BNP_DB and tonumber(BNP_DB.nonTargetAlpha)) or self.defaults.nonTargetAlpha or 1.0
if value < 0.30 then value = 0.30 end
if value > 1.00 then value = 1.00 end
return value
end
function BNP:GetIconSize()
return (BNP_DB and tonumber(BNP_DB.iconSize)) or self.defaults.iconSize
end
function BNP:GetCCIconSize()
local value = (BNP_DB and tonumber(BNP_DB.ccIconSize)) or self.defaults.ccIconSize or self:GetIconSize()
if value < 12 then value = 12 end
if value > 32 then value = 32 end
return value
end
function BNP:GetDebuffPosition()
local position = (BNP_DB and BNP_DB.debuffPosition) or self.defaults.debuffPosition or "top"
-- Migrate the first Bottom implementation to the new centered Bottom option.
if position == "bottom" then position = "bottom_mid" end
if position ~= "top" and position ~= "top_left" and position ~= "top_right"
and position ~= "left" and position ~= "right"
and position ~= "bottom_mid" and position ~= "bottom_left" and position ~= "bottom_right" then
position = "top"
end
return position
end
function BNP:GetCCPosition()
local position = (BNP_DB and BNP_DB.ccPosition) or self.defaults.ccPosition or "top"
-- Bottom is intentionally not supported for CCs.
if position ~= "top" and position ~= "left" and position ~= "right" then
position = "top"
end
return position
end
function BNP:GetImmunityIconSize()
local value = (BNP_DB and tonumber(BNP_DB.immunityIconSize)) or self.defaults.immunityIconSize or self:GetIconSize()
if value < 12 then value = 12 end
if value > 32 then value = 32 end
return value
end
function BNP:GetImmunityPosition()
local position = (BNP_DB and BNP_DB.immunityPosition) or self.defaults.immunityPosition or "top"
-- Bottom is intentionally not supported for immunities.
if position ~= "top" and position ~= "left" and position ~= "right" then
position = "top"
end
return position
end
function BNP:IsTankModeEnabled()
return BNP_DB and BNP_DB.tankMode and true or false
end
function BNP:AreClassColorsEnabled()
return not BNP_DB or BNP_DB.classColors ~= false
end
function BNP:HidePlayerNamesEnabled()
return BNP_DB and BNP_DB.hidePlayerNames and true or false
end
function BNP:HideNPCNamesEnabled()
return BNP_DB and BNP_DB.hideNPCNames and true or false
end
function BNP:AreCastbarsEnabled()
return not BNP_DB or BNP_DB.castbars ~= false
end
function BNP:GetCastbarHeight()
local value = (BNP_DB and tonumber(BNP_DB.castbarHeight)) or self.defaults.castbarHeight
if value < 4 then value = 4 end
if value > 14 then value = 14 end
return value
end
function BNP:GetCastbarSpacing()
local value = (BNP_DB and tonumber(BNP_DB.castbarSpacing)) or self.defaults.castbarSpacing or 4
if value < 0 then value = 0 end
if value > 10 then value = 10 end
return value
end
function BNP:GetHealthTextMode()
local mode = (BNP_DB and BNP_DB.healthText) or self.defaults.healthText or "off"
if mode ~= "off" and mode ~= "percent" and mode ~= "hp" and mode ~= "both" then
mode = "off"
end
return mode
end
function BNP:IsHealthPercentEnabled()
local mode = self:GetHealthTextMode()
return mode == "percent" or mode == "both"
end
function BNP:IsHealthTextEnabled()
return self:GetHealthTextMode() ~= "off"
end
function BNP:GetHealthTextFontSize()
local value = (BNP_DB and tonumber(BNP_DB.healthTextFontSize)) or self.defaults.healthTextFontSize or 9
if value < 8 then value = 8 end
if value > 20 then value = 20 end
return math.floor(value + 0.5)
end
function BNP:GetHealthTextOutline()
local value = (BNP_DB and BNP_DB.healthTextOutline) or self.defaults.healthTextOutline or "outline"
if value ~= "none" and value ~= "outline" and value ~= "thick" then
value = "outline"
end
return value
end
function BNP:IsTargetFocusEnabled()
return not BNP_DB or BNP_DB.targetFocus ~= false
end
function BNP:GetTargetGlowColor()
local key = (BNP_DB and BNP_DB.targetGlowColor) or self.defaults.targetGlowColor or "white"
local colors = {
white = { 1.00, 1.00, 1.00 },
gold = { 1.00, 0.82, 0.10 },
blue = { 0.25, 0.55, 1.00 },
green = { 0.25, 1.00, 0.35 },
red = { 1.00, 0.20, 0.20 },
purple = { 0.75, 0.35, 1.00 },
}
local c = colors[key] or colors.white
return c[1], c[2], c[3], key
end
function BNP:GetTargetGlowSize()
local value = (BNP_DB and tonumber(BNP_DB.targetGlowSize)) or self.defaults.targetGlowSize or 0
if value < 0 then value = 0 end
if value > 20 then value = 20 end
return value
end
function BNP:GetTargetGlowOpacity()
local value = (BNP_DB and tonumber(BNP_DB.targetGlowOpacity)) or self.defaults.targetGlowOpacity or 1.0
if value < 0.20 then value = 0.20 end
if value > 1.00 then value = 1.00 end
return value
end
function BNP:AreTargetArrowsEnabled()
return BNP_DB and BNP_DB.targetArrows == true
end
function BNP:GetTargetArrowColor()
local key = (BNP_DB and BNP_DB.targetArrowColor) or self.defaults.targetArrowColor or "match"
if key == "match" then
local r, g, b = self:GetTargetGlowColor()
return r, g, b, key
end
local colors = {
white = { 1.00, 1.00, 1.00 },
gold = { 1.00, 0.82, 0.10 },
blue = { 0.25, 0.55, 1.00 },
green = { 0.25, 1.00, 0.35 },
red = { 1.00, 0.20, 0.20 },
purple = { 0.75, 0.35, 1.00 },
}
local c = colors[key] or colors.white
return c[1], c[2], c[3], key
end
function BNP:GetTargetArrowSize()
local value = (BNP_DB and tonumber(BNP_DB.targetArrowSize)) or self.defaults.targetArrowSize or 14
if value < 10 then value = 10 end
if value > 24 then value = 24 end
return value
end
function BNP:AreTargetArrowsThick()
return BNP_DB and BNP_DB.targetArrowThick == true
end
function BNP:GetTargetArrowStyle()
local style = (BNP_DB and BNP_DB.targetArrowStyle) or self.defaults.targetArrowStyle or "chevron"
if style ~= "chevron" and style ~= "triangle" and style ~= "slim_triangle"
and style ~= "double_chevron" and style ~= "diamond_tip" then
style = "chevron"
end
return style
end
function BNP:AreComboPointsEnabled()
return not BNP_DB or BNP_DB.comboPoints ~= false
end
function BNP:AreTotemIndicatorsEnabled()
return not BNP_DB or BNP_DB.totemIndicators ~= false
end
function BNP:GetTotemIconSize()
local value = (BNP_DB and tonumber(BNP_DB.totemIconSize)) or self.defaults.totemIconSize or 24
if value < 16 then value = 16 end
if value > 36 then value = 36 end
return value
end
function BNP:AreDebuffsEnabled()
return not BNP_DB or BNP_DB.debuffs ~= false
end
function BNP:AreCrowdControlEnabled()
return not BNP_DB or BNP_DB.crowdControl ~= false
end
function BNP:AreAnyAurasEnabled()
return self:AreDebuffsEnabled() or self:AreCrowdControlEnabled()
end
function BNP:IsSeparateCCRowEnabled()
return not BNP_DB or BNP_DB.separateCCRow ~= false
end
function BNP:ShowOtherPlayersCCs()
return not BNP_DB or BNP_DB.showOtherCCs ~= false
end
function BNP:ArePvPImmunitiesEnabled()
return not BNP_DB or BNP_DB.pvpImmunities ~= false
end
-43
View File
@@ -1,43 +0,0 @@
BNP = BNP or {}
BNP.version = "1.0.9"
BNP.plates = BNP.plates or {}
BNP.detected = 0
BNP.debugEnabled = false
function BNP:Print(msg)
if DEFAULT_CHAT_FRAME then
DEFAULT_CHAT_FRAME:AddMessage("|cff33ff99Blizz Nameplates+:|r " .. tostring(msg))
end
end
local eventFrame = CreateFrame("Frame")
eventFrame:RegisterEvent("VARIABLES_LOADED")
eventFrame:SetScript("OnEvent", function()
BNP_DB = BNP_DB or {}
if BNP.InitConfig then BNP:InitConfig() end
if BNP.CreateMinimapButton then BNP:CreateMinimapButton() end
if BNP.InstallTankMode then BNP:InstallTankMode() end
if BNP_DB.debugEnabled == nil then BNP_DB.debugEnabled = false end
BNP.debugEnabled = BNP_DB.debugEnabled
local classicNameplates = CLASSIC_API_VERSION and C_NamePlate and
type(C_NamePlate.GetNamePlateForUnit) == "function"
if CombatLogAdd and SpellInfo and classicNameplates then
BNP:Print(BNP.version .. " loaded. SuperWoW + ClassicAPI nameplate tracking active.")
BNP:Print("Dragon command test build loaded.")
if ShaguTweaks then
BNP:ApplyShaguTweaksCompatibility()
local count = 0
local k
for k in pairs(BNP.shaguCompat.patched or {}) do count = count + 1 end
BNP:Print("ShaguTweaks compatibility active (" .. tostring(count) .. "/3 nameplate modules suppressed).")
end
elseif not CombatLogAdd or not SpellInfo then
BNP:Print("ERROR: SuperWoW API not detected. Blizz Nameplates+ requires SuperWoW.")
else
BNP:Print("ERROR: ClassicAPI nameplate API not detected. Please update ClassicAPI.dll.")
end
end)
-173
View File
@@ -1,173 +0,0 @@
BNP = BNP or {}
BNP.libnameplate = BNP.libnameplate or {
OnInit = {},
OnShow = {},
OnUpdate = {},
}
local lib = BNP.libnameplate
local known = {}
local initializedChildren = 0
local function FindHealthBar(frame)
if not frame or not frame.GetChildren then return nil end
local children = { frame:GetChildren() }
local i
for i = 1, table.getn(children) do
local child = children[i]
if child and child.GetObjectType and child:GetObjectType() == "StatusBar" then
return child
end
end
return nil
end
local function IsNamePlate(frame)
if not frame or not frame.GetObjectType then return false end
if frame:GetObjectType() ~= "Button" then return false end
-- Fast path for untouched Blizzard nameplates.
local firstRegion = frame:GetRegions()
if firstRegion and firstRegion.GetObjectType and firstRegion.GetTexture and
firstRegion:GetObjectType() == "Texture" and
firstRegion:GetTexture() == "Interface\\Tooltips\\Nameplate-Border" then
return true
end
-- Compatibility fallback: some UI/skin addons replace, blank or hide the
-- native border before BNP's WorldFrame scan sees the plate. Do not make
-- nameplate discovery depend on a mutable texture path.
local replacement = frame.nameplate
local original = replacement and replacement.original
-- Known replacement-overlay shape: the addon kept references to Blizzard's
-- original health/name/level objects even if it already reparented them.
if original and (original.health or original.healthbar) and
original.name and original.level then
return true
end
-- Generic safe fallback. Keep the structural test deliberately strict to
-- avoid mistaking unrelated WorldFrame Buttons for nameplates.
if not firstRegion or not firstRegion.GetObjectType or
firstRegion:GetObjectType() ~= "Texture" then
return false
end
if not FindHealthBar(frame) then return false end
local fontStrings = 0
local regions = { frame:GetRegions() }
local i
for i = 1, table.getn(regions) do
local region = regions[i]
if region and region.GetObjectType and region:GetObjectType() == "FontString" then
fontStrings = fontStrings + 1
if fontStrings >= 2 then return true end
end
end
return false
end
local function AttachPlateShortcuts(plate)
if plate.BNPShortcutsReady then return end
-- Do not assume another addon left the native StatusBar as the first child.
local replacement = plate.nameplate
local original = replacement and replacement.original
plate.healthbar = (original and (original.health or original.healthbar)) or
FindHealthBar(plate)
-- Vanilla region order:
-- 1 border, 2 glow, 3 name, 4 level, 5 level icon, 6 raid icon.
-- Fall back to common replacement-overlay references only when direct native
-- regions are unavailable; normal Blizzard plates keep the exact old path.
local regions = { plate:GetRegions() }
plate.border = (original and original.border) or regions[1]
plate.glow = regions[2] or (original and original.glow)
plate.name = regions[3] or (original and original.name)
plate.level = regions[4] or (original and original.level)
plate.levelicon = regions[5] or (original and (original.levelicon or original.bossicon))
plate.raidicon = regions[6] or (replacement and replacement.raidicon) or
(original and original.raidicon)
plate.BNPShortcutsReady = true
end
local function Fire(list, plate)
plate = plate or this
if not plate then return end
local i
for i = 1, table.getn(list) do
if list[i] then
pcall(list[i], plate)
end
end
end
local function RegisterPlate(plate)
plate = plate or this
if not plate then return end
if known[plate] then return end
known[plate] = true
AttachPlateShortcuts(plate)
if BNP.RegisterPlate then
BNP:RegisterPlate(plate)
end
Fire(lib.OnInit, plate)
if plate:IsShown() then
Fire(lib.OnShow, plate)
end
-- Run OnShow callbacks when Blizzard reuses the same plate.
local oldOnShow = plate:GetScript("OnShow")
plate:SetScript("OnShow", function(self)
local current = self or this or plate
if not current then return end
if oldOnShow then oldOnShow(current) end
AttachPlateShortcuts(current)
Fire(lib.OnShow, current)
end)
end
local scanner = CreateFrame("Frame")
local scanElapsed = 0
scanner:SetScript("OnUpdate", function()
scanElapsed = scanElapsed + arg1
if scanElapsed < 0.10 then return end
scanElapsed = 0
local count = WorldFrame:GetNumChildren()
-- Full scan only when WorldFrame gained children. This mirrors the lightweight
-- discovery strategy used by Shagu's Vanilla nameplate code.
if count > initializedChildren then
local children = { WorldFrame:GetChildren() }
local i
for i = 1, table.getn(children) do
local frame = children[i]
if not known[frame] and IsNamePlate(frame) then
RegisterPlate(frame)
end
end
initializedChildren = count
end
-- Compatibility callback list for modules that want a throttled plate update.
if table.getn(lib.OnUpdate) > 0 then
local plate
for plate in pairs(known) do
if plate:IsShown() then
Fire(lib.OnUpdate, plate)
end
end
end
end)
-1696
View File
File diff suppressed because it is too large Load Diff
-15
View File
@@ -1,15 +0,0 @@
BNP = BNP or {}
-- Central visual constants. Keeping these values in one place lets us polish
-- the Blizzard-style presentation without touching aura tracking logic.
BNP.UI = BNP.UI or {
ICON_SIZE = 18,
ICON_OFFSET_Y = 15,
ICON_SPACING = 2,
TIMER_FONT = "Fonts\\FRIZQT__.TTF",
TIMER_SIZE = 8,
TIMER_OFFSET_X = 0,
TIMER_OFFSET_Y = 0,
TIMER_SHADOW_X = 1,
TIMER_SHADOW_Y = -1,
}