Commit ef763696 authored by Azilroka's avatar Azilroka

Mail & Merchant

parent 5a2c5180
local AS = unpack(AddOnSkins)
local AS = unpack(AddOnSkins)
function AS:Blizzard_Mail(event, addon)
AS:SkinFrame(MailFrame, nil, nil, true)
AS:CreateShadow(MailFrame)
AS:SkinCloseButton(MailFrameCloseButton)
AS:StripTextures(MailFrameInset)
AS:SkinCloseButton(MailFrame.CloseButton)
AS:StripTextures(MailFrame.Inset)
AS:StripTextures(InboxFrame)
for i = 1, 7 do
AS:SkinFrame(_G["MailItem"..i])
AS:SkinFrame(_G["MailItem"..i.."Button"])
AS:StyleButton(_G["MailItem"..i.."Button"])
AS:SkinTexture(_G["MailItem"..i.."ButtonIcon"])
_G["MailItem"..i.."ButtonIcon"]:SetInside()
for Attachment, Num in pairs({ ["SendMailAttachment"] = 16, ["OpenMailAttachmentButton"] = 16, ['MailItem'] = 7 }) do
for i = 1, Num do
local Frame = _G[Attachment..i]
AS:SkinFrame(Frame)
if Frame.Button then
AS:SkinFrame(Frame.Button)
AS:StyleButton(Frame.Button)
AS:SkinTexture(Frame.Button.Icon)
Frame.Button.Icon:SetInside()
Frame.Button.IconBorder:SetAlpha(0)
else
Frame.IconBorder:SetAlpha(0)
if Frame.icon then
AS:SkinTexture(Frame.icon)
Frame.icon:SetInside()
end
end
hooksecurefunc((Frame.Button and Frame.Button.IconBorder or Frame.IconBorder), 'SetVertexColor', function(self, r, g, b) (Frame.Button or Frame):SetBackdropBorderColor(r, g, b) end)
hooksecurefunc((Frame.Button and Frame.Button.IconBorder or Frame.IconBorder), 'Hide', function(self) (Frame.Button or Frame):SetBackdropBorderColor(unpack(AS.BorderColor)) end)
end
end
AS:SkinNextPrevButton(InboxPrevPageButton)
AS:SkinNextPrevButton(InboxNextPageButton)
AS:StripTextures(MailFrameTab1)
AS:StripTextures(MailFrameTab2)
AS:SkinTab(MailFrameTab1)
AS:SkinTab(MailFrameTab2)
AS:StripTextures(SendMailFrame)
AS:SkinFrame(SendMailScrollFrame, nil, nil, true)
AS:SkinScrollBar(SendMailScrollFrameScrollBar)
AS:SkinScrollBar(SendMailScrollFrame.ScrollBar)
AS:SkinEditBox(SendMailNameEditBox, nil, 20)
AS:SkinEditBox(SendMailSubjectEditBox)
......@@ -35,7 +52,6 @@ function AS:Blizzard_Mail(event, addon)
AS:SkinEditBox(SendMailMoneyCopper)
AS:StripTextures(SendMailMoneyBg)
AS:StripTextures(SendMailMoneyInset)
AS:StripTextures(SendMailFrame)
AS:SkinButton(SendMailMailButton)
AS:SkinButton(SendMailCancelButton)
......@@ -50,31 +66,20 @@ function AS:Blizzard_Mail(event, addon)
AS:SkinButton(OpenMailCancelButton)
AS:SkinButton(OpenAllMail)
AS:StripTextures(OpenMailScrollFrame, true)
AS:SetTemplate(OpenMailScrollFrame, 'Default')
AS:SkinScrollBar(OpenMailScrollFrameScrollBar)
AS:SkinFrame(OpenMailScrollFrame, nil, nil, true)
AS:SkinScrollBar(OpenMailScrollFrame.ScrollBar)
SendMailBodyEditBox:SetTextColor(1, 1, 1)
OpenMailBodyText:SetTextColor(1, 1, 1)
InvoiceTextFontNormal:SetTextColor(1, 1, 1)
OpenMailArithmeticLine:Kill()
AS:StripTextures(OpenMailLetterButton)
AS:SetTemplate(OpenMailLetterButton, 'Default', true)
AS:StyleButton(OpenMailLetterButton)
AS:SkinTexture(OpenMailLetterButtonIconTexture)
OpenMailLetterButtonIconTexture:ClearAllPoints()
OpenMailLetterButtonIconTexture:SetPoint("TOPLEFT", 2, -2)
OpenMailLetterButtonIconTexture:SetPoint("BOTTOMRIGHT", -2, 2)
AS:StripTextures(OpenMailMoneyButton)
AS:SetTemplate(OpenMailMoneyButton, 'Default', true)
AS:StyleButton(OpenMailMoneyButton)
AS:SkinTexture(OpenMailMoneyButtonIconTexture)
OpenMailMoneyButtonIconTexture:ClearAllPoints()
OpenMailMoneyButtonIconTexture:SetPoint("TOPLEFT", 2, -2)
OpenMailMoneyButtonIconTexture:SetPoint("BOTTOMRIGHT", -2, 2)
AS:SkinButton(OpenMailLetterButton)
AS:SkinTexture(OpenMailLetterButton.icon)
OpenMailLetterButton.icon:SetInside()
AS:SkinButton(OpenMailMoneyButton)
AS:SkinTexture(OpenMailMoneyButton.icon)
OpenMailMoneyButton.icon:SetInside()
OpenMailReplyButton:SetPoint("RIGHT", OpenMailDeleteButton, "LEFT", -2, 0)
OpenMailDeleteButton:SetPoint("RIGHT", OpenMailCancelButton, "LEFT", -2, 0)
......@@ -83,66 +88,8 @@ function AS:Blizzard_Mail(event, addon)
AS:SkinRadioButton(SendMailSendMoneyButton)
AS:SkinRadioButton(SendMailCODButton)
for _, Attachment in pairs({"SendMailAttachment", "OpenMailAttachmentButton"}) do
for i = 1, ATTACHMENTS_MAX_SEND do
local Button = _G[Attachment..i]
AS:SkinFrame(Button)
AS:StyleButton(Button)
if _G[Attachment..i.."IconTexture"] then
AS:SkinTexture(_G[Attachment..i.."IconTexture"])
_G[Attachment..i.."IconTexture"]:SetInside()
end
end
end
hooksecurefunc("InboxFrame_Update", function()
local numItems, totalItems = GetInboxNumItems()
local index = ((InboxFrame.pageNum - 1) * INBOXITEMS_TO_DISPLAY) + 1
for i = 1, INBOXITEMS_TO_DISPLAY do
if ( index <= numItems ) then
local packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, itemCount, wasRead, x, y, z, isGM, firstItemQuantity = GetInboxHeaderInfo(index)
_G["MailItem"..i.."Button"]:SetBackdropBorderColor(unpack(AS.BorderColor))
if ( packageIcon ) and ( not isGM ) then
local ItemLink = GetInboxItemLink(index, 1)
if ItemLink then
local Quality = select(3, GetItemInfo(ItemLink))
if Quality and Quality > 1 and BAG_ITEM_QUALITY_COLORS[Quality] then
_G["MailItem"..i.."Button"]:SetBackdropBorderColor(BAG_ITEM_QUALITY_COLORS[Quality].r, BAG_ITEM_QUALITY_COLORS[Quality].g, BAG_ITEM_QUALITY_COLORS[Quality].b)
end
end
elseif isGM then
_G["MailItem"..i.."Button"]:SetBackdropBorderColor(BAG_ITEM_QUALITY_COLORS[3].r, BAG_ITEM_QUALITY_COLORS[3].g, BAG_ITEM_QUALITY_COLORS[3].b)
end
end
end
end)
hooksecurefunc('OpenMailFrame_UpdateButtonPositions', function(letterIsTakeable, textCreated, stationeryIcon, money)
for i = 1, ATTACHMENTS_MAX_RECEIVE do
local ItemLink = GetInboxItemLink(InboxFrame.openMailID, i)
local AttachmentButton = _G["OpenMailAttachmentButton"..i]
AttachmentButton:SetBackdropBorderColor(unpack(AS.BorderColor))
if ItemLink then
local Quality = select(3, GetItemInfo(ItemLink))
if Quality and Quality > LE_ITEM_QUALITY_COMMON and BAG_ITEM_QUALITY_COLORS[Quality] then
AttachmentButton:SetBackdropBorderColor(BAG_ITEM_QUALITY_COLORS[Quality].r, BAG_ITEM_QUALITY_COLORS[Quality].g, BAG_ITEM_QUALITY_COLORS[Quality].b)
end
end
end
end)
hooksecurefunc("SendMailFrame_Update", function()
for i = 1, ATTACHMENTS_MAX_SEND do
local ItemLink = GetSendMailItemLink(i)
local AttachmentButton = _G["SendMailAttachment"..i]
AttachmentButton:SetBackdropBorderColor(unpack(AS.BorderColor))
if ItemLink then
local Quality = select(3, GetItemInfo(ItemLink))
if Quality and Quality > LE_ITEM_QUALITY_COMMON and BAG_ITEM_QUALITY_COLORS[Quality] then
AttachmentButton:SetBackdropBorderColor(BAG_ITEM_QUALITY_COLORS[Quality].r, BAG_ITEM_QUALITY_COLORS[Quality].g, BAG_ITEM_QUALITY_COLORS[Quality].b)
end
end
local Texture = _G["SendMailAttachment"..i]:GetNormalTexture()
if Texture then
AS:SkinTexture(Texture)
......
......@@ -2,6 +2,7 @@ local AS = unpack(AddOnSkins)
function AS:Blizzard_Merchant()
AS:SkinFrame(MerchantFrame, nil, nil, true)
AS:SkinCloseButton(MerchantFrame.CloseButton)
AS:StripTextures(MerchantFrameInset)
AS:StripTextures(MerchantMoneyBg)
......@@ -48,24 +49,19 @@ function AS:Blizzard_Merchant()
hooksecurefunc(MerchantBuyBackItem.ItemButton.IconBorder, 'SetVertexColor', function(self, r, g, b) MerchantBuyBackItem.ItemButton:SetBackdropBorderColor(r, g, b) end)
hooksecurefunc(MerchantBuyBackItem.ItemButton.IconBorder, 'Hide', function(self) MerchantBuyBackItem.ItemButton:SetBackdropBorderColor(unpack(AS.BorderColor)) end)
AS:StyleButton(MerchantRepairItemButton)
AS:SetTemplate(MerchantRepairItemButton, 'Default', true)
AS:SkinButton(MerchantRepairItemButton)
MerchantRepairItemButton:GetRegions():SetTexCoord(0.04, 0.24, 0.06, 0.5)
MerchantRepairItemButton:GetRegions():SetInside()
AS:StyleButton(MerchantGuildBankRepairButton)
AS:SetTemplate(MerchantGuildBankRepairButton, 'Default', true)
AS:SkinButton(MerchantGuildBankRepairButton)
MerchantGuildBankRepairButtonIcon:SetTexCoord(0.61, 0.82, 0.1, 0.52)
MerchantGuildBankRepairButtonIcon:SetInside()
AS:StyleButton(MerchantRepairAllButton)
AS:SetTemplate(MerchantRepairAllButton, 'Default', true)
AS:SkinButton(MerchantRepairAllButton)
MerchantRepairAllIcon:SetTexCoord(0.34, 0.1, 0.34, 0.535, 0.535, 0.1, 0.535, 0.535)
MerchantRepairAllIcon:SetInside()
-- Skin misc frames
MerchantFrame:SetWidth(345)
AS:SkinCloseButton(MerchantFrameCloseButton)
AS:SkinNextPrevButton(MerchantNextPageButton)
AS:SkinNextPrevButton(MerchantPrevPageButton)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment