WoWInterface SVN CompactBars

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 15 to Rev 14
    Reverse comparison

Rev 15 → Rev 14

trunk/CompactBars/libs/sbar.lua
393,20 → 393,6
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
--
481,20 → 467,6
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
 
847,7 → 819,6
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)
957,7 → 928,6
end
end
tinsert(bars, bar )
return bar
end
 
 
996,27 → 966,8
--*-------------------------------------------
-- 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)
1125,14 → 1076,12
argcheck(texture, 9, "string", "nil")
argcheck(onhide, 10, "function", "nil")
local scale
local bar
if scaleinfo and scaleinfo.horizontal then
bar = createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide)
createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide)
else
bar = createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide)
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