战士 法师 圣骑士 牧师 猎人 盗贼 术士 德鲁伊 萨满

替换系统施法条 Castbar

您现在的位置: TG网络游戏 >> 魔兽世界 >> 插件UI >> 界面·头像 >> 文章正文


  还记得地球时代的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

来源:wowace 作者:Detake 责任编辑:六六之夜 更新时间:2008-6-14 12:51:41
 本类别推荐文章


TG兽吧魔兽世界数据库

热点新闻
编辑推荐
热点追踪
2.4.3各职业天赋模拟器
精彩视频
游戏推荐
关于我们 广告投放 联系我们 网站地图 友情链接 诚聘英才 成为会员 京ICP证070145号
Copyright 2004-2007 wow.tgbus.com Corporation, All Rights Reserved