/trunk/CompactBars
f:SetScript("OnMouseDown", OnDragStart) |
f:SetScript("OnMouseUp", OnDragStop) |
if CompactBars.db.profile.nevershowscale then |
if checkLog() then |
scaleinfo.part = f:GetHeight() / steps |
f:SetHeight(f:GetHeight() + scaleinfo.part * #scaleinfo.amaxtimes) |
end |
return f |
end |
local maintexture = f:CreateTexture(nil, "BACKGROUND") |
maintexture:SetTexture(texture or default.texture) |
maintexture:SetPoint("CENTER", 0, -1) |
f:SetScript("OnMouseDown", OnDragStart) |
f:SetScript("OnMouseUp", OnDragStop) |
if CompactBars.db.profile.nevershowscale then |
if checkLog() then |
scaleinfo.part = f:GetWidth() / steps |
f:SetWidth(f:GetWidth() + scaleinfo.part * #scaleinfo.amaxtimes) |
end |
return f |
end |
local maintexture = f:CreateTexture(nil, "BACKGROUND") |
--maintexture:SetTexture(texture or default.texture) |
maintexture:SetTexture(texture or default.texture) |
maintexture:SetPoint("CENTER", 0, -1) |
maintexture:SetHeight(2) |
maintexture:SetVertexColor(1, 1, 1, 1) |
font:SetText(string.sub(tostring(secforstep * i), 1, 3)) |
end |
local tex = f:CreateTexture(nil, "BACKGROUND") |
--tex:SetTexture(texture or default.texture) |
tex:SetTexture(texture or default.texture) |
tex:SetHeight(6) |
tex:SetWidth(2) |
--tex:SetVertexColor(1, 1, 1, 1) |
tex:SetVertexColor(1, 1, 1, 1) |
if not loflag then |
if i == steps then |
tex:SetPoint("BOTTOMLEFT", width -2, 16) |
font:SetText(tex) |
end |
local tex = f:CreateTexture(nil, "BACKGROUND") |
--tex:SetTexture(texture or default.texture) |
tex:SetTexture(texture or default.texture) |
tex:SetHeight(6) |
tex:SetWidth(2) |
tex:SetVertexColor(1, 1, 1, 1) |
-- @param loflag Indicates if the scale is on the left or above the bars (default is right or beneath) |
-- @param texture The texture of the scale |
-- @param locked The lock status of the bar |
function sbar:CreateScale(size, maxtime, steps, maxneg, savepos, horizontal, loflag, texture, locked, scale, height, fonts, scaletext, amaxtimes, hide, iconpos) |
function sbar:CreateScale(size, maxtime, steps, maxneg, savepos, horizontal, loflag, texture, locked, scale, height, fonts, scaletext, amaxtimes, hide, iconpos, noscale) |
argcheck(size, 1, "number") |
argcheck(maxtime, 2, "number") |
argcheck(steps, 3, "number") |
argcheck(amaxtimes, 14, "table") |
argcheck(hide, 15, "boolean", "nil") |
argcheck(iconpos, 16, "boolean", "nil") |
argcheck(noscale, 17, "boolean", "nil") |
scaleinfo = newList() |
scaleinfo.fonts = deepCopy(fonts) |
scaleinfo.scaletext = scaletext |
scaleinfo.amaxtimes = deepCopy(amaxtimes) |
scaleinfo.iconpos = iconpos |
scaleinfo.hide = hide |
DEFAULT_CHAT_FRAME:AddMessage("WHAT THE FUCK") |
if horizontal then |
scaleinfo.frame = createHorizontalScale(size, maxtime, steps, savepos, loflag, texture) |
else |
scaleinfo.frame = createVericalScale(size, maxtime, steps, savepos, loflag, texture) |
end |
DEFAULT_CHAT_FRAME:AddMessage("WHAT THE FUCK TEST") |
if not scaleinfo.frame then DEFAULT_CHAT_FRAME:AddMessage("suck it") |
else |
DEFAULT_CHAT_FRAME:AddMessage("suck i123123t") |
end |
scaleinfo.frame:SetScale(scale) |
scaleinfo.horizontal = horizontal |
scaleinfo.size = size |
end |
--- Redraws the Scale |
-- @see CreateScale |
function sbar:RedrawScale(size, maxtime, steps, maxneg, savepos, horizontal, loflag, texture, locked, scale, height, fonts, scaletext, amaxtimes, hide, iconpos) |
function sbar:RedrawScale(size, maxtime, steps, maxneg, savepos, horizontal, loflag, texture, locked, scale, height, fonts, scaletext, amaxtimes, hide, iconpos, noscale) |
if bars then |
for _, bar in pairs(bars) do |
if bar.frame then |
deepDel(fixedText) |
fixedText = nil |
fixedText = newList() |
sbar:CreateScale(size, maxtime, steps, maxneg, savepos, horizontal, loflag, texture, locked, scale, height, fonts, scaletext, amaxtimes, hide, iconpos) |
sbar:CreateScale(size, maxtime, steps, maxneg, savepos, horizontal, loflag, texture, locked, scale, height, fonts, scaletext, amaxtimes, hide, iconpos, noscale) |
end |
--*-------------------------------- |
-- only for documentation purpose |