Prevent taint in UpdateAction
This commit is contained in:
+5
-14
@@ -262,9 +262,6 @@ function Button:Update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Button:UpdateAction(force)
|
function Button:UpdateAction(force)
|
||||||
if force then
|
|
||||||
self.action = 0
|
|
||||||
end
|
|
||||||
ActionButton_UpdateAction(self)
|
ActionButton_UpdateAction(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -276,7 +273,7 @@ function Button:ToggleButtonElements()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local orig_ActionButton_UpdateHotkeys = ActionButton_UpdateHotkeys
|
orig_ActionButton_UpdateHotkeys = ActionButton_UpdateHotkeys
|
||||||
ActionButton_UpdateHotkeys = function(self, ...)
|
ActionButton_UpdateHotkeys = function(self, ...)
|
||||||
local name = self:GetName()
|
local name = self:GetName()
|
||||||
if name and name:find("^BT4Button") then
|
if name and name:find("^BT4Button") then
|
||||||
@@ -360,17 +357,11 @@ function Button:GetActionName()
|
|||||||
return format(actionTmpl, self.parent.id, self.rid)
|
return format(actionTmpl, self.parent.id, self.rid)
|
||||||
end
|
end
|
||||||
|
|
||||||
local orig_ActionButton_UpdateUsable = ActionButton_UpdateUsable
|
hooksecurefunc("ActionButton_UpdateUsable", function(self)
|
||||||
ActionButton_UpdateUsable = function(self, ...)
|
if self.BT4init then
|
||||||
local name = self:GetName()
|
self:UpdateUsable()
|
||||||
if name and name:find("^BT4Button") then
|
|
||||||
if self.BT4init then
|
|
||||||
self:UpdateUsable()
|
|
||||||
end
|
|
||||||
else
|
|
||||||
orig_ActionButton_UpdateUsable(self, ...)
|
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
|
|
||||||
function Button:UpdateUsable(force)
|
function Button:UpdateUsable(force)
|
||||||
local isUsable, notEnoughMana = IsUsableAction(self.action)
|
local isUsable, notEnoughMana = IsUsableAction(self.action)
|
||||||
|
|||||||
Reference in New Issue
Block a user