|
本帖最后由 小小沫涵 于 2015-12-5 21:40 编辑
--敌对控制监视
li={107570,108194,853,408}cd={30,30,30,20}
fl=0;ic=32;xp=-50;yp=-180;n=4;sfc=CooldownFrame_SetTimer;crf=CreateFrame;ce=math.ceil;ih=IsInInstance;gsi=GetSpellInfo;up=UIParent pe="PLAYER_ENTERING_WORLD"cdf="Cooldown"
function cf(i,s,x,y)local _,_,t=gsi(s)local f=crf("Frame",nil,up)f:SetPoint("CENTER",x,y)f:SetSize(ic,ic)f.t = f:CreateTexture(nil,"BORDER")f.t:SetAllPoints(true)f.t:SetTexture(t)f.c=CreateFrame(cdf,nil,f)f.c:SetAllPoints(f)return f;end
function ud(f,ls,lc)f:SetScript("OnEvent",function(_,_,_,e,_,_,_,b,_,_,_,_,_,s)if((bit.band(b,0x40) == 0x40)and e=="SPELL_CAST_SUCCESS"and s==ls)then sfc(f.c,GetTime(),lc,1)end end)f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")end
for i,s in ipairs(li)do _G["ib"..i] = cf(i,s,xp+(ic+5)*ce((i-1)%n),yp-(ic+5)*ce(i/n))ud(_G["ib"..i],s,cd)end
ik=crf("Frame")ik:SetScript("OnEvent",function()local _,t=ih()for i,s in ipairs(li)do local f=_G["ib"..i]if(t=="arena"or fl==0)then f:Show()f.c:Show()else f:Hide()f.c:Hide()end end end)ik:RegisterEvent(pe)
如何改成只在敌对使用后显示出来,且敌对控制完毕后自动消失! 求大神
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?加入我们
x
|