/Tukui/modules/skins/achievementpopup.lua

http://github.com/Asphyxia/Tukui · Lua · 94 lines · 72 code · 17 blank · 5 comment · 13 complexity · 10c711c8580fefa4efdf9901bcbe811a MD5 · raw file

  1. local T, C, L = unpack(select(2, ...))
  2. local function LoadSkin()
  3. local function SkinAchievePopUp()
  4. for i = 1, MAX_ACHIEVEMENT_ALERTS do
  5. local frame = _G["AchievementAlertFrame"..i]
  6. if frame then
  7. frame:SetAlpha(1)
  8. frame.SetAlpha = T.dummy
  9. if not frame.backdrop then
  10. frame:CreateBackdrop("Transparent")
  11. frame.backdrop:Point("TOPLEFT", _G[frame:GetName().."Background"], "TOPLEFT", -2, -6)
  12. frame.backdrop:Point("BOTTOMRIGHT", _G[frame:GetName().."Background"], "BOTTOMRIGHT", -2, 6)
  13. end
  14. -- Background
  15. _G["AchievementAlertFrame"..i.."Background"]:SetTexture(nil)
  16. _G["AchievementAlertFrame"..i.."Glow"]:Kill()
  17. _G["AchievementAlertFrame"..i.."Shine"]:Kill()
  18. -- Text
  19. _G["AchievementAlertFrame"..i.."Unlocked"]:SetFont(C.media.font, 12)
  20. _G["AchievementAlertFrame"..i.."Unlocked"]:SetTextColor(1, 1, 1)
  21. _G["AchievementAlertFrame"..i.."Name"]:SetFont(C.media.font, 14)
  22. -- Icon
  23. _G["AchievementAlertFrame"..i.."IconTexture"]:SetTexCoord(0.08, 0.92, 0.08, 0.92)
  24. _G["AchievementAlertFrame"..i.."IconOverlay"]:Kill()
  25. _G["AchievementAlertFrame"..i.."IconTexture"]:ClearAllPoints()
  26. _G["AchievementAlertFrame"..i.."IconTexture"]:Point("LEFT", frame, 7, 0)
  27. if not _G["AchievementAlertFrame"..i.."IconTexture"].b then
  28. _G["AchievementAlertFrame"..i.."IconTexture"].b = CreateFrame("Frame", nil, _G["AchievementAlertFrame"..i])
  29. _G["AchievementAlertFrame"..i.."IconTexture"].b:SetFrameLevel(0)
  30. _G["AchievementAlertFrame"..i.."IconTexture"].b:SetTemplate("Transparent")
  31. _G["AchievementAlertFrame"..i.."IconTexture"].b:Point("TOPLEFT", _G["AchievementAlertFrame"..i.."IconTexture"], "TOPLEFT", -2, 2)
  32. _G["AchievementAlertFrame"..i.."IconTexture"].b:Point("BOTTOMRIGHT", _G["AchievementAlertFrame"..i.."IconTexture"], "BOTTOMRIGHT", 2, -2)
  33. end
  34. end
  35. end
  36. end
  37. hooksecurefunc("AchievementAlertFrame_FixAnchors", SkinAchievePopUp)
  38. function SkinDungeonPopUP()
  39. for i = 1, DUNGEON_COMPLETION_MAX_REWARDS do
  40. local frame = _G["DungeonCompletionAlertFrame"..i]
  41. if frame then
  42. frame:SetAlpha(1)
  43. frame.SetAlpha = T.dummy
  44. if not frame.backdrop then
  45. frame:CreateBackdrop("Transparent")
  46. frame.backdrop:Point("TOPLEFT", frame, "TOPLEFT", -2, -6)
  47. frame.backdrop:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 6)
  48. end
  49. -- Background
  50. for i=1, frame:GetNumRegions() do
  51. local region = select(i, frame:GetRegions())
  52. if region:GetObjectType() == "Texture" then
  53. if region:GetTexture() == "Interface\\LFGFrame\\UI-LFG-DUNGEONTOAST" then
  54. region:Kill()
  55. end
  56. end
  57. end
  58. _G["DungeonCompletionAlertFrame"..i.."Shine"]:Kill()
  59. _G["DungeonCompletionAlertFrame"..i.."GlowFrame"]:Kill()
  60. _G["DungeonCompletionAlertFrame"..i.."GlowFrame"].glow:Kill()
  61. -- Icon
  62. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"]:SetTexCoord(0.08, 0.92, 0.08, 0.92)
  63. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"]:ClearAllPoints()
  64. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"]:Point("LEFT", frame, 7, 0)
  65. if not _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"].b then
  66. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"].b = CreateFrame("Frame", nil, _G["DungeonCompletionAlertFrame"..i])
  67. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"].b:SetFrameLevel(0)
  68. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"].b:SetTemplate("Transparent")
  69. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"].b:Point("TOPLEFT", _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"], "TOPLEFT", -2, 2)
  70. _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"].b:Point("BOTTOMRIGHT", _G["DungeonCompletionAlertFrame"..i.."DungeonTexture"], "BOTTOMRIGHT", 2, -2)
  71. end
  72. end
  73. end
  74. end
  75. hooksecurefunc("DungeonCompletionAlertFrame_FixAnchors", SkinDungeonPopUP)
  76. end
  77. tinsert(T.SkinFuncs["Tukui"], LoadSkin)