skin: add TradeFrame

This commit is contained in:
Artur Morozov
2019-03-31 14:59:21 +02:00
committed by shagu
parent 68b14daed8
commit b2fc46c984
3 changed files with 51 additions and 1 deletions
-1
View File
@@ -1,7 +1,6 @@
pfUI:RegisterModule("skin", function ()
-- movable default frames
EnableMovable("TradeFrame")
EnableMovable("DressUpFrame")
EnableMovable("ClassTrainerFrame", "Blizzard_TrainerUI")
+1
View File
@@ -70,6 +70,7 @@ skins\blizzard\keybindings.lua
skins\blizzard\merchant.lua
skins\blizzard\popup_dialogs.lua
skins\blizzard\stable.lua
skins\blizzard\trade.lua
# modules
modules\gui.lua
+50
View File
@@ -0,0 +1,50 @@
pfUI:RegisterSkin("TradeFrame", function ()
local border = tonumber(pfUI_config.appearance.border.default)
local bpad = border > 1 and border - 1 or 1
StripTextures(TradeFrame)
CreateBackdrop(TradeFrame, nil, nil, .75)
TradeFrame.backdrop:SetPoint("TOPLEFT", 8, -20)
TradeFrame.backdrop:SetPoint("BOTTOMRIGHT", -16, 30)
TradeFrame:SetHitRectInsets(8,16,20,30)
EnableMovable(TradeFrame)
SkinCloseButton(TradeFrameCloseButton, TradeFrame.backdrop, -6, -6)
TradeFrame:DisableDrawLayer("BACKGROUND")
TradeFramePlayerNameText:ClearAllPoints()
TradeFramePlayerNameText:SetPoint("TOPLEFT", TradeFrame.backdrop, "TOPLEFT", 60, -20)
TradeFrameRecipientNameText:ClearAllPoints()
TradeFrameRecipientNameText:SetPoint("TOPRIGHT", TradeFrame.backdrop, "TOPRIGHT", -60, -20)
for i = 1, MAX_TRADE_ITEMS do
local PlayerButton = _G["TradePlayerItem"..i]
StripTextures(PlayerButton)
CreateBackdrop(PlayerButton, nil, nil, .75)
local PlayerItemButton = _G["TradePlayerItem"..i.."ItemButton"]
StripTextures(PlayerItemButton)
SkinButton(PlayerItemButton, nil, nil, nil, _G[PlayerItemButton:GetName()..'IconTexture'])
local RecipientButton = _G["TradeRecipientItem"..i]
StripTextures(RecipientButton)
CreateBackdrop(RecipientButton, nil, nil, .75)
local RecipientItemButton = _G["TradeRecipientItem"..i.."ItemButton"]
StripTextures(RecipientItemButton)
SkinButton(RecipientItemButton)
end
hooksecurefunc("TradeFrame_UpdateTargetItem", function(id)
HandleIcon(_G["TradeRecipientItem"..id.."ItemButton"], _G["TradeRecipientItem"..id..'IconTexture'])
end, 1)
SkinMoneyInputFrame(TradePlayerInputMoneyFrame)
SkinButton(TradeFrameCancelButton)
TradeFrameCancelButton:ClearAllPoints()
TradeFrameCancelButton:SetPoint("BOTTOMRIGHT", TradeFrame.backdrop, -10, 10)
SkinButton(TradeFrameTradeButton)
TradeFrameTradeButton:ClearAllPoints()
TradeFrameTradeButton:SetPoint("RIGHT", TradeFrameCancelButton, "LEFT", -2*bpad, 0)
end)