还记得地球时代的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
[1] [2] 下一页
作者:Detake
更新时间:2008-6-14 12:51:41