PHP код:
local engine, modules, media = select(2, ...):unpack()
local select = select
local n = modules:LoadModule("NamePlates")
local nameplates, visible = {}, {}
local SetHealthBarText
do
local FormatValue = engine.FormatValue
SetHealthBarText = function(bar)
local cur, max, text = bar:GetValue(), select(2, bar:GetMinMaxValues()), bar.text
text:SetFormattedText("%s - %1.0f%s", FormatValue(cur), cur/max*100, "%")
end
end
local OnShow = function(self)
local healthBar = self.healthBar
healthBar:ClearAllPoints()
healthBar:SetPoint("CENTER")
SetHealthBarText(healthBar)
local highlight = self.highlight
highlight:ClearAllPoints()
highlight:SetPoint("TOPLEFT", healthBar, 1, -1)
highlight:SetPoint("BOTTOMRIGHT", healthBar, -1, 1)
highlight:Hide()
local nameText = self.nameText
nameText:ClearAllPoints()
nameText:SetPoint("BOTTOMLEFT", healthBar, "TOPLEFT", 15, 5)
local levelText = self.levelText
levelText:ClearAllPoints()
levelText:SetPoint("BOTTOMLEFT", healthBar, "TOPLEFT", 0, 3)
local bossIcon = self.bossIcon
bossIcon:ClearAllPoints()
bossIcon:SetPoint("BOTTOMLEFT", healthBar, "TOPLEFT", 0, 3)
visible[self] = true
end
local OnHide = function(self)
visible[self] = nil
end
local IsNamePlate
do
local overlayTexture = [=[Interface\Tooltips\Nameplate-Border]=]
IsNamePlate = function(frame)
if frame:GetName() then return end
local overlayRegion = select(2, frame:GetRegions())
return overlayRegion and overlayRegion:GetObjectType() == "Texture" and overlayRegion:GetTexture() == overlayTexture
end
end
local ScanWorldFrameChildren
do
function ScanWorldFrameChildren(frame, ...)
if not frame then return end
if not nameplates[frame] and IsNamePlate(frame) then
local healthBar = frame:GetChildren()
local glow, overlay, castRegion, shielded, spellIcon, highlight, nameText, levelText, bossIcon, raidIcon, stateIcon = frame:GetRegions()
healthBar:SetStatusBarTexture("Interface\\AddOns\\ReduxV4\\media\\statusBar")
healthBar:CreateBorder(6)
healthBar:SetBorderPadding(1)
healthBar.text = engine.CreateFontString(healthBar, 8, "CENTER")
healthBar.text:SetPoint("CENTER")
healthBar:SetScript("OnValueChanged", SetHealthBarText)
frame.healthBar = healthBar
highlight:SetTexture(0, .33, .11)
frame.highlight = highlight
nameText:SetFont("Fonts/FRIZQT__.ttf", 10)
nameText:SetShadowOffset(-1, 1)
nameText:SetJustifyH("LEFT")
nameText:SetSize(healthBar:GetWidth()*.85, 5)
frame.nameText = nameText
levelText:SetFont("Fonts/FRIZQT__.ttf", 10)
levelText:SetShadowOffset(-1, 1)
frame.levelText = levelText
bossIcon:SetSize(12, 12)
frame.bossIcon = bossIcon
glow:SetTexture(nil)
overlay:SetTexture(nil)
castRegion:SetTexture(nil)
shielded:SetTexture(nil)
spellIcon:SetTexture(nil)
stateIcon:SetTexture(nil)
OnShow(frame)
frame:SetScript("OnShow", OnShow)
frame:SetScript("OnHide", OnHide)
nameplates[frame] = true
end
return ScanWorldFrameChildren(...)
end
end
local HandlePlates
do
local WorldFrame = WorldFrame
local curChildren
local prevChildren = 0
function HandlePlates(this, elapsed)
local curChildren = WorldFrame:GetNumChildren()
if curChildren ~= prevChildren then
prevChildren = curChildren
ScanWorldFrameChildren( WorldFrame:GetChildren() )
end
end
end
function n:Init()
CreateFrame("frame"):SetScript("OnUpdate", HandlePlates)
SetCVar("ShowVKeyCastbar", 0)
end
PS плейты елва и ... если банально через :SetBackdor() налепить то же начинают сажать фпс.