fix: improve meat/egg sort

This commit is contained in:
Salikh Gurgenidze
2025-12-25 02:48:17 +04:00
parent 0c6f06ac61
commit f08f847071
2 changed files with 18 additions and 12 deletions
+7 -3
View File
@@ -567,10 +567,14 @@ local function AddSortKeys(items)
-- Texture pattern for grouping similar items (especially trade goods)
item.texturePattern = GetTexturePattern(itemTexture)
-- Group Trade Goods that are meats/eggs together regardless of texture
-- Group Trade Goods: meats (names ending with 'meat') before eggs
local nameLower = item.itemName and string.lower(item.itemName) or ""
if itemType == "Trade Goods" and (string.find(nameLower, "meat") or string.find(nameLower, "egg")) then
item.texturePattern = "trade_meat_egg"
if itemType == "Trade Goods" then
if string.find(nameLower, "meat$") then
item.texturePattern = "trade_meat"
elseif string.find(nameLower, "egg") then
item.texturePattern = "trade_egg"
end
end
-- Inverted values for descending sorts