Skip to content

Commit

Permalink
Merge pull request #213 from JerichoR/BagsRetail
Browse files Browse the repository at this point in the history
BagsRetail sorting and looting
  • Loading branch information
tukz authored Nov 24, 2024
2 parents 2e4d2ce + 52f9cf6 commit 0ae2287
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions Tukui/Modules/Inventory/BagsRetail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Bags:SkinButton(Button)
if not Button then
return
end

Button:StripTextures()
Button:CreateBackdrop()
Button.IconBorder:SetAlpha(0)
Expand All @@ -24,11 +24,11 @@ end
function Bags:SkinButtons()
local Bag = ContainerFrameCombinedBags
local Reagent = ContainerFrame6

for i, Button in Bag:EnumerateValidItems() do
Bags:SkinButton(Button)
end

for i, Button in Reagent:EnumerateValidItems() do
Bags:SkinButton(Button)
end
Expand Down Expand Up @@ -133,7 +133,7 @@ function Bags:UpdateItems()
local ItemID = Info and Info.itemID
local IsBound = Info and Info.isBound
local R, G, B

if Button.Backdrop then
if Quality then
R, G, B = C_Item.GetItemQualityColor(Quality)
Expand All @@ -143,12 +143,12 @@ function Bags:UpdateItems()
Button.Backdrop:SetBorderColor(unpack(C.General.BorderColor))
end
end

-- Quest Items
if C.Bags.IdentifyQuestItems then
Bags.QuestItem(Button)
end

-- Items Level
if C.Bags.ItemLevel then
Bags.ItemLevel(Button)
Expand All @@ -170,32 +170,32 @@ function Bags:SkinContainer()
NineSlice:SetTemplate()
NineSlice:SetFrameLevel(0)
NineSlice:CreateShadow()

CloseButton:SkinCloseButton()

Portrait:Kill()

TokensBorder:Kill()

MoneyBorder:Kill()

SearchBox:StripTextures()
SearchBox:SkinEditBox()

-- Reagent Bag
if ContainerFrame6 then
local ReagentContainer = ContainerFrame6
local ReagentNineSlice = ReagentContainer.NineSlice
local ReagentCloseButton = ReagentContainer.CloseButton
local ReagentPortrait = ContainerFrame6Portrait

ReagentNineSlice:StripTextures()
ReagentNineSlice:SetTemplate()
ReagentNineSlice:SetFrameLevel(0)
ReagentNineSlice:CreateShadow()

ReagentCloseButton:SkinCloseButton()

ReagentPortrait:Kill()
end
end
Expand All @@ -222,27 +222,26 @@ function Bags:Enable()
end

SetCVar("combinedBags", 1)

C_Container.SetInsertItemsLeftToRight(false)

if C.Bags.SortToBottom then
C_Container.SetSortBagsRightToLeft(false)
C_Container.SetInsertItemsLeftToRight(true)
else
C_Container.SetSortBagsRightToLeft(true)
C_Container.SetInsertItemsLeftToRight(false)
end

-- Create the AIO container on load
ToggleAllBags()
ToggleAllBags()

-- Start doing shit
self:AddHooks()
self:SkinContainer()
self:SkinButtons()

Movers:RegisterFrame(ContainerFrameCombinedBags, "Bags")

T.Print("The bags module is currently under development, please be patient")
end

Inventory.Bags = Bags
Inventory.Bags = Bags

0 comments on commit 0ae2287

Please sign in to comment.