Change to use the UIPanel functions, where possible.
James Whitehead II [01-11-07 - 04:21]
Change to use the UIPanel functions, where possible.
diff --git a/PerfectRaid_Options.lua b/PerfectRaid_Options.lua
index 24c3825..37463a0 100644
--- a/PerfectRaid_Options.lua
+++ b/PerfectRaid_Options.lua
@@ -108,42 +108,14 @@ function Options:AddOptionsTab(title, frame)
table.insert(tabs, tab)
end
-local FADE_IN_LEN = 0.5
-local FADE_OUT_LEN = 0.2
-
-local fadeTime = 0
-FadeIn = function(frame, elapsed)
- fadeTime = fadeTime + elapsed
- if fadeTime > FADE_IN_LEN then
- frame:SetAlpha(1.0)
- frame:SetScript("OnUpdate", nil)
- frame:Show()
- fadeTime = 0
- else
- frame:SetAlpha(fadeTime / FADE_IN_LEN)
- end
-end
-
-local fadeTime = 0
-FadeOut = function(frame, elapsed)
- fadeTime = fadeTime + elapsed
- if fadeTime > FADE_OUT_LEN then
- frame:SetAlpha(0)
- frame:SetScript("OnUpdate", nil)
- frame:Hide()
- fadeTime = 0
- else
- frame:SetAlpha(1 - (fadeTime / FADE_OUT_LEN))
- end
-end
-
function Options:FadeIn(frame)
frame:Show()
- frame:SetScript("OnUpdate", FadeIn)
+ UIFrameFadeIn(frame, 0.4)
end
function Options:FadeOut(frame)
- frame:SetScript("OnUpdate", FadeOut)
+ --UIFrameFadeOut(frame, 0.2)
+ frame:Hide()
end
local tabselected
@@ -156,7 +128,7 @@ function Options:TabOnClick(tab)
self:FadeIn(tab.frame)
tabselected = tab
PanelTemplates_SetTab(PROptions, tab.idx)
- self:TriggerEvent("PERFECTRAID_TAB_CHANGED", old, tab)
+ self:TriggerMessage("PERFECTRAID_TAB_CHANGED", old, tab)
end
function Options:CreateListFrame(parent, num)