Commit c456d13b authored by Azilroka's avatar Azilroka 💬
Browse files

Bags: Cleanup

parent 07aab9e4
......@@ -1274,6 +1274,24 @@ end
function B:SlotOnLeave() end
function B:SetButtonTexture(button, texture)
button:SetNormalTexture(texture)
button:SetPushedTexture(texture)
button:SetDisabledTexture(texture)
local Normal, Pushed, Disabled = button:GetNormalTexture(), button:GetPushedTexture(), button:GetDisabledTexture()
Normal:SetTexCoord(unpack(E.TexCoords))
Normal:SetInside()
Pushed:SetTexCoord(unpack(E.TexCoords))
Pushed:SetInside()
Disabled:SetTexCoord(unpack(E.TexCoords))
Disabled:SetInside()
Disabled:SetDesaturated(1)
end
function B:ConstructContainerFrame(name, isBank)
local strata = E.db.bags.strata or 'HIGH'
......@@ -1314,8 +1332,7 @@ function B:ConstructContainerFrame(name, isBank)
f.helpButton = CreateFrame('Button', name..'HelpButton', f, 'BackdropTemplate')
f.helpButton:Point('RIGHT', f.closeButton, 'LEFT', 0, 0)
f.helpButton:Size(16)
f.helpButton:SetNormalTexture(E.Media.Textures.Help)
f.helpButton:SetPushedTexture(E.Media.Textures.Help)
B:SetButtonTexture(f.helpButton, E.Media.Textures.Help)
f.helpButton:SetScript('OnLeave', GameTooltip_Hide)
f.helpButton:SetScript('OnEnter', function(frame)
local GameTooltip = _G.GameTooltip
......@@ -1413,16 +1430,7 @@ function B:ConstructContainerFrame(name, isBank)
f.sortButton = CreateFrame('Button', name..'SortButton', f, 'BackdropTemplate')
f.sortButton:Size(16 + E.Border, 16 + E.Border)
f.sortButton:SetTemplate()
f.sortButton:SetNormalTexture('Interface/ICONS/INV_Pet_Broom')
f.sortButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
f.sortButton:GetNormalTexture():SetInside()
f.sortButton:SetPushedTexture('Interface/ICONS/INV_Pet_Broom')
f.sortButton:GetPushedTexture():SetTexCoord(unpack(E.TexCoords))
f.sortButton:GetPushedTexture():SetInside()
f.sortButton:SetDisabledTexture('Interface/ICONS/INV_Pet_Broom')
f.sortButton:GetDisabledTexture():SetTexCoord(unpack(E.TexCoords))
f.sortButton:GetDisabledTexture():SetInside()
f.sortButton:GetDisabledTexture():SetDesaturated(1)
B:SetButtonTexture(f.sortButton, 'Interface/ICONS/INV_Pet_Broom')
f.sortButton:StyleButton(nil, true)
f.sortButton:SetScript('OnEnter', _G.BagItemAutoSortButton:GetScript('OnEnter'))
f.sortButton:SetScript('OnLeave', GameTooltip_Hide)
......@@ -1435,12 +1443,7 @@ function B:ConstructContainerFrame(name, isBank)
f.bagsButton = CreateFrame('Button', name..'BagsButton', f.holderFrame, 'BackdropTemplate')
f.bagsButton:Size(16 + E.Border, 16 + E.Border)
f.bagsButton:SetTemplate()
f.bagsButton:SetNormalTexture('Interface/Buttons/Button-Backpack-Up')
f.bagsButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
f.bagsButton:GetNormalTexture():SetInside()
f.bagsButton:SetPushedTexture('Interface/Buttons/Button-Backpack-Up')
f.bagsButton:GetPushedTexture():SetTexCoord(unpack(E.TexCoords))
f.bagsButton:GetPushedTexture():SetInside()
B:SetButtonTexture(f.bagsButton, 'Interface/Buttons/Button-Backpack-Up')
f.bagsButton:StyleButton(nil, true)
f.bagsButton.ttText = L["Toggle Bags"]
f.bagsButton.ttText2 = format('|cffFFFFFF%s|r', L["Right Click the bag icon to assign a type of item to this bag."])
......@@ -1517,12 +1520,7 @@ function B:ConstructContainerFrame(name, isBank)
f.reagentToggle:Size(16 + E.Border, 16 + E.Border)
f.reagentToggle:SetTemplate()
f.reagentToggle:Point('RIGHT', f.bagText, 'LEFT', -5, E.Border * 2)
f.reagentToggle:SetNormalTexture('Interface/ICONS/INV_Enchant_DustArcane')
f.reagentToggle:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
f.reagentToggle:GetNormalTexture():SetInside()
f.reagentToggle:SetPushedTexture('Interface/ICONS/INV_Enchant_DustArcane')
f.reagentToggle:GetPushedTexture():SetTexCoord(unpack(E.TexCoords))
f.reagentToggle:GetPushedTexture():SetInside()
B:SetButtonTexture(f.reagentToggle, 'Interface/ICONS/INV_Enchant_DustArcane')
f.reagentToggle:StyleButton(nil, true)
f.reagentToggle.ttText = L["Show/Hide Reagents"]
f.reagentToggle:SetScript('OnEnter', B.Tooltip_Show)
......@@ -1555,12 +1553,7 @@ function B:ConstructContainerFrame(name, isBank)
f.depositButton:Size(16 + E.Border, 16 + E.Border)
f.depositButton:SetTemplate()
f.depositButton:Point('RIGHT', f.sortButton, 'LEFT', -5, 0)
f.depositButton:SetNormalTexture('Interface/ICONS/misc_arrowdown')
f.depositButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
f.depositButton:GetNormalTexture():SetInside()
f.depositButton:SetPushedTexture('Interface/ICONS/misc_arrowdown')
f.depositButton:GetPushedTexture():SetTexCoord(unpack(E.TexCoords))
f.depositButton:GetPushedTexture():SetInside()
B:SetButtonTexture(f.depositButton, 'Interface/ICONS/misc_arrowdown')
f.depositButton:StyleButton(nil, true)
f.depositButton.ttText = L["Deposit Reagents"]
f.depositButton:SetScript('OnEnter', B.Tooltip_Show)
......@@ -1574,12 +1567,7 @@ function B:ConstructContainerFrame(name, isBank)
f.depositButtonBank:Size(16 + E.Border, 16 + E.Border)
f.depositButtonBank:SetTemplate()
f.depositButtonBank:Point('RIGHT', f.sortButton, 'LEFT', -5, 0)
f.depositButtonBank:SetNormalTexture('Interface/ICONS/misc_arrowdown')
f.depositButtonBank:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
f.depositButtonBank:GetNormalTexture():SetInside()
f.depositButtonBank:SetPushedTexture('Interface/ICONS/misc_arrowdown')
f.depositButtonBank:GetPushedTexture():SetTexCoord(unpack(E.TexCoords))
f.depositButtonBank:GetPushedTexture():SetInside()
B:SetButtonTexture(f.depositButtonBank, 'Interface/ICONS/misc_arrowdown')
f.depositButtonBank:StyleButton(nil, true)
f.depositButtonBank.ttText = L["Deposit Reagents"]
f.depositButtonBank:SetScript('OnEnter', B.Tooltip_Show)
......@@ -1601,12 +1589,7 @@ function B:ConstructContainerFrame(name, isBank)
f.purchaseBagButton:Size(16 + E.Border, 16 + E.Border)
f.purchaseBagButton:SetTemplate()
f.purchaseBagButton:Point('RIGHT', f.bagsButton, 'LEFT', -5, 0)
f.purchaseBagButton:SetNormalTexture('Interface/ICONS/INV_Misc_Coin_01')
f.purchaseBagButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
f.purchaseBagButton:GetNormalTexture():SetInside()
f.purchaseBagButton:SetPushedTexture('Interface/ICONS/INV_Misc_Coin_01')
f.purchaseBagButton:GetPushedTexture():SetTexCoord(unpack(E.TexCoords))
f.purchaseBagButton:GetPushedTexture():SetInside()
B:SetButtonTexture(f.purchaseBagButton, 'Interface/ICONS/INV_Misc_Coin_01')
f.purchaseBagButton:StyleButton(nil, true)
f.purchaseBagButton.ttText = L["Purchase Bags"]
f.purchaseBagButton:SetScript('OnEnter', B.Tooltip_Show)
......@@ -1662,12 +1645,7 @@ function B:ConstructContainerFrame(name, isBank)
f.vendorGraysButton:Size(16 + E.Border, 16 + E.Border)
f.vendorGraysButton:SetTemplate()
f.vendorGraysButton:Point('RIGHT', f.bagsButton, 'LEFT', -5, 0)
f.vendorGraysButton:SetNormalTexture('Interface/ICONS/INV_Misc_Coin_01')
f.vendorGraysButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
f.vendorGraysButton:GetNormalTexture():SetInside()
f.vendorGraysButton:SetPushedTexture('Interface/ICONS/INV_Misc_Coin_01')
f.vendorGraysButton:GetPushedTexture():SetTexCoord(unpack(E.TexCoords))
f.vendorGraysButton:GetPushedTexture():SetInside()
B:SetButtonTexture(f.vendorGraysButton, 'Interface/ICONS/INV_Misc_Coin_01')
f.vendorGraysButton:StyleButton(nil, true)
f.vendorGraysButton.ttText = L["Vendor / Delete Grays"]
f.vendorGraysButton.ttValue = B.GetGraysValue
......@@ -1780,15 +1758,15 @@ function B:ConstructContainerButton(f, slotID, bagID)
slot.icon:SetInside()
slot.icon:SetTexCoord(unpack(E.TexCoords))
slot.itemLevel = slot:CreateFontString(nil, 'OVERLAY', nil, 1)
slot.itemLevel = slot:CreateFontString(nil, 'ARTWORK', nil, 1)
slot.itemLevel:Point('BOTTOMRIGHT', 0, 2)
slot.itemLevel:FontTemplate(LSM:Fetch('font', E.db.bags.itemLevelFont), E.db.bags.itemLevelFontSize, E.db.bags.itemLevelFontOutline)
slot.bindType = slot:CreateFontString(nil, 'OVERLAY', nil, 1)
slot.bindType = slot:CreateFontString(nil, 'ARTWORK', nil, 1)
slot.bindType:Point('TOP', 0, -2)
slot.bindType:FontTemplate(LSM:Fetch('font', E.db.bags.itemLevelFont), E.db.bags.itemLevelFontSize, E.db.bags.itemLevelFontOutline)
slot.centerText = slot:CreateFontString(nil, 'OVERLAY', nil, 1)
slot.centerText = slot:CreateFontString(nil, 'ARTWORK', nil, 1)
slot.centerText:Point('CENTER', 0, 0)
slot.centerText:FontTemplate(LSM:Fetch('font', E.db.bags.itemLevelFont), E.db.bags.itemLevelFontSize, E.db.bags.itemLevelFontOutline)
slot.centerText:SetTextColor(0, 0.75, 0.98)
......
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