PageRenderTime 74ms CodeModel.GetById 67ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Tukui/modules/skins/trade.lua

http://github.com/Asphyxia/Tukui
Lua | 81 lines | 68 code | 13 blank | 0 comment | 2 complexity | 0cbad7a18e61399c8b2e400cd31fc5cf MD5 | raw file
 1local T, C, L = unpack(select(2, ...))
 2
 3
 4local function LoadSkin()
 5	TradeFrame:StripTextures(true)
 6	TradeFrame:CreateBackdrop("Transparent")
 7	TradeFrame.backdrop:Point("TOPLEFT", 10, -4)
 8	TradeFrame.backdrop:Point("BOTTOMRIGHT", -16, 35)
 9	T.SkinButton(TradeFrameTradeButton, true)
10	T.SkinButton(TradeFrameCancelButton, true)
11	T.SkinCloseButton(TradeFrameCloseButton, TradeFrame.backdrop)
12
13	T.SkinEditBox(TradePlayerInputMoneyFrameGold)
14	T.SkinEditBox(TradePlayerInputMoneyFrameSilver)
15	T.SkinEditBox(TradePlayerInputMoneyFrameCopper)
16
17	for i=1, 7 do
18		local player = _G["TradePlayerItem"..i]
19		local recipient = _G["TradeRecipientItem"..i]
20		local player_button = _G["TradePlayerItem"..i.."ItemButton"]
21		local recipient_button = _G["TradeRecipientItem"..i.."ItemButton"]
22		local player_button_icon = _G["TradePlayerItem"..i.."ItemButtonIconTexture"]
23		local recipient_button_icon = _G["TradeRecipientItem"..i.."ItemButtonIconTexture"]
24		
25		if player_button and recipient_button then
26			player:StripTextures()
27			recipient:StripTextures()
28			player_button:StripTextures()
29			recipient_button:StripTextures()
30			
31			player_button_icon:ClearAllPoints()
32			player_button_icon:Point("TOPLEFT", player_button, "TOPLEFT", 2, -2)
33			player_button_icon:Point("BOTTOMRIGHT", player_button, "BOTTOMRIGHT", -2, 2)
34			player_button_icon:SetTexCoord(.08, .92, .08, .92)
35			player_button:SetTemplate("Transparent", true)
36			player_button:StyleButton()
37			player_button.bg = CreateFrame("Frame", nil, player_button)
38			player_button.bg:SetTemplate("Transparent")
39			player_button.bg:SetPoint("TOPLEFT", player_button, "TOPRIGHT", 4, 0)
40			player_button.bg:SetPoint("BOTTOMRIGHT", _G["TradePlayerItem"..i.."NameFrame"], "BOTTOMRIGHT", 0, 14)
41			player_button.bg:SetFrameLevel(player_button:GetFrameLevel() - 3)
42
43			recipient_button_icon:ClearAllPoints()
44			recipient_button_icon:Point("TOPLEFT", recipient_button, "TOPLEFT", 2, -2)
45			recipient_button_icon:Point("BOTTOMRIGHT", recipient_button, "BOTTOMRIGHT", -2, 2)
46			recipient_button_icon:SetTexCoord(.08, .92, .08, .92)
47			recipient_button:SetTemplate("Transparent", true)
48			recipient_button:StyleButton()
49			recipient_button.bg = CreateFrame("Frame", nil, recipient_button)
50			recipient_button.bg:SetTemplate("Transparent")
51			recipient_button.bg:SetPoint("TOPLEFT", recipient_button, "TOPRIGHT", 4, 0)
52			recipient_button.bg:SetPoint("BOTTOMRIGHT", _G["TradeRecipientItem"..i.."NameFrame"], "BOTTOMRIGHT", 0, 14)
53			recipient_button.bg:SetFrameLevel(recipient_button:GetFrameLevel() - 3)					
54			
55		end
56	end
57
58	TradeHighlightPlayerTop:SetTexture(0, 1, 0, 0.2)
59	TradeHighlightPlayerBottom:SetTexture(0, 1, 0, 0.2)
60	TradeHighlightPlayerMiddle:SetTexture(0, 1, 0, 0.2)
61	TradeHighlightPlayer:SetFrameStrata("HIGH")
62	TradeHighlightPlayer:Point("TOPLEFT", TradeFrame, "TOPLEFT", 23, -100)
63
64	TradeHighlightPlayerEnchantTop:SetTexture(0, 1, 0, 0.2)
65	TradeHighlightPlayerEnchantBottom:SetTexture(0, 1, 0, 0.2)
66	TradeHighlightPlayerEnchantMiddle:SetTexture(0, 1, 0, 0.2)
67	TradeHighlightPlayerEnchant:SetFrameStrata("HIGH")
68
69	TradeHighlightRecipientTop:SetTexture(0, 1, 0, 0.2)
70	TradeHighlightRecipientBottom:SetTexture(0, 1, 0, 0.2)
71	TradeHighlightRecipientMiddle:SetTexture(0, 1, 0, 0.2)
72	TradeHighlightRecipient:SetFrameStrata("HIGH")
73	TradeHighlightRecipient:Point("TOPLEFT", TradeFrame, "TOPLEFT", 192, -100)
74
75	TradeHighlightRecipientEnchantTop:SetTexture(0, 1, 0, 0.2)
76	TradeHighlightRecipientEnchantBottom:SetTexture(0, 1, 0, 0.2)
77	TradeHighlightRecipientEnchantMiddle:SetTexture(0, 1, 0, 0.2)
78	TradeHighlightRecipientEnchant:SetFrameStrata("HIGH")	
79end
80
81tinsert(T.SkinFuncs["Tukui"], LoadSkin)