From 2e5d7ac3d0a18f295c61a664245b9aab92e1c98e Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 22 Mar 2020 14:20:59 +0100 Subject: [PATCH] ui-widgets: delay skin arrow hooks to ooc --- api/ui-widgets.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index c10333d5..b79750d3 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -538,18 +538,20 @@ function pfUI.api.SkinArrowButton(button, dir, size) button.icon:SetTexture(pfUI.media["img:"..dir]) if not button.pfScripted then - local enable = button.Enable - local disable = button.Disable + RunOOC(function() + local enable = button.Enable + local disable = button.Disable - button.Enable = function(self) - if enable then enable(self) end - self.icon:SetVertexColor(.8,.8,.8,1) - end + button.Enable = function(self) + if enable then enable(self) end + self.icon:SetVertexColor(.8,.8,.8,1) + end - button.Disable = function(self) - if disable then disable(self) end - self.icon:SetVertexColor(.2,.2,.2,1) - end + button.Disable = function(self) + if disable then disable(self) end + self.icon:SetVertexColor(.2,.2,.2,1) + end + end) button.pfScripted = true end