From 130afe7ac420e61110c31c1157a47dd6915279d0 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 11 Nov 2008 20:05:26 +0100 Subject: [PATCH] Fixed the NormalTexture again to behave like it used to 4.1.x --- ActionButton.lua | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ActionButton.lua b/ActionButton.lua index 6e18302..7c465ac 100644 --- a/ActionButton.lua +++ b/ActionButton.lua @@ -210,14 +210,23 @@ function onUpdate(self, elapsed) end end -local function updateSpecialIcon(self) - if self.BT4init and self.action and specialButtons[self.action] then - self.icon:SetTexture(specialButtons[self.action].icon) - self.icon:Show() - self:UpdateUsable() +local function updateIcon(self) + if self.BT4init and self.action then + if specialButtons[self.action] then + self.normalTexture:SetTexCoord(0, 0, 0, 0) + self.icon:SetTexture(specialButtons[self.action].icon) + self.icon:Show() + self:UpdateUsable() + else + if GetActionTexture(self.action) then + self.normalTexture:SetTexCoord(0, 0, 0, 0) + else + self.normalTexture:SetTexCoord(-0.15, 1.15, -0.15, 1.17) + end + end end end -hooksecurefunc("ActionButton_Update", updateSpecialIcon) +hooksecurefunc("ActionButton_Update", updateIcon) Button.SetRealNormalTexture = Button.SetNormalTexture function Button:SetNormalTexture(...)