/Tukui/modules/skins/tradeskill.lua

http://github.com/Asphyxia/Tukui · Lua · 89 lines · 74 code · 14 blank · 1 comment · 6 complexity · 443d8e9d4a5c60d02827eeb132908a10 MD5 · raw file

  1. local T, C, L = unpack(select(2, ...))
  2. local function LoadSkin()
  3. TradeSkillFrame:StripTextures(true)
  4. TradeSkillListScrollFrame:StripTextures()
  5. TradeSkillDetailScrollFrame:StripTextures()
  6. TradeSkillFrameInset:StripTextures()
  7. TradeSkillExpandButtonFrame:StripTextures()
  8. TradeSkillDetailScrollChildFrame:StripTextures()
  9. TradeSkillFrame:SetTemplate("Transparent")
  10. TradeSkillFrame:CreateShadow("Transparent")
  11. TradeSkillFrame:Height(TradeSkillFrame:GetHeight() + 12)
  12. TradeSkillRankFrame:StripTextures()
  13. TradeSkillRankFrame:CreateBackdrop("Transparent")
  14. TradeSkillRankFrame:SetStatusBarTexture(C["media"].normTex)
  15. T.SkinButton(TradeSkillCreateButton, true)
  16. T.SkinButton(TradeSkillCancelButton, true)
  17. T.SkinButton(TradeSkillFilterButton, true)
  18. T.SkinButton(TradeSkillCreateAllButton, true)
  19. T.SkinButton(TradeSkillViewGuildCraftersButton, true)
  20. TradeSkillLinkButton:GetNormalTexture():SetTexCoord(0.25, 0.7, 0.37, 0.75)
  21. TradeSkillLinkButton:GetPushedTexture():SetTexCoord(0.25, 0.7, 0.45, 0.8)
  22. TradeSkillLinkButton:GetHighlightTexture():Kill()
  23. TradeSkillLinkButton:CreateBackdrop("Transparent")
  24. TradeSkillLinkButton:Size(17, 14)
  25. TradeSkillLinkButton:Point("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1)
  26. T.SkinEditBox(TradeSkillFrameSearchBox)
  27. T.SkinEditBox(TradeSkillInputBox)
  28. T.SkinNextPrevButton(TradeSkillDecrementButton)
  29. T.SkinNextPrevButton(TradeSkillIncrementButton)
  30. TradeSkillIncrementButton:Point("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0)
  31. T.SkinCloseButton(TradeSkillFrameCloseButton)
  32. local once = false
  33. hooksecurefunc("TradeSkillFrame_SetSelection", function(id)
  34. TradeSkillSkillIcon:StyleButton()
  35. if TradeSkillSkillIcon:GetNormalTexture() then
  36. TradeSkillSkillIcon:GetNormalTexture():SetTexCoord(.08, .92, .08, .92)
  37. TradeSkillSkillIcon:GetNormalTexture():ClearAllPoints()
  38. TradeSkillSkillIcon:GetNormalTexture():Point("TOPLEFT", 2, -2)
  39. TradeSkillSkillIcon:GetNormalTexture():Point("BOTTOMRIGHT", -2, 2)
  40. end
  41. TradeSkillSkillIcon:SetTemplate("Transparent")
  42. for i=1, MAX_TRADE_SKILL_REAGENTS do
  43. local button = _G["TradeSkillReagent"..i]
  44. local icon = _G["TradeSkillReagent"..i.."IconTexture"]
  45. local count = _G["TradeSkillReagent"..i.."Count"]
  46. icon:SetTexCoord(.08, .92, .08, .92)
  47. icon:SetDrawLayer("OVERLAY")
  48. if not icon.backdrop then
  49. icon.backdrop = CreateFrame("Frame", nil, button)
  50. icon.backdrop:SetFrameLevel(button:GetFrameLevel() - 1)
  51. icon.backdrop:SetTemplate("Transparent")
  52. icon.backdrop:Point("TOPLEFT", icon, "TOPLEFT", -2, 2)
  53. icon.backdrop:Point("BOTTOMRIGHT", icon, "BOTTOMRIGHT", 2, -2)
  54. end
  55. icon:SetParent(icon.backdrop)
  56. count:SetParent(icon.backdrop)
  57. count:SetDrawLayer("OVERLAY")
  58. if i > 2 and once == false then
  59. local point, anchoredto, point2, x, y = button:GetPoint()
  60. button:ClearAllPoints()
  61. button:Point(point, anchoredto, point2, x, y - 3)
  62. once = true
  63. end
  64. _G["TradeSkillReagent"..i.."NameFrame"]:Kill()
  65. end
  66. end)
  67. --Guild Crafters
  68. TradeSkillGuildFrame:StripTextures()
  69. TradeSkillGuildFrame:SetTemplate("Transparent")
  70. TradeSkillGuildFrame:Point("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19)
  71. TradeSkillGuildFrameContainer:StripTextures()
  72. TradeSkillGuildFrameContainer:SetTemplate("Transparent")
  73. T.SkinCloseButton(TradeSkillGuildFrameCloseButton)
  74. end
  75. T.SkinFuncs["Blizzard_TradeSkillUI"] = LoadSkin