fix: fade out sort icon when sort is in progress

This commit is contained in:
Salikh Gurgenidze
2026-01-04 22:01:33 +04:00
parent 1ceccc9875
commit 1e3561a5e0
3 changed files with 32 additions and 3 deletions
+26 -1
View File
@@ -9,6 +9,27 @@ addon.Modules.SortEngine = SortEngine
-- Flag to track if sorting is currently in progress
SortEngine.sortingInProgress = false
-- Update sort button appearance based on sorting state
function SortEngine:UpdateSortButtonState(isDisabled)
local buttons = {
getglobal("Guda_BagFrame_SortButton"),
getglobal("Guda_BankFrame_SortButton")
}
for _, btn in ipairs(buttons) do
if btn then
local icon = getglobal(btn:GetName() .. "_Icon")
if icon then
if isDisabled then
icon:SetVertexColor(0.4, 0.4, 0.4)
else
icon:SetVertexColor(0.8, 0.8, 0.8)
end
end
end
end
end
--===========================================================================
-- CONSTANTS
--===========================================================================
@@ -1406,8 +1427,9 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
return false, "already sorted"
end
-- Set sorting flag
-- Set sorting flag and update button appearance
self.sortingInProgress = true
self:UpdateSortButtonState(true)
-- Print analysis results
addon:Print("Sorting %s... (%d/%d items need sorting, estimated %d passes)",
@@ -1442,6 +1464,7 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
if GetTime() - startTime >= 0.7 then
frame:SetScript("OnUpdate", nil)
SortEngine.sortingInProgress = false
SortEngine:UpdateSortButtonState(false)
updateFrame()
end
end)
@@ -1457,6 +1480,7 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
if GetTime() - startTime >= 0.7 then
frame:SetScript("OnUpdate", nil)
SortEngine.sortingInProgress = false
SortEngine:UpdateSortButtonState(false)
updateFrame()
end
end)
@@ -1478,6 +1502,7 @@ function SortEngine:ExecuteSort(sortFunction, analyzeFunction, updateFrame, sort
if GetTime() - startTime >= 0.7 then
frame:SetScript("OnUpdate", nil)
SortEngine.sortingInProgress = false
SortEngine:UpdateSortButtonState(false)
updateFrame()
end
end)