stable: capture per-iteration button in Enable/Disable closures

Lua 5.0 shares the generic-for loop variable across iterations, so the
closures all saw the final (nil) value.
This commit is contained in:
Brues
2026-10-25 12:12:05 -05:00
parent bd7bf3f39f
commit df21f1f26c
+7 -6
View File
@@ -35,13 +35,14 @@ pfUI:RegisterSkin("Pet Stable Master", function ()
StripTextures(button)
SkinButton(button, nil, nil, nil, _G[button:GetName().."IconTexture"])
button.Enable = function()
button:SetBackdropColor()
button.locked = false
local b = button
b.Enable = function()
b:SetBackdropColor()
b.locked = false
end
button.Disable = function()
button:SetBackdropColor(1, .1, .1, .3)
button.locked = true
b.Disable = function()
b:SetBackdropColor(1, .1, .1, .3)
b.locked = true
end
end