Fixed the NormalTexture again to behave like it used to 4.1.x

This commit is contained in:
Hendrik Leppkes
2008-11-11 20:05:26 +01:00
parent 7c53a32f18
commit 130afe7ac4
+15 -6
View File
@@ -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(...)