mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user