/Tukui/modules/skins/gossip.lua

http://github.com/Asphyxia/Tukui · Lua · 56 lines · 51 code · 5 blank · 0 comment · 3 complexity · 9b071fc138ee673675587bd0732ac523 MD5 · raw file

  1. local T, C, L = unpack(select(2, ...))
  2. local function LoadSkin()
  3. local StripAllTextures = {
  4. "GossipFrameGreetingPanel",
  5. }
  6. for _, object in pairs(StripAllTextures) do
  7. _G[object]:StripTextures()
  8. end
  9. T.SkinScrollBar(GossipGreetingScrollFrameScrollBar, 5)
  10. local KillTextures = {
  11. "GossipFramePortrait",
  12. }
  13. for _, texture in pairs(KillTextures) do
  14. _G[texture]:Kill()
  15. end
  16. local buttons = {
  17. "GossipFrameGreetingGoodbyeButton",
  18. }
  19. for i = 1, #buttons do
  20. _G[buttons[i]]:StripTextures()
  21. T.SkinButton(_G[buttons[i]])
  22. end
  23. for i = 1, NUMGOSSIPBUTTONS do
  24. obj = select(3,_G["GossipTitleButton"..i]:GetRegions())
  25. obj:SetTextColor(1,1,1)
  26. end
  27. GossipGreetingText:SetTextColor(1,1,1)
  28. GossipFrame:CreateBackdrop("Transparent")
  29. GossipFrame.backdrop:Point("TOPLEFT", GossipFrame, "TOPLEFT", 15, -20)
  30. GossipFrame.backdrop:Point("BOTTOMRIGHT", GossipFrame, "BOTTOMRIGHT", -30, 65)
  31. T.SkinCloseButton(GossipFrameCloseButton,GossipFrame.backdrop)
  32. --Extreme hackage, blizzard makes button text on quest frame use hex color codes for some reason
  33. hooksecurefunc("GossipFrameUpdate", function()
  34. for i=1, NUMGOSSIPBUTTONS do
  35. local button = _G["GossipTitleButton"..i]
  36. if button:GetFontString() then
  37. if button:GetFontString():GetText() and button:GetFontString():GetText():find("|cff000000") then
  38. button:GetFontString():SetText(string.gsub(button:GetFontString():GetText(), "|cff000000", "|cffFFFF00"))
  39. end
  40. end
  41. end
  42. end)
  43. end
  44. tinsert(T.SkinFuncs["Tukui"], LoadSkin)