diff QuestPOI.lua @ 109:caa482329919

POI optimization
author Nenue
date Mon, 10 Jul 2017 18:34:11 -0400
parents b67ba1078824
children f6ef9a9f5476
line wrap: on
line diff
--- a/QuestPOI.lua	Sat Jun 03 17:20:14 2017 -0400
+++ b/QuestPOI.lua	Mon Jul 10 18:34:11 2017 -0400
@@ -336,7 +336,8 @@
   --DEFAULT_CHAT_FRAME:AddMessage('|cFFFFFF00'..self:GetName()..'|r:OnHide()')
   self:HideOrShowFrames(false)
   -- reset flags
-  self:SetAlpha(db.PinAlpha)
+  self.icon:SetAlpha(db.PinAlpha)
+  self.RewardBorder:SetAlpha(db.PinAlpha)
   self.isAnimating = nil
   --if db.Config.DebugEnabled then
   --  db.log(tostring(self.questID) .. ' ' .. tostring(self.title) .. "\n" .. tostring(REWARD_TYPE_NAMES[self.rewardType]) .. ' ' .. tostring(self.itemName) .. ' ' .. tostring(self.itemNumber) .. "\n|cFFFF4400" .. (self.hideReason or 'NO_MESSAGE') .. "|r\n|cFF00FFFF" ..  debugstack(2,3,0) .. '|r')
@@ -453,7 +454,6 @@
 
 local updateTime, markTime
 function QuestPOI:OnUpdate (sinceLast)
-  -- control update check intervals
 
   if self.toAlpha then
     if not self.alphaStart then
@@ -487,18 +487,14 @@
 
     else
       self.toAlpha = nil
-    end
-
-    if not self.toAlpha then
       self.alphaStart = nil
-    else
-      self.alphaStart = GetTime()
     end
 
     self.icon:SetAlpha(alpha)
     self.RewardBorder:SetAlpha(alpha)
   end
 
+  -- control update check intervals
   self.throttle = (self.throttle or self.updateRate) + sinceLast
   if self.throttle >= self.updateRate then
     -- factor overtime into the throttle timer
@@ -521,16 +517,12 @@
   if not self.dataLoaded then
     local dataLoaded = self:GetData()
     if dataLoaded and not tContains(db.UpdatedPins, self) then
-      -- self.PendingFade:Stop()
-      -- scale info from the parent module is needed, so deal with it there
       print('|cFF00FF88  queueing for update')
       self.isNew = true
-      tinsert(db.UpdatedPins, self)
-    else
-
-      --print('|cFFFF4400OnUpdate(|r'..self:GetID()..'|cFFFF4400)|r poll failed')
+      self.toAlpha = nil
+      self.alphaStart = nil
+      self:Refresh()
     end
-    return
   end
 
   if self.isStale then
@@ -972,10 +964,8 @@
       self.isNew = nil
     end
   else
-    if not self.toAlpha then
-      icon:SetAlpha(0)
-      iconBorder:SetAlpha(0)
-    end
+    icon:SetAlpha(self.toAlpha or 0)
+    iconBorder:SetAlpha(self.toAlpha or 0)
   end
 
   if self.itemName then