Are you sure your panel is called "OpenButton"? The FetchFrame return seems to be nil.
Code:
local frame = kgPanels:FetchFrame("OpenButton")
if MouseIsOver( frame ) then
self.text:SetTextColor(1,1,1)
UI_OpenButtonTextAlpha = 1
else
if UI_OpenButtonTextAlpha > 0 then
self.text:SetTextColor(1,1,1,UI_OpenButtonTextAlpha)
if UI_OpenButtonTextAlpha < 0 then
UI_OpenButtonTextAlpha = 0
else
UI_OpenButtonTextAlpha= UI_OpenButtonTextAlpha - 0.1
end
end
end
The underlined part will never fire (UI_OpenButtonTextAlpha cannot be below and above zero at the same time).
Also, you use some unnecessary globals and doing a perpetous OnUpdate is not efficient. This is a more efficient version I made up for you:
OnLoad:
Code:
Recount_MainWindow:Hide()
self.updateFrame = CreateFrame("Frame",nil,self)
self.updateFrame:Hide()
self.updateFrame.parent = self
self.updateFrame:SetScript("OnUpdate",function(s)
if s.textAlpha > 0 then
s.parent.text:SetTextColor(1,1,1,s.textAlpha)
s.textAlpha = s.textAlpha-0.1
else
s:Hide()
end
end)
OnEnter:
Code:
self.updateFrame.textAlpha = 1
self.text:SetTextColor(1,1,1)
OnLeave:
Code:
self.updateFrame:Show()
Should do essentially the same with less resources used.