/
Trade.lua
104 lines (86 loc) · 4.41 KB
/
Trade.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
local T, C, L = unpack(select(2, ...))
if C.skins.blizzard_frames ~= true then return end
----------------------------------------------------------------------------------------
-- Trade skin
----------------------------------------------------------------------------------------
local function LoadSkin()
TradeFrame:StripTextures(true)
TradeFrameInset:StripTextures()
TradePlayerItemsInset:StripTextures()
TradeRecipientItemsInset:StripTextures()
TradePlayerEnchantInset:StripTextures()
TradeRecipientEnchantInset:StripTextures()
TradePlayerInputMoneyInset:StripTextures()
TradeRecipientMoneyInset:StripTextures()
TradeRecipientMoneyBg:StripTextures()
TradeFrame:CreateBackdrop("Transparent")
TradeFrame.backdrop:Point("TOPLEFT", 0, 0)
TradeFrame.backdrop:Point("BOTTOMRIGHT", 0, 0)
TradeFrameTradeButton:SkinButton(true)
TradeFrameCancelButton:SkinButton(true)
T.SkinCloseButton(TradeFrameCloseButton, TradeFrame.backdrop)
T.SkinEditBox(TradePlayerInputMoneyFrameGold)
T.SkinEditBox(TradePlayerInputMoneyFrameSilver)
T.SkinEditBox(TradePlayerInputMoneyFrameCopper)
for i = 1, 7 do
local player = _G["TradePlayerItem"..i]
local recipient = _G["TradeRecipientItem"..i]
local player_button = _G["TradePlayerItem"..i.."ItemButton"]
local recipient_button = _G["TradeRecipientItem"..i.."ItemButton"]
local player_button_icon = _G["TradePlayerItem"..i.."ItemButtonIconTexture"]
local recipient_button_icon = _G["TradeRecipientItem"..i.."ItemButtonIconTexture"]
local player_button_count = _G["TradePlayerItem"..i.."ItemButtonCount"]
local recipient_button_count = _G["TradeRecipientItem"..i.."ItemButtonCount"]
if player_button and recipient_button then
player:StripTextures()
recipient:StripTextures()
player_button:StripTextures()
recipient_button:StripTextures()
player_button_icon:ClearAllPoints()
player_button_icon:Point("TOPLEFT", player_button, "TOPLEFT", 2, -2)
player_button_icon:Point("BOTTOMRIGHT", player_button, "BOTTOMRIGHT", -2, 2)
player_button_icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
player_button_icon:SetDrawLayer("OVERLAY")
player_button_count:SetDrawLayer("OVERLAY")
player_button:SetTemplate("Overlay", true)
player_button:StyleButton()
player_button.bg = CreateFrame("Frame", nil, player_button)
player_button.bg:SetTemplate("Overlay")
player_button.bg:SetPoint("TOPLEFT", player_button, "TOPRIGHT", 4, 0)
player_button.bg:SetPoint("BOTTOMRIGHT", _G["TradePlayerItem"..i.."NameFrame"], "BOTTOMRIGHT", 0, 14)
player_button.bg:SetFrameLevel(player_button:GetFrameLevel() - 4)
recipient_button_icon:ClearAllPoints()
recipient_button_icon:Point("TOPLEFT", recipient_button, "TOPLEFT", 2, -2)
recipient_button_icon:Point("BOTTOMRIGHT", recipient_button, "BOTTOMRIGHT", -2, 2)
recipient_button_icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
recipient_button_icon:SetDrawLayer("OVERLAY")
recipient_button_count:SetDrawLayer("OVERLAY")
recipient_button:SetTemplate("Overlay", true)
recipient_button:StyleButton()
recipient_button.bg = CreateFrame("Frame", nil, recipient_button)
recipient_button.bg:SetTemplate("Overlay")
recipient_button.bg:SetPoint("TOPLEFT", recipient_button, "TOPRIGHT", 4, 0)
recipient_button.bg:SetPoint("BOTTOMRIGHT", _G["TradeRecipientItem"..i.."NameFrame"], "BOTTOMRIGHT", 0, 14)
recipient_button.bg:SetFrameLevel(recipient_button:GetFrameLevel() - 4)
end
end
TradeHighlightPlayerTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerMiddle:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayer:SetFrameStrata("HIGH")
TradeHighlightPlayer:Point("TOPLEFT", TradeFrame, "TOPLEFT", 11, -86)
TradeHighlightPlayerEnchantTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerEnchantBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerEnchantMiddle:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerEnchant:SetFrameStrata("HIGH")
TradeHighlightRecipientTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientMiddle:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipient:SetFrameStrata("HIGH")
TradeHighlightRecipient:Point("TOPLEFT", TradeFrame, "TOPLEFT", 179, -86)
TradeHighlightRecipientEnchantTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientEnchantBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientEnchantMiddle:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientEnchant:SetFrameStrata("HIGH")
end
tinsert(T.SkinFuncs["ShestakUI"], LoadSkin)