local f = CreateFrame("Frame", UIParent)
f.t = f:CreateTexture()
f.t:SetTexture("Interface\\CHARACTERFRAME\\UI-StateIcon.blp")
f.t:SetTexCoord(0.5,1,0,0.49);
f.t:SetAllPoints(f)
f:SetWidth(20)
f:SetHeight(20)
f:SetPoint("CENTER", TargetFrame, "CENTER", 15, 20)
f:EnableMouse(true)
f:SetMovable(true)
f:SetScript("OnMouseDown", function(self) if IsShiftKeyDown() and IsControlKeyDown() then self:StartMoving() end end)
f:SetScript("OnMouseUp", function(self) self:StopMovingOrSizing() end)
f:Show()
local function FrameOnUpdate(self)
if IsShiftKeyDown() and IsControlKeyDown() then
self:Show()
else
if UnitAffectingCombat("target") then
self:Show()
else
self:Hide()
end
end
end
local g = CreateFrame("Frame")
g:SetScript("OnUpdate", function(self) FrameOnUpdate(f) end)
m=CreateFrame("Frame")m:SetParent(TargetFrame)m:SetPoint("Right",TargetFrame,0,5)m:SetSize(25,25)m.p=m:CreateTexture(nil,BORDER)m.p:SetAllPoints()m.p:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")m:Hide()
local function FrameOnUpdate(self) if UnitAffectingCombat("target") then self:Show() else self:Hide() end end local n = CreateFrame("Frame") n:SetScript("OnUpdate", function(self) FrameOnUpdate(m) end)
z=CreateFrame("Frame")z:SetParent(FocusFrame)z:SetPoint("Right",FocusFrame,0,5)z:SetSize(25,25)z.t=z:CreateTexture(nil,BORDER)z.t:SetAllPoints()z.t:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")z:Hide()
local function FrameOnUpdate(self) if UnitAffectingCombat("focus") then self:Show() else self:Hide() end end local g = CreateFrame("Frame") g:SetScript("OnUpdate", function(self) FrameOnUpdate(z) end)
[свернуть]