diff ClassPlan.lua @ 104:a3800989f515

- Solved the quest pins remaining visible issue
author Nenue
date Sun, 28 May 2017 19:53:11 -0400
parents b29b35cb8539
children 9f664a0ef8a8
line wrap: on
line diff
--- a/ClassPlan.lua	Sun May 28 19:50:42 2017 -0400
+++ b/ClassPlan.lua	Sun May 28 19:53:11 2017 -0400
@@ -101,15 +101,24 @@
       originalScript(minimap, button)
     end
   end)
+  local OnStopped = function()
+    print('Fade.OnStop()')
+    self.isAnimating = nil
+    self:SetShown(self.data.IsShown)
+  end
+
+  self.FadeOut:SetScript('OnStop', OnStopped)
   self.FadeOut:SetScript('OnFinished', function()
-    self:Hide()
-    self.data.IsShown = nil
+    print('FadeOut.OnFinished()')
     self.isAnimating = nil
+    self:SetShown(false)
   end)
   self.FadeIn:SetScript('OnPlay', function()
+    print('FadeIn.OnPlay()')
     self.isAnimating = true
-    self:SetShown(true)
+    self.data.IsShown = true
   end)
+  self.FadeIn:SetScript('OnStop', OnStopped)
 
   --hooksecurefunc(C_Garrison, 'RequestLandingPageShipmentInfo', function()
   --  WorldPlan:print("Requesting shipments data.")
@@ -303,10 +312,15 @@
 
 
 function ClassPlan:Toggle()
-  if self:IsShown() then
+  print('Toggle()', self:IsVisible(), self:IsShown())
+  if self:IsVisible() then
+    print('fade out')
+    self.data.IsShown = false
     self.FadeOut:Play()
   else
+    print('fade in')
     self.data.IsShown = true
+    self:SetShown(true)
     self.FadeIn:Play()
   end
 end
@@ -342,6 +356,7 @@
 
 function ClassPlan:OnHide()
   print('|cFF00FFFFHide()')
+  self.isAnimating = nil
 end
 
 function ClassPlan:Reanchor()