feat: rename category

This commit is contained in:
Salikh Gurgenidze
2026-01-19 17:05:30 +04:00
parent 055441eb31
commit ad8f26bca7
4 changed files with 72 additions and 18 deletions
+13 -2
View File
@@ -507,9 +507,16 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName)
headerIdx = headerIdx + 1
header:SetPoint("TOPLEFT", itemContainer, "TOPLEFT", startX + currentX, startY - currentY)
header:SetWidth(blockWidth)
-- Get display name from category definition
local displayName = catName
header.fullName = catName
if addon.Modules.CategoryManager then
local catDef = addon.Modules.CategoryManager:GetCategory(catName)
if catDef and catDef.name then
displayName = catDef.name
end
end
header.fullName = displayName
header.isShortened = false
if string.len(displayName) > 8 and numItems < 2 then
displayName = string.sub(displayName, 1, 6) .. "..."
@@ -574,6 +581,10 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName)
break
end
end
-- Also check if Empty section should show
if totalFreeSlots > 0 then
hasAnyBottom = true
end
if hasAnyBottom then
y = y - 10
+13 -2
View File
@@ -35,8 +35,19 @@ function Guda_CategorizeItem(itemData, bagID, slotID, categories, specialItems,
-- Priority 1: Special items (Hearthstone, Mounts, Tools)
-- These are handled separately and go into specialItems table, not categories
if string.find(itemName, "Hearthstone") then
table.insert(specialItems.Hearthstone, {bagID = bagID, slotID = slotID, itemData = itemData})
return
-- Only show in Home section if Home category is enabled
local showHome = true
if addon.Modules.CategoryManager then
local homeCat = addon.Modules.CategoryManager:GetCategory("Home")
if homeCat then
showHome = homeCat.enabled
end
end
if showHome then
table.insert(specialItems.Hearthstone, {bagID = bagID, slotID = slotID, itemData = itemData})
return
end
-- If Home is disabled, fall through to normal categorization
elseif addon.Modules.SortEngine and addon.Modules.SortEngine.IsMount and addon.Modules.SortEngine.IsMount(itemData.texture) then
table.insert(specialItems.Mount, {bagID = bagID, slotID = slotID, itemData = itemData})
return
+32 -11
View File
@@ -1345,17 +1345,37 @@ function Guda_SettingsPopup_CategoriesTab_Update()
row.builtInText:Hide()
end
-- Enable/disable move buttons based on position
if dataIndex == 1 then
row.upBtn:Disable()
-- Hide all controls for hideControls categories (only checkbox visible)
if categoryDef.hideControls then
row.editBtn:Hide()
row.upBtn:Hide()
row.downBtn:Hide()
row.deleteBtn:Hide()
row.builtInText:Hide()
else
row.upBtn:Enable()
end
row.editBtn:Show()
row.upBtn:Show()
row.downBtn:Show()
if dataIndex == totalCategories then
row.downBtn:Disable()
else
row.downBtn:Enable()
-- Enable/disable move buttons based on position
if dataIndex == 1 then
row.upBtn:Disable()
else
-- Check if category above has hideControls (can't move above it)
local aboveCatId = categoryOrder[dataIndex - 1]
local aboveCatDef = Guda.Modules.CategoryManager:GetCategory(aboveCatId)
if aboveCatDef and aboveCatDef.hideControls then
row.upBtn:Disable()
else
row.upBtn:Enable()
end
end
if dataIndex == totalCategories then
row.downBtn:Disable()
else
row.downBtn:Enable()
end
end
-- Set text color based on enabled state
@@ -1404,11 +1424,11 @@ function Guda_SettingsPopup_AddCategory_OnClick()
-- Create new category definition
local newDef = {
name = "New Category " .. counter,
name = "Custom " .. counter,
icon = "Interface\\Icons\\INV_Misc_QuestionMark",
rules = {},
matchMode = "any",
priority = 50,
priority = 80,
enabled = true,
isBuiltIn = false,
}
@@ -1466,6 +1486,7 @@ local RULE_TYPE_OPTIONS = {
{ id = "itemType", name = "Item Type" },
{ id = "itemSubtype", name = "Item Subtype" },
{ id = "namePattern", name = "Name Contains" },
{ id = "itemID", name = "Item ID" },
{ id = "quality", name = "Quality (exact)" },
{ id = "qualityMin", name = "Quality (min)" },
{ id = "isBoE", name = "Bind on Equip" },