PHP код:
local function CreateIcon(parent)
local frame = CreateFrame("Frame", nil, parent);
frame:SetPoint("CENTER", parent, 0, 25);
frame:SetSize(30, 30);
frame.Icon = frame:CreateTexture(nil,"OVERLAY");
frame.Icon:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD");
frame.Icon:SetAllPoints();
end;
CreateFrame("Frame"):SetScript('OnUpdate', function()
for i = 1,select('#',WorldFrame:GetChildren()) do
local frame = select(i, WorldFrame:GetChildren());
local _, healthBorder, _, _, _, highlightTexture, nameText, levelText, _, _, _ = frame:GetRegions();
if healthBorder and healthBorder:GetObjectType() == "Texture" and healthBorder:GetTexture() == [=[Interface\Tooltips\Nameplate-Border]=] then
local IconFrame = select(3,frame:GetChildren());
if IconFrame == nil then
CreateIcon(frame);
end;
end;
end;
end);