/Tukui/modules/blizzard/timertracker.lua

http://github.com/Asphyxia/Tukui · Lua · 41 lines · 33 code · 8 blank · 0 comment · 7 complexity · f769570d5540fa07932ba010e1c7d84b MD5 · raw file

  1. local T, C, L = unpack(select(2, ...))
  2. local function SkinIt(bar)
  3. local _, originalPoint, _, _, _ = bar:GetPoint()
  4. bar:ClearAllPoints()
  5. bar:Point("TOPLEFT", originalPoint, "TOPLEFT", 2, -2)
  6. bar:Point("BOTTOMRIGHT", originalPoint, "BOTTOMRIGHT", -2, 2)
  7. for i=1, bar:GetNumRegions() do
  8. local region = select(i, bar:GetRegions())
  9. if region:GetObjectType() == "Texture" then
  10. region:SetTexture(nil)
  11. elseif region:GetObjectType() == "FontString" then
  12. region:SetFont(C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
  13. region:SetShadowColor(0,0,0,0)
  14. end
  15. end
  16. bar:SetStatusBarTexture(C["media"].blank)
  17. bar:SetStatusBarColor(170/255, 10/255, 10/255)
  18. bar.backdrop = CreateFrame("Frame", nil, bar)
  19. bar.backdrop:SetFrameLevel(0)
  20. bar.backdrop:SetTemplate("Default")
  21. bar.backdrop:SetAllPoints(originalPoint)
  22. end
  23. local function SkinBlizzTimer(self, event)
  24. for _, b in pairs(TimerTracker.timerList) do
  25. if not b["bar"].skinned then
  26. SkinIt(b["bar"])
  27. b["bar"].skinned = true
  28. end
  29. end
  30. end
  31. local load = CreateFrame("Frame")
  32. load:RegisterEvent("START_TIMER")
  33. load:SetScript("OnEvent", SkinBlizzTimer)