Commit 4def3e4c authored by Simpy's avatar Simpy 🐹
Browse files

Revert "the original skin file, doing this so i can see the difference in git :P"

This reverts commit c09fd7ed.
parent c09fd7ed
local S, E, L, V, P, G = unpack(select(2, ...))
local Skins = E:GetModule('Skins')
local AS = unpack(AddOnSkins)
if AddOnSkins.Classic then return end
if not AS:CheckAddOn('Auctionator') then return end
-- Credits: Simpy
local _G = _G
local ipairs = ipairs
local select = select
local unpack = unpack
local hooksecurefunc = hooksecurefunc
local function SkinHeaders(header, x, y)
header:Point('TOPLEFT', header:GetParent(), 'TOPLEFT', x or -20, y or -3)
header:SetPoint('TOPLEFT', header:GetParent(), 'TOPLEFT', x or -20, y or -3)
local maxHeaders = header:GetNumChildren()
for i = 1, maxHeaders do
local section = select(i, header:GetChildren())
if section then
if not section.backdrop then
if not section.Backdrop then
section:DisableDrawLayer('BACKGROUND')
section:CreateBackdrop('Transparent')
section.backdrop:Point('BOTTOMRIGHT', i < maxHeaders and -5 or 0, -2)
AS:CreateBackdrop(section)
section.Backdrop:SetPoint('BOTTOMRIGHT', i < maxHeaders and -5 or 0, -2)
end
end
end
......@@ -25,12 +24,12 @@ end
local function SkinItem(item)
if item.Icon and not item.backdrop then
item.Icon:SetTexCoord(unpack(E.TexCoords))
item:CreateBackdrop()
item.backdrop:SetAllPoints()
item.Icon:SetTexCoord(unpack(AS.TexCoords))
AS:CreateBackdrop(item)
item.Backdrop:SetAllPoints()
item.EmptySlot:Hide()
item.Icon:SetInside(item.backdrop)
Skins:HandleIconBorder(item.IconBorder, item.backdrop)
AS:SetInside(item.Icon, item.Backdrop)
--S:HandleIconBorder(item.IconBorder, item.backdrop) -- h a l p
end
end
......@@ -44,7 +43,7 @@ local function SetOutsideText(editbox, backdrop, width, height)
for i=1, editbox:GetNumRegions() do
local region = select(i, editbox:GetRegions())
if region and region:IsObjectType('FontString') then
backdrop:SetOutside(region, width, height)
--backdrop:SetOutside(region, width, height) -- h a l p
break
end
end
......@@ -56,52 +55,52 @@ local function SkinMainFrames()
local selling = _G.AuctionatorSellingFrame
local cancelling = _G.AuctionatorCancellingFrame
list:StripTextures()
list:CreateBackdrop('Transparent')
config:StripTextures()
config:CreateBackdrop('Transparent')
cancelling.ResultsListing.ScrollFrame:StripTextures()
cancelling.ResultsListing.ScrollFrame:CreateBackdrop('Transparent')
cancelling.ResultsListing.ScrollFrame:Point('TOPLEFT', cancelling.ResultsListing.HeaderContainer, 'BOTTOMLEFT', 16, -6)
selling.CurrentItemListing.ScrollFrame:Point('TOPLEFT', selling.CurrentItemListing.HeaderContainer, 'BOTTOMLEFT', -3, -4)
selling.HistoricalPriceListing.ScrollFrame:Point('TOPLEFT', selling.HistoricalPriceListing.HeaderContainer, 'BOTTOMLEFT', -3, -4)
list.ResultsListing.ScrollFrame:Point('TOPLEFT', list.ResultsListing.HeaderContainer, 'BOTTOMLEFT', 15, -4)
_G.AuctionatorShoppingListFrameBg:StripTextures()
list.ScrollList.InsetFrame:StripTextures()
list.ScrollList.InsetFrame:Point('TOPLEFT', list.ScrollList, 'TOPLEFT', 3, 0)
cancelling.HistoricalPriceInset:StripTextures()
selling.HistoricalPriceInset:StripTextures()
selling.HistoricalPriceInset:CreateBackdrop('Transparent')
selling.HistoricalPriceInset.backdrop:SetInside()
selling.HistoricalPriceInset:Point('TOPLEFT', selling.HistoricalPriceListing, 'TOPLEFT', -7, -25)
selling.HistoricalPriceInset:Point('BOTTOMRIGHT', selling.HistoricalPriceListing, 'BOTTOMRIGHT', -2, 0)
selling.CurrentItemInset:StripTextures()
selling.CurrentItemInset:CreateBackdrop('Transparent')
selling.CurrentItemInset.backdrop:SetInside()
selling.CurrentItemInset:Point('TOPLEFT', selling.CurrentItemListing, 'TOPLEFT', -7, -25)
selling.CurrentItemInset:Point('BOTTOMRIGHT', selling.CurrentItemListing, 'BOTTOMRIGHT', -2, 0)
selling.BagInset:StripTextures()
selling.BagListing.ScrollFrame:StripTextures()
selling.BagListing.ScrollFrame:CreateBackdrop('Transparent')
selling.BagListing.ScrollFrame:SetOutside(selling.BagListing)
selling.BagListing.ScrollFrame.backdrop:SetOutside(selling.BagListing, 5, 5)
Skins:HandleDropDownBox(list.ListDropdown, 250)
AS:StripTextures(list)
AS:CreateBackdrop(list)
AS:StripTextures(config)
AS:CreateBackdrop(config)
AS:StripTextures(cancelling.ResultsListing)
AS:CreateBackdrop(cancelling.ResultsListing.ScrollFrame)
cancelling.ResultsListing.ScrollFrame:SetPoint('TOPLEFT', cancelling.ResultsListing.HeaderContainer, 'BOTTOMLEFT', 16, -6)
selling.CurrentItemListing.ScrollFrame:SetPoint('TOPLEFT', selling.CurrentItemListing.HeaderContainer, 'BOTTOMLEFT', -3, -4)
selling.HistoricalPriceListing.ScrollFrame:SetPoint('TOPLEFT', selling.HistoricalPriceListing.HeaderContainer, 'BOTTOMLEFT', -3, -4)
list.ResultsListing.ScrollFrame:SetPoint('TOPLEFT', list.ResultsListing.HeaderContainer, 'BOTTOMLEFT', 15, -4)
AS:StripTextures(_G.AuctionatorShoppingListFrameBg)
AS:StripTextures(list.ScrollList.InsetFrame)
list.ScrollList.InsetFrame:SetPoint('TOPLEFT', list.ScrollList, 'TOPLEFT', 3, 0)
AS:StripTextures(cancelling.HistoricalPriceInset)
AS:StripTextures(selling.HistoricalPriceInset)
AS:CreateBackdrop(selling.HistoricalPriceInset)
AS:SetInside(selling.HistoricalPriceInset.Backdrop)
selling.HistoricalPriceInset:SetPoint('TOPLEFT', selling.HistoricalPriceListing, 'TOPLEFT', -7, -25)
selling.HistoricalPriceInset:SetPoint('BOTTOMRIGHT', selling.HistoricalPriceListing, 'BOTTOMRIGHT', -2, 0)
AS:StripTextures(selling.CurrentItemInset)
AS:CreateBackdrop(selling.CurrentItemInset)
AS:SetInside(selling.CurrentItemInset.Backdrop)
selling.CurrentItemInset:SetPoint('TOPLEFT', selling.CurrentItemListing, 'TOPLEFT', -7, -25)
selling.CurrentItemInset:SetPoint('BOTTOMRIGHT', selling.CurrentItemListing, 'BOTTOMRIGHT', -2, 0)
AS:StripTextures(selling.BagInset)
AS:StripTextures(selling.BagListing.ScrollFrame)
AS:CreateBackdrop(selling.BagListing.ScrollFrame)
AS:SetOutside(selling.BagListing.ScrollFrame, selling.BagListing)
AS:SetOutside(selling.BagListing.ScrollFrame.Backdrop, selling.BagListing, 5, 5)
AS:SkinDropDownBox(list.ListDropdown, 250)
-- handle sell item icon
SkinItem(selling.AuctionatorSaleItem.Icon)
selling.AuctionatorSaleItem.Icon.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
selling.AuctionatorSaleItem.Icon.Backdrop:SetBackdropBorderColor(unpack(AS.BorderColor))
-- handle bag item icons
hooksecurefunc(_G.AuctionatorBagItemMixin, 'SetItemInfo', SetItemInfo)
list.ListDropdown:ClearAllPoints()
list.ListDropdown:Point('TOPLEFT', list, 'TOPLEFT', 0, 50)
list.ListDropdown:SetPoint('TOPLEFT', list, 'TOPLEFT', 0, 50)
list.CreateList:ClearAllPoints()
list.CreateList:Point('LEFT', list.ListDropdown.backdrop, 'RIGHT', 5, 0)
list.CreateList:SetPoint('LEFT', list.ListDropdown.Backdrop, 'RIGHT', 5, 0)
local buttons = {
-- Shopping
......@@ -123,8 +122,8 @@ local function SkinMainFrames()
}
for _, button in ipairs(buttons) do
Skins:HandleButton(button)
button.backdrop:SetFrameLevel(button:GetFrameLevel())
AS:SkinButton(button)
--button.Backdrop:SetFrameLevel(button:GetFrameLevel()) -- h a l p
end
local scrollbars = {
......@@ -137,7 +136,7 @@ local function SkinMainFrames()
}
for _, scrollbar in ipairs(scrollbars) do
Skins:HandleScrollBar(scrollbar)
AS:SkinScrollBar(scrollbar)
end
local tabs = {
......@@ -148,7 +147,7 @@ local function SkinMainFrames()
}
for _, tab in ipairs(tabs) do
Skins:HandleTab(tab)
AS:SkinTab(tab)
end
local editboxes = {
......@@ -165,26 +164,26 @@ local function SkinMainFrames()
}
for _, editbox in ipairs(editboxes) do
Skins:HandleEditBox(editbox)
AS:SkinEditBox(editbox)
local quantity = editbox.labelText == 'Quantity'
if editbox.iconAtlas or quantity then -- Money Input (Buyout Price) and Quantity
local backdrop = editbox.backdrop -- reference it before change, so it doesnt try to use InputBox backdrop
local backdrop = editbox.Backdrop -- reference it before change, so it doesnt try to use InputBox backdrop
if quantity then
editbox = editbox.InputBox
editbox:StripTextures()
AS:StripTextures(editbox)
end
editbox:SetHeight(28)
SetOutsideText(editbox, backdrop, 6)
elseif editbox.InputBox then
editbox.InputBox:StripTextures()
editbox.backdrop:SetAllPoints(editbox.InputBox)
AS:StripTextures(editbox.InputBox)
editbox.Backdrop:SetAllPoints(editbox.InputBox)
end
end
selling.SaleItemFrame.MaxButton:ClearAllPoints()
selling.SaleItemFrame.MaxButton:Point('LEFT', selling.SaleItemFrame.Quantity.backdrop, 'RIGHT', 5, 0)
selling.SaleItemFrame.MaxButton:SetPoint('LEFT', selling.SaleItemFrame.Quantity.backdrop, 'RIGHT', 5, 0)
local headers = {
{ frame = list.ResultsListing.HeaderContainer, x = -20, y = -1 },
......@@ -204,15 +203,15 @@ local function SkinMainFrames()
-- duration radio buttons
for _, duration in ipairs(selling.AuctionatorSaleItem.Duration.radioButtons) do
if duration.RadioButton then
Skins:HandleRadioButton(duration.RadioButton)
AS:SkinRadioButton(duration.RadioButton)
end
end
-- undercut butttons
for _, child in ipairs({cancelling:GetChildren()}) do
if child.StartScanButton then
Skins:HandleButton(child.StartScanButton)
Skins:HandleButton(child.CancelNextButton)
AS:SkinButton(child.StartScanButton)
AS:SkinButton(child.CancelNextButton)
end
end
......@@ -220,9 +219,9 @@ local function SkinMainFrames()
for i=1, list.ScrollList:GetNumRegions() do
local region = select(i, list.ScrollList:GetRegions())
if region:IsObjectType('Texture') and region:GetTexture() == 3054898 then
region:StripTextures()
region:CreateBackdrop('Transparent')
region.backdrop:SetOutside(list.ScrollList.InsetFrame)
AS:StripTextures(region)
AS:CreateBackdrop(region)
AS:SetOutside(region.Backdrop, list.ScrollList.InsetFrame)
end
end
end
......@@ -242,18 +241,18 @@ local function SkinOptions()
for _, frame in ipairs(options) do
for _, child in ipairs({frame:GetChildren()}) do
if child.CheckBox then Skins:HandleCheckBox(child.CheckBox) end
if child.DropDown then Skins:HandleDropDownBox(child.DropDown) end
if child.CheckBox then AS:SkinCheckBox(child.CheckBox) end
if child.DropDown then AS:SkinDropDownBox(child.DropDown) end
if child.InputBox then
Skins:HandleEditBox(child.InputBox)
SetOutsideText(child.InputBox, child.InputBox.backdrop, 6, 6)
AS:SkinEditBox(child.InputBox)
SetOutsideText(child.InputBox, child.InputBox.Backdrop, 6, 6)
end
if child.radioButtons then
for _, duration in ipairs(child.radioButtons) do
if duration.RadioButton then
Skins:HandleRadioButton(duration.RadioButton)
AS:SkinRadioButton(duration.RadioButton)
end
end
end
......@@ -264,13 +263,13 @@ end
local function SkinExportCheckBox(frame)
local checkbox = frame and frame.CheckBox
if checkbox and not frame.isSkinned then -- isSkinned is set by HandleCheckBox
Skins:HandleCheckBox(checkbox)
AS:SkinCheckBox(checkbox)
checkbox:Size(30)
checkbox:SetSize(30, 30)
if checkbox.Label then
checkbox.Label:ClearAllPoints()
checkbox.Label:Point('LEFT', checkbox.backdrop, 'RIGHT', 8, 0)
checkbox.Label:SetPoint('LEFT', checkbox.Backdrop, 'RIGHT', 8, 0)
end
end
end
......@@ -280,30 +279,30 @@ local function SkinImportExport()
local import = _G.AuctionatorImportListFrame
local copy = _G.AuctionatorCopyTextFrame
copy:StripTextures()
import:StripTextures()
export:StripTextures()
AS:StripTextures(copy)
AS:StripTextures(import)
AS:StripTextures(export)
copy:CreateBackdrop('Transparent')
import:CreateBackdrop('Transparent')
export:CreateBackdrop('Transparent')
AS:CreateBackdrop(copy)
AS:CreateBackdrop(import)
AS:CreateBackdrop(export)
copy.ScrollFrame:StripTextures()
import.ScrollFrame:StripTextures()
export.ScrollFrame:StripTextures()
AS:StripTextures(copy)
AS:StripTextures(import)
AS:StripTextures(export)
Skins:HandleScrollBar(copy.ScrollFrame.ScrollBar)
Skins:HandleScrollBar(import.ScrollFrame.ScrollBar)
Skins:HandleScrollBar(export.ScrollFrame.ScrollBar)
AS:SkinScrollBar(copy.ScrollFrame.ScrollBar)
AS:SkinScrollBar(import.ScrollFrame.ScrollBar)
AS:SkinScrollBar(export.ScrollFrame.ScrollBar)
Skins:HandleButton(export.SelectAll)
Skins:HandleButton(export.UnselectAll)
Skins:HandleButton(export.Export)
Skins:HandleButton(import.Import)
Skins:HandleButton(copy.Close)
AS:SkinButton(export.SelectAll)
AS:SkinButton(export.UnselectAll)
AS:SkinButton(export.Export)
AS:SkinButton(import.Import)
AS:SkinButton(copy.Close)
Skins:HandleCloseButton(export.CloseDialog)
Skins:HandleCloseButton(import.CloseDialog)
AS:SkinCloseButton(export.CloseDialog)
AS:SkinCloseButton(import.CloseDialog)
hooksecurefunc(export, 'AddToPool', function(self)
SkinExportCheckBox(self.checkBoxPool[#self.checkBoxPool])
......@@ -319,32 +318,32 @@ local function SkinTextArea(frame)
frame.Middle:Hide()
frame.Right:Hide()
if not frame.backdrop then
frame:CreateBackdrop()
if not frame.Backdrop then
AS:CreateBackdrop(frame)
end
end
local function SkinItemFrame(frame)
frame:StripTextures()
frame:CreateBackdrop('Transparent')
AS:StripTextures(frame)
AS:CreateBackdrop(frame)
Skins:HandleButton(frame.Cancel)
Skins:HandleButton(frame.ResetAllButton)
Skins:HandleButton(frame.Finished)
AS:SkinButton(frame.Cancel)
AS:SkinButton(frame.ResetAllButton)
AS:SkinButton(frame.Finished)
frame.ResetAllButton:Point('TOPLEFT', frame.Cancel, 'TOPRIGHT', 3, 0)
frame.ResetAllButton:SetPoint('TOPLEFT', frame.Cancel, 'TOPRIGHT', 3, 0)
frame.FilterKeySelector:StripTextures()
frame.FilterKeySelector:CreateBackdrop()
frame.FilterKeySelector.backdrop:SetOutside(frame.FilterKeySelector.Text, 5, 5)
AS:StripTextures(frame.FilterKeySelector)
AS:CreateBackdrop(frame.FilterKeySelector)
AS:SetOutside(frame.FilterKeySelector.Backdrop, frame.FilterKeySelector.Text, 5, 5)
Skins:HandleNextPrevButton(frame.FilterKeySelector.Button)
AS:SkinArrowButton(frame.FilterKeySelector.Button)
frame.FilterKeySelector.Button:ClearAllPoints()
frame.FilterKeySelector.Button:Point('LEFT', frame.FilterKeySelector.backdrop, 'RIGHT', -1, 0)
frame.FilterKeySelector.Button:Size(20)
frame.FilterKeySelector.Button:SetPoint('LEFT', frame.FilterKeySelector.Backdrop, 'RIGHT', -1, 0)
frame.FilterKeySelector.Button:SetSize(20, 20)
Skins:HandleCheckBox(frame.SearchContainer.IsExact)
frame.SearchContainer.IsExact:Size(26)
AS:SkinCheckBox(frame.SearchContainer.IsExact)
frame.SearchContainer.IsExact:SetSize(26, 26)
local textareas = {
frame.LevelRange.MaxBox,
......@@ -372,15 +371,20 @@ local function SkinItemFrame(frame)
}
for _, resetButton in ipairs(resetButtons) do
Skins:HandleCloseButton(resetButton)
AS:SkinCloseButton(resetButton)
resetButton:SetHitRectInsets(1, 1, 1, 1)
end
end
function S:SkinAuctionator()
function AS:Auctionator(event)
SkinOptions()
SkinMainFrames()
SkinImportExport()
SkinItemFrame(_G.AuctionatorAddItemFrame)
SkinItemFrame(_G.AuctionatorEditItemFrame)
if event == 'AUCTION_HOUSE_SHOW' then
SkinMainFrames()
SkinImportExport()
SkinItemFrame(_G.AuctionatorAddItemFrame)
SkinItemFrame(_G.AuctionatorEditItemFrame)
end
end
AS:RegisterSkin('Auctionator', AS.Auctionator, 'AUCTION_HOUSE_SHOW', 'ADDON_LOADED')
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