WoWInterface SVN DotIt

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/DotIt/libs
    from Rev 17 to Rev 19
    Reverse comparison

Rev 17 → Rev 19

sbar.lua
1,4 → 1,4
local major = "SBar-0.1"
local major = "SBar-0.1"
local minor = 1
local DEBUG = true
local tinsert = table.insert
668,7 → 668,7
maintexture:SetWidth(f:GetWidth())
return f
end
local function createVerticalBar(data, duration, start, barheight, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture)
local function createVerticalBar(data, duration, start, barheight, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture, onhide)
local tmptime
if not scaleinfo.frame:IsShown() then
scaleinfo.frame:Show()
708,11 → 708,20
for ch in string.gmatch(string.upper(text), ".") do
-- first element
local fobj = barf:CreateFontString()
setFont(font)
setFont(fobj)
barfon[count] = fobj
fobj:SetText(ch)
if count == 0 then
fobj:SetPoint("TOPLEFT", barf, "TOPLEFT", barf:GetWidth()/2 - fobj:GetStringWidth()/2 , -1*scaleinfo.height - 5)
fobj:SetPoint("CENTER", barf, "CENTER")
if not icon then
fobj:SetPoint("TOP", barf, "TOP", 0, -1)
else
if scaleinfo.iconpos then
fobj:SetPoint("TOP", barf, "TOP", 0, -1 - scaleinfo.height)
else
fobj:SetPoint("TOP", barf, "TOP", 0, -1)
end
end
else
fobj:SetPoint("TOPLEFT", barfon[count-1], "BOTTOMLEFT", 0, 0)
end
779,10 → 788,16
else
baric:SetPoint("TOPRIGHT", barf, "TOPRIGHT", 0, 0)
end
if not icon then
 
end
if onhide then
barf:SetScript("OnHide", onhide)
end
tinsert(bars, { data = data, frame = barf, tex = bart, texg = bartg, dur = duration, start = start, pos = pos, text = barfon, icon = baric } )
end
--
local function createHorizontalBar(data, duration, start, barwidth, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture)
local function createHorizontalBar(data, duration, start, barwidth, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture, onhide)
--
local tmptime
if not scaleinfo.frame:IsShown() then
821,7 → 836,7
local barfon = barf:CreateFontString()
setFont(barfon)
barfon:SetText(text)
barfon:SetPoint("BOTTOMRIGHT", barf, "BOTTOMRIGHT", -1 * scaleinfo.height - 5 , scaleinfo.height/2 - barfon:GetStringWidth()/2)
barfon:SetPoint("CENTER", barf, "CENTER")
-- normal texture
local bart = barf:CreateTexture(nil, "BACKGROUND")
bart:SetTexture(texture or default.texture)
878,9 → 893,17
baric:SetWidth(scaleinfo.height)
if scaleinfo.iconpos then
baric:SetPoint("TOPRIGHT", barf, "TOPRIGHT", baric:GetWidth(), 0)
barfon:SetPoint("RIGHT", barf, "RIGHT", -1)
else
baric:SetPoint("TOPRIGHT", barf, "TOPRIGHT", 0, 0)
barfon:SetPoint("RIGHT", barf, "RIGHT", -1*scaleinfo.height, 0 )
end
if not icon then
barfon:SetPoint("RIGHT", barf, "RIGHT", -1)
end
if onhide then
barf:SetScript("OnHide", onhide)
end
tinsert(bars, { data = data, frame = barf, tex = bart, texg = bartg, dur = duration, start = start, pos = pos, text = barfon, icon = baric } )
end
 
991,7 → 1014,7
-- @param color The color for the positive side of the bar (color_def).
-- @param colorzero The color for the negative side of the bar (color_def).
-- @see color_def
function sbar:CreateBar(data, duration, start, text, icon, pos, color, colorzero, texture)
function sbar:CreateBar(data, duration, start, text, icon, pos, color, colorzero, texture, onhide)
argcheck(duration, 2, "number")
argcheck(start, 3, "number")
argcheck(text, 4, "string", "nil")
1000,11 → 1023,12
argcheck(color, 7, "table")
argcheck(colorzero, 8, "table")
argcheck(texture, 9, "string", "nil")
argcheck(onhide, 10, "function", "nil")
local scale
if scaleinfo.horizontal then
createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture)
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)
createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide)
end
self:UpdateFrameLevel()
end