Originally Posted by Irongunner
I would also be interested in some info on how to style the battleground countdown-to-start timer, does someone have a hint?
|
Choonster from the WoW Macro & UI forum finally did get this figured out after a few attempts.
Find the following code around line 570 in lib.lua:
Lua Code:
lib.gen_mirrorcb = function(f)
for _, bar in pairs({'MirrorTimer1','MirrorTimer2','MirrorTimer3',}) 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', MirrorTimer1StatusBar, 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 replace it with this:
Lua Code:
local function SkinBar(barName)
local bar;
if type(barName) == "string" then
bar = _G[barName]
else
bar = barName
barName = bar:GetName()
end
bar:SetParent(UIParent)
bar:SetScale(1)
bar:SetHeight(16)
bar:SetWidth(280)
bar:SetBackdropColor(0.1, 0.1, 0.1)
for _, region in pairs({ bar:GetRegions() }) do
if region.GetTexture and region:GetTexture() == "SolidTexture" then
region:Hide()
end
end
local border = _G[barName.."Border"] or _G[barName.."StatusBarBorder"]
border:Hide()
local background = (bar.bar or bar):CreateTexture(barName.."Background", "BACKGROUND")
background:SetTexture(cfg.statusbar_texture)
background:SetAllPoints(bar)
background:SetVertexColor(.15,.15,.15,.75)
local statusbar = _G[barName.."StatusBar"]
statusbar:SetAllPoints(bar)
local text = _G[barName.."Text"] or _G[barName .."StatusBarTimeText"]
text:SetFont(cfg.font, 14, "THINOUTLINE")
text:ClearAllPoints()
text:SetPoint("CENTER", statusbar, 0, 1)
local glow = CreateFrame("Frame", nil, (bar.bar or bar))
glow:SetFrameLevel(0)
glow:SetPoint("TOPLEFT", -5, 5)
glow:SetPoint("BOTTOMRIGHT", 5, -5)
lib.gen_backdrop(glow)
end
-- mirror castbar!
lib.gen_mirrorcb = function(f)
for _, barName in pairs({"MirrorTimer1", "MirrorTimer2", "MirrorTimer3"}) do
SkinBar(barName)
end
end
-- timers
TimerTracker:HookScript("OnEvent", function(self, event, ...)
if event == "START_TIMER" then
for i, timer in ipairs(self.timerList) do
SkinBar(timer)
end
end
end)
Thanks again to everyone who was willing to give an attempt at helping me with this.