PageRenderTime 201ms CodeModel.GetById 196ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Tukui/modules/skins/socket.lua

http://github.com/Asphyxia/Tukui
Lua | 38 lines | 34 code | 4 blank | 0 comment | 1 complexity | 3ebbb1970ad6417b216948b914b9f2f3 MD5 | raw file
 1local T, C, L = unpack(select(2, ...))
 2
 3local function LoadSkin()
 4	ItemSocketingFrame:StripTextures()
 5	ItemSocketingFrame:SetTemplate("Transparent")
 6	ItemSocketingScrollFrame:StripTextures()
 7	ItemSocketingScrollFrame:CreateBackdrop("Transparent")
 8
 9	for i = 1, MAX_NUM_SOCKETS  do
10		local button = _G["ItemSocketingSocket"..i]
11		local button_bracket = _G["ItemSocketingSocket"..i.."BracketFrame"]
12		local button_bg = _G["ItemSocketingSocket"..i.."Background"]
13		local button_icon = _G["ItemSocketingSocket"..i.."IconTexture"]
14		button:StripTextures()
15		button:StyleButton(false)
16		button:SetTemplate("Transparent", true)
17		button_bracket:Kill()
18		button_bg:Kill()
19		button_icon:SetTexCoord(.08, .92, .08, .92)
20		button_icon:ClearAllPoints()
21		button_icon:Point("TOPLEFT", 2, -2)
22		button_icon:Point("BOTTOMRIGHT", -2, 2)
23		ItemSocketingFrame:HookScript("OnUpdate", function(self)
24			gemColor = GetSocketTypes(i)
25			local color = GEM_TYPE_INFO[gemColor]
26			button:SetBackdropColor(color.r, color.g, color.b, 0.15)
27			button:SetBackdropBorderColor(color.r, color.g, color.b)
28		end)
29	end
30	
31	ItemSocketingFramePortrait:Kill()
32	ItemSocketingSocketButton:ClearAllPoints()
33	ItemSocketingSocketButton:Point("BOTTOMRIGHT", ItemSocketingFrame, "BOTTOMRIGHT", -5, 5)
34	T.SkinButton(ItemSocketingSocketButton)
35	T.SkinCloseButton(ItemSocketingCloseButton)
36end
37
38T.SkinFuncs["Blizzard_ItemSocketingUI"] = LoadSkin