feat: icons tab added and option to turn on/off unused item to red

This commit is contained in:
Salikh Gurgenidze
2026-01-04 21:49:13 +04:00
parent 7661625803
commit 1ceccc9875
8 changed files with 302 additions and 150 deletions
+15
View File
@@ -6,6 +6,9 @@ local addon = Guda
local SortEngine = {}
addon.Modules.SortEngine = SortEngine
-- Flag to track if sorting is currently in progress
SortEngine.sortingInProgress = false
--===========================================================================
-- CONSTANTS
--===========================================================================
@@ -1386,6 +1389,12 @@ end
--===========================================================================
function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sortType)
-- Check if sorting is already in progress
if self.sortingInProgress then
addon:Print("Sorting already in progress, please wait...")
return false, "sorting in progress"
end
-- Clear property cache at the start of a sort operation
self:ClearCache()
@@ -1397,6 +1406,9 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
return false, "already sorted"
end
-- Set sorting flag
self.sortingInProgress = true
-- Print analysis results
addon:Print("Sorting %s... (%d/%d items need sorting, estimated %d passes)",
sortType, analysis.itemsOutOfPlace, analysis.totalItems, analysis.passes)
@@ -1429,6 +1441,7 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
frame:SetScript("OnUpdate", function()
if GetTime() - startTime >= 0.7 then
frame:SetScript("OnUpdate", nil)
SortEngine.sortingInProgress = false
updateFrame()
end
end)
@@ -1443,6 +1456,7 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
frame:SetScript("OnUpdate", function()
if GetTime() - startTime >= 0.7 then
frame:SetScript("OnUpdate", nil)
SortEngine.sortingInProgress = false
updateFrame()
end
end)
@@ -1463,6 +1477,7 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
frame:SetScript("OnUpdate", function()
if GetTime() - startTime >= 0.7 then
frame:SetScript("OnUpdate", nil)
SortEngine.sortingInProgress = false
updateFrame()
end
end)