The last post I made didn't work. I also tried to copy the entire chunk of code and rename the MirrorTimer parts to TimerTrackerTimer like so:
Lua Code:
-- timer tracker!
lib.gen_timertracker = function(f)
for _, bar in pairs({'TimerTrackerTimer1','TimerTrackerTimer2','TimerTrackerTimer3','TimerTrackerTimer4','TimerTrackerTimer5'}) do
for i, region in pairs({_G[bar]:GetRegions()}) do
if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
region:Hide()
end
end
_G[bar..'Border']:Hide()
_G[bar]:SetParent(UIParent)
_G[bar]:SetScale(1)
_G[bar]:SetHeight(16)
_G[bar]:SetWidth(280)
_G[bar]:SetBackdropColor(.1,.1,.1)
_G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
_G[bar..'Background']:SetTexture(cfg.statusbar_texture)
_G[bar..'Background']:SetAllPoints(bar)
_G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
_G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
_G[bar..'Text']:ClearAllPoints()
_G[bar..'Text']:SetPoint('CENTER', TimerTrackerTimer1StatusBar, 0, 1)
_G[bar..'StatusBar']:SetAllPoints(_G[bar])
--glowing borders
local h = CreateFrame("Frame", nil, _G[bar])
h:SetFrameLevel(0)
h:SetPoint("TOPLEFT",-5,5)
h:SetPoint("BOTTOMRIGHT",5,-5)
lib.gen_backdrop(h)
end
end
And then add lib.gen_timertracker(self) right next to where lib.gen_mirrorcb(self) is in
core.lua. That didn't work either and broke the target and targettarget frame of oUF_Fail. I recruited someone in an IRC channel who knows ~20% more Lua than I do (not much) and he couldn't figure it out either. He did point me towards a section of
Skinner which skins the mirror castbar and battleground countdown timer like so:
Lua Code:
function aObj:MirrorTimers()
if not self.db.profile.MirrorTimers.skin or self.initialized.MirrorTimers then return end
self.initialized.MirrorTimers = true
self:add2Table(self.uiKeys2, "MirrorTimers")
local objBG, objSB
for i = 1, MIRRORTIMER_NUMTIMERS do
objName = "MirrorTimer"..i
obj = _G[objName]
objBG = self:getRegion(obj, 1)
objSB = _G[objName.."StatusBar"]
self:removeRegions(obj, {3})
obj:SetHeight(obj:GetHeight() * 1.25)
self:moveObject{obj=_G[objName.."Text"], y=-2}
objBG:SetWidth(objBG:GetWidth() * 0.75)
objSB:SetWidth(objSB:GetWidth() * 0.75)
if self.db.profile.MirrorTimers.glaze then
self:glazeStatusBar(objSB, 0, objBG)
end
end
-- Battleground/Arena Start Timer (4.1)
local function skinTT(tT)
-- aObj:Debug("skinTT: [%s, %s]", tT, #tT.timerList)
for _, timer in pairs(tT.timerList) do
-- aObj:Debug("skinTT#2: [%s]", timer)
if not aObj.sbGlazed[timer.bar] then
local bg = aObj:getRegion(timer.bar, 1)
_G[timer.bar:GetName().."Border"]:SetTexture(nil) -- animations
aObj:glazeStatusBar(timer.bar, 0, bg)
aObj:moveObject{obj=bg, y=2} -- align bars
end
end
end
self:SecureHookScript(TimerTracker, "OnEvent", function(this, event, ...)
-- self:Debug("TT_OE: [%s, %s]", this, event)
if event == "START_TIMER" then
skinTT(this)
end
end)
-- skin existing timers
skinTT(TimerTracker)
end
Looking at that I'm really not sure where to go from there.