fix: mount section

This commit is contained in:
Salikh Gurgenidze
2025-12-23 21:38:45 +04:00
parent dddbbb7407
commit 1967f023e7
3 changed files with 26 additions and 25 deletions
+2 -1
View File
@@ -145,7 +145,7 @@ local function GetTexturePattern(textureName)
end
-- Check if an item is a mount by texture path
local function IsMount(itemTexture)
function SortEngine.IsMount(itemTexture)
if not itemTexture then return false end
local textureLower = string.lower(itemTexture)
@@ -158,6 +158,7 @@ local function IsMount(itemTexture)
return false
end
local IsMount = SortEngine.IsMount
-- Determine subclass order for grouping related items
local function GetSubclassOrder(subclass, itemName)
+10 -10
View File
@@ -445,14 +445,6 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName)
string.find(itemName, "Skinning Knife") or
itemName == "Blood Scythe" then
table.insert(specialItems.Tools, {bagID = bagID, slotID = slotID, itemData = itemData})
-- Split Equipment into Weapon and Armor
elseif itemData.equipSlot and itemData.equipSlot ~= "" then
if itemData.class == "Weapon" or itemData.class == "Armor" then
cat = itemData.class
else
cat = "Armor" -- Accessories etc usually fall here if equippable
end
table.insert(categories[cat], {bagID = bagID, slotID = slotID, itemData = itemData})
-- Detect Food and Drink
elseif itemData.class == "Consumable" then
local sub = itemData.subclass or ""
@@ -464,6 +456,14 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName)
end
end
table.insert(categories[cat], {bagID = bagID, slotID = slotID, itemData = itemData})
-- Split Equipment into Weapon and Armor
elseif itemData.equipSlot and itemData.equipSlot ~= "" then
if itemData.class == "Weapon" or itemData.class == "Armor" then
cat = itemData.class
else
cat = "Armor" -- Accessories etc usually fall here if equippable
end
table.insert(categories[cat], {bagID = bagID, slotID = slotID, itemData = itemData})
else
if not categories[cat] then cat = "Miscellaneous" end
table.insert(categories[cat], {bagID = bagID, slotID = slotID, itemData = itemData})
@@ -611,7 +611,7 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName)
local blockHeight = 20 + (blockRows * (buttonSize + spacing))
-- Check if it fits in current row (Inline block for bottom sections too)
if col > 0 and (col * (buttonSize + spacing)) + blockWidth + 20 > totalWidth + 5 then
if col > 0 and (col * (buttonSize + spacing)) + blockWidth > totalWidth + 5 then
col = 0
y = y - sectionMaxHeight - 5
sectionMaxHeight = 0
@@ -648,7 +648,7 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName)
end
if blockHeight > sectionMaxHeight then sectionMaxHeight = blockHeight end
col = col + blockCols + math.ceil(20 / (buttonSize + spacing))
col = col + blockCols + 1 -- Add 1 slot worth of spacing (around 40px) instead of 20px gap logic
-- If we wrapped exactly at the end of a block
if (col * (buttonSize + spacing)) >= totalWidth then
+14 -14
View File
@@ -295,6 +295,18 @@ function BankFrame:DisplayItemsByCategory(bankData, isOtherChar, charName)
return
end
-- Detect Food and Drink
if itemData.class == "Consumable" then
local sub = itemData.subclass or ""
if sub == "Food & Drink" or string.find(sub, "Food") or string.find(sub, "Drink") then
if string.find(sub, "Drink") then
cat = "Drink"
else
cat = "Food"
end
end
end
local cat = itemData.class or "Miscellaneous"
-- Force Quest category if it's a quest item (tooltip scan)
@@ -311,18 +323,6 @@ function BankFrame:DisplayItemsByCategory(bankData, isOtherChar, charName)
end
end
-- Detect Food and Drink
if itemData.class == "Consumable" then
local sub = itemData.subclass or ""
if sub == "Food & Drink" or string.find(sub, "Food") or string.find(sub, "Drink") then
if string.find(sub, "Drink") then
cat = "Drink"
else
cat = "Food"
end
end
end
if not categories[cat] then cat = "Miscellaneous" end
table.insert(categories[cat], {bagID = bagID, slotID = slotID, itemData = itemData})
end
@@ -476,7 +476,7 @@ function BankFrame:DisplayItemsByCategory(bankData, isOtherChar, charName)
local blockHeight = 20 + (blockRows * (buttonSize + spacing))
-- Check if it fits in current row (Inline block for bottom sections too)
if col > 0 and (col * (buttonSize + spacing)) + blockWidth + 20 > totalWidth + 5 then
if col > 0 and (col * (buttonSize + spacing)) + blockWidth > totalWidth + 5 then
col = 0
y = y - sectionMaxHeight - 5
sectionMaxHeight = 0
@@ -513,7 +513,7 @@ function BankFrame:DisplayItemsByCategory(bankData, isOtherChar, charName)
end
if blockHeight > sectionMaxHeight then sectionMaxHeight = blockHeight end
col = col + blockCols + math.ceil(20 / (buttonSize + spacing))
col = col + blockCols + 1 -- Add 1 slot worth of spacing (around 40px) instead of 20px gap logic
-- If we wrapped exactly at the end of a block
if (col * (buttonSize + spacing)) >= totalWidth then