简易施法条 Castbar
还记得地球时代的Castingbar吗?施法发现Quartz的臃肿? 现在轻量级的替换系统施法条的差距回来了。 为尽量减少体积,插件无任何图形和命令行设置,所有调整都需要在Lua文件中完成。 全部代码如下: local dummy = function() end -- castbar local cb = CastingBarFrame cb:ClearAllPoints() cb:SetPoint("CENTER", UIParent, "CENTER", 13, -255) -- 此行调整施法条在屏幕中的位置及 13 -255 数字调整为自己所需位置 cb.SetPoint = dummy cb:SetWidth(180) cb:SetHeight(13) local bg, spell, border, icon, spark, flash = cb:GetRegions() bg:ClearAllPoints() bg:SetPoint("TOP", 0, 1.15) bg:SetHeight(15) bg:SetWidth(180) border:SetWidth(240) border:SetTexture("Interface\\CastingBar\\UI-CastingBar-Border-Small") flash:SetWidth(240) flash:SetTexture("Interface\\CastingBar\\UI-CastingBar-Flash-Small") icon:Show() --此为图标显示 icon:SetWidth(20) icon:SetHeight(20) icon:SetPoint("RIGHT",CastingBarFrame,"LEFT",-5,2) --此为图标显示位置 CastingBarFrameText:ClearAllPoints() CastingBarFrameText:SetPoint("CENTER",-50,2) --此为文字显示位置 CastingBarFrameText:SetTextColor(0,1,0) --此为文字显示颜色 -- Castbar Timer local text = cb:CreateFontString(nil, "ARTWORK") text:SetFontObject(GameFontNormal) --此为时间文字显示字体 text:SetTextColor(0,1,0) --此为时间文字显示颜色 text:SetPoint("CENTER",78,2) --此为时间文字显示位置 text:SetParent(cb) local orig_CastingBarFrame_OnUpdate = CastingBarFrame_OnUpdate function CastingBarFrame_OnUpdate(...) orig_CastingBarFrame_OnUpdate(...) if(CastingBarFrame.unit == "player") then if(this.casting and CastingBarFrame.maxValue) then text:SetText(format("%.1f", CastingBarFrame.maxValue - GetTime())) text:Show() elseif(this.channeling and CastingBarFrame.maxValue) then local _, _, _, _, _, endTime = UnitCastingInfo("player") text:SetText(format("%.1f", CastingBarFrame.endTime - GetTime())) text:Show() else text:Hide() end end end 所有代码均为七拼八凑完成,任何人均可以自行精简和修改,无需PM我 暂时屏蔽掉时间,有未知错误.
|
|