View Single Post
09-24-12, 02:38 PM   #7
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Be3f. View Post
Thanks for both of your responses. So if I understand this correctly, would I have to do something like SLDT_Clock:Hide() / SLDT_Clock:Show() aswell?
You'll have to either check for alpha, or use the 'fadeinfo' parameter that's available with UIFrameFadeIn(Out) and use its 'finishedFunc' to hide the frame after fading.

Example would be place with the OnLoad for that frame:
Lua Code:
  1. self.fadeIn = {
  2.     mode = "IN",
  3.     timeToFade = 1,
  4.     startAlpha = 0,
  5.     endAlpha = 1,
  6.     finishedFunc = function()
  7.         print("Fade in finished");
  8.     end
  9. }
  10.  
  11. self.fadeOut = {
  12.     mode = "OUT",
  13.     timeToFade = 1,
  14.     startAlpha = 1,
  15.     endAlpha = 0,
  16.     finishedFunc = function()
  17.         SLDT_Clock:Hide(); -- Hide the frame after fading out.
  18.     end
  19. }

Then OnClick would be:
Lua Code:
  1. if pressed then
  2.    if SLDT_Clock:IsShown() then
  3.       UIFrameFadeOut(SLDT_Clock, self.fadeOut)
  4.    else
  5.       UIFrameFadeIn(SLDT_Clock, self.fadeIn)
  6.    end
  7. end

Last edited by suicidalkatt : 09-24-12 at 02:52 PM. Reason: I derped a lil
  Reply With Quote