--*------------------------------------------- |
-- public methods |
--*------------------------------------------- |
function sbar:RemoveMarkers() |
for _, marker in pairs(markers) do |
marker:Hide() |
marker = nil |
end |
deepDel(markers) |
markers = newList() |
end |
function sbar:CreateMarker(point) |
argcheck(point, 1, "number") |
if not scaleinfo.frame then return end |
local maxpos = (getMaxPos() or -1) + 1 |
local f = CreateFrame("Frame", nil, scaleinfo.frame) |
if scaleinfo.horizontal then |
f:SetHeight(scaleinfo.height * maxpos) |
f:SetWidth(1) |
local sekinp = scaleinfo.frame:GetWidth() / scaleinfo.maxtime |
if not scaleinfo.loflag then |
f:SetPoint("BOTTOMLEFT", scaleinfo.frame, "TOPLEFT", sekinp*point, -8) |
else |
f:SetPoint("TOPLEFT", scaleinfo.frame, "BOTTOMLEFT", sekinp*point, 8) |
end |
|
else |
local sekinp = scaleinfo.frame:GetHeight() / scaleinfo.maxtime |
if not loflag then |
barf:SetPoint("BOTTOMRIGHT", scaleinfo.frame, "BOTTOMLEFT", 8, sekinp*point) |
else |
barf:SetPoint("BOTTOMLEFT", scaleinfo.frame, "BOTTOMRIGHT", -8, sekinp*point) |
end |
f:SetWidth(maxpos * scaleinfo.height) |
f:SetHeight(1) |
end |
local tex = f:CreateTexture(nil, "BACKGROUND") |
|
|
tex:SetTexture(scaleinfo.texture or default.texture) |
tex:SetVertexColor(1, 1, 1, 1) |
tex:SetWidth(f:GetWidth()) |
tex:SetHeight(f:GetHeight()) |
tex:SetAllPoints(f) |
f:SetFrameLevel(100) |
|
tinsert(markers, f) |
end |
function sbar:UpdateMarkers() |
if not getMaxPos() then return end |
local maxpos = getMaxPos() + 1 |
|
for _, marker in pairs(markers) do |
if scaleinfo.horizontal then |
marker:SetHeight(scaleinfo.height * maxpos) |
else |
marker:SetWidth(maxpos * scaleinfo.height) |
end |
end |
end |
function sbar:createTicker(bar, dur) |
if not bar then return end |
if not bar.icon then return end |