/trunk
bar.dur = tmptime |
end |
tmptime = nil |
-- ticker |
if bar.ticker then |
local movedist |
if scaleinfo.horizontal then |
movedist = scaleinfo.frame:GetWidth() |
else |
movedist = scaleinfo.frame:GetHeight() |
end |
if bar.ticker.time <= 0 then bar.ticker.time = bar.ticker.maxtime end |
bar.ticker.time = bar.ticker.time - el |
local mpsec = (movedist - bar.ticker.icon:GetHeight()) / bar.ticker.maxtime |
bar.ticker.icon:SetPoint("BOTTOM", scaleinfo.frame, "BOTTOM", 0, bar.ticker.time*mpsec) |
end |
end |
end |
-- |
bar.tex:SetWidth(bar.tex:GetWidth() + scaleinfo.part * count + partsekinp * timeinseg) |
bar.dur = tmptime |
end |
-- ticker |
if bar.ticker then |
local movedist |
if scaleinfo.horizontal then |
movedist = scaleinfo.frame:GetWidth() |
else |
movedist = scaleinfo.frame:GetHeight() |
end |
if bar.ticker.time <= 0 then bar.ticker.time = bar.ticker.maxtime end |
bar.ticker.time = bar.ticker.time - el |
local mpsec = (movedist - bar.ticker.icon:GetWidth()) / bar.ticker.maxtime |
bar.ticker.icon:SetPoint("LEFT", scaleinfo.frame, "LEFT", bar.ticker.time*mpsec, 0) |
end |
tmptime = nil |
end |
local bar = cB({ data = data, frame = barf, tex = bart, texg = bartg, dur = duration, start = start, pos = pos, text = nil, icon = baric }) |
if text then sbar:SetText(bar, text) end |
tinsert(bars, bar) |
return bar |
end |
-- |
local function createHorizontalBar(data, duration, start, barwidth, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture, onhide) |
end |
end |
tinsert(bars, bar ) |
return bar |
end |
--*------------------------------------------- |
-- public methods |
--*------------------------------------------- |
function sbar:createTicker(bar, dur) |
if not bar then return end |
if not bar.icon then return end |
local icon = bar.frame:CreateTexture() |
icon:SetTexture(bar.icon:GetTexture()) |
icon:SetWidth(bar.icon:GetWidth()) |
icon:SetHeight(bar.icon:GetHeight()) |
if scaleinfo.horizontal then |
icon:SetPoint("LEFT", scaleinfo.frame, "LEFT", scaleinfo.frame:GetWidth() - icon:GetWidth(), 0) |
icon:SetPoint("TOP", bar.icon, "TOP") |
else |
icon:SetPoint("BOTTOM", scaleinfo.frame, "BOTTOM", scaleinfo.frame:GetHeight() - icon:GetHeight(), 0) |
icon:SetPoint("RIGHT", bar.icon, "RIGHT") |
end |
bar.ticker = {} |
bar.ticker.time = dur |
bar.ticker.icon = icon |
bar.ticker.maxtime = dur |
end |
--- Returns recycling functions which are used to create, delete and copy tables |
-- @return newList Creates a new table. Example: table = newList() |
-- @return del Deletes a table. Example: del(table) |
argcheck(texture, 9, "string", "nil") |
argcheck(onhide, 10, "function", "nil") |
local scale |
local bar |
if scaleinfo and scaleinfo.horizontal then |
createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide) |
bar = createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide) |
else |
createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide) |
bar = createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide) |
end |
self:UpdateFrameLevel() |
return bar |
end |
function sbar:SetIcon(iconpos) |
scaleinfo.iconpos = iconpos |