PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 5ms RepoModel.GetById 15ms app.codeStats 0ms

/Tukui/modules/skins/tradeskill.lua

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