fix: performance issue

This commit is contained in:
Salikh Gurgenidze
2026-01-24 05:28:37 +04:00
parent fb63a958fb
commit cafc0f3f92
2 changed files with 80 additions and 6 deletions
+5 -1
View File
@@ -251,10 +251,14 @@ end
-- Create or get a button from the pool
function Guda_GetItemButton(parent)
-- Try to reuse existing button
-- Try to reuse existing button from same parent
for _, button in pairs(buttonPool) do
-- Skip bag slot buttons
if not button.isBagSlot and not button:IsShown() and button:GetParent() == parent then
-- Re-register with parent (itemButtons hash may have been cleared)
if Guda_RegisterItemButton then
Guda_RegisterItemButton(parent, button)
end
return button
end
end