diff Modules/PaperDoll.lua @ 116:ddfe19d70a34

ArtifactPower: - Further 7.2 accommodations, relating to tokens that grant millions of AP. Currency: - Ancient Mana zones list expanded - Legionfall War Supplies, Nethershards, and Blood of Sargeras are tracked globally PaperDoll: - Should update more effectively when delayed artifact data loads in. WorldState: - Fixed hanging panels after OrderHallCommandBar is hidden.
author Nenue
date Wed, 26 Apr 2017 20:06:38 -0400
parents 3992b41c637e
children 15a7f27b11e6
line wrap: on
line diff
--- a/Modules/PaperDoll.lua	Tue Mar 28 07:02:26 2017 -0400
+++ b/Modules/PaperDoll.lua	Wed Apr 26 20:06:38 2017 -0400
@@ -83,6 +83,7 @@
   self:RegisterEvent('UNIT_INVENTORY_CHANGED')
   self:RegisterEvent('PLAYER_EQUIPMENT_CHANGED')
   self:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED')
+  self:RegisterEvent('ARTIFACT_RELIC_INFO_RECEIVED')
   self:RegisterEvent('ARTIFACT_UPDATE')
 
   self:MarkForUpdate()
@@ -171,7 +172,10 @@
     end
   elseif event == 'ARTIFACT_UPDATE' then
     if artifactSlot then
-      print('just udpate artifact slot')
+      artifactSlot:Update(true)
+    end
+  elseif event == 'ARTIFACT_RELIC_INFO_RECEIVED' then
+    if artifactSlot then
       artifactSlot:Update(true)
     end
   else
@@ -261,7 +265,7 @@
   if numRelics and isEquipped then
     print('Relic Query:', itemID, numRelics)
     for i = 1, numRelics do
-      local lockedReason, relicName, relicIcon, relicLink = C_ArtifactUI.GetRelicInfo(i);
+      local relicName, relicIcon, relicType, relicLink = C_ArtifactUI.GetRelicInfo(i);
       local relicType = C_ArtifactUI.GetRelicSlotType(i);
       print(relicType)
       if relicType then
@@ -357,7 +361,7 @@
   local socketsHeight = 24
   for index, icon in ipairs(self.Sockets.SocketIcon) do
     if self.SocketInfo[index] then
-      --print('|cFF0088FFsocketInfo|r', index, self.SocketInfo[index])
+      print('|cFF0088FFsocketInfo|r', index, self.SocketType[index], self.SocketInfo[index])
       icon:ClearAllPoints()
 
       icon:SetTexture(self.SocketInfo[index])
@@ -387,15 +391,25 @@
 
       if self.checkRelic and self.SocketType[index] then
         print(self.SocketType[index])
+        self.Sockets.SocketBg = self.Sockets.SocketBg or {}
+        self.Sockets.SocketBg[index] = self.Sockets.SocketBg[index] or self.Sockets:CreateTexture(nil, 'OVERLAY')
+
+
+        local relicBG = self.Sockets.SocketBg[index]
         local relicAtlasName = ("Relic-%s-Slot"):format(self.SocketType[index]);
-        self.Sockets.SocketBg = self.Sockets.SocketBg or {}
-        self.Sockets.SocketBg[index] = self.Sockets.SocketBg[index] or self.Sockets:CreateTexture()
-        self.Sockets.SocketBg[index]:SetAtlas(relicAtlasName)
-        self.Sockets.SocketBg[index]:SetPoint('TOPRIGHT', icon, 'TOPRIGHT', 12, 12)
-        self.Sockets.SocketBg[index]:SetPoint('BOTTOMLEFT', icon, 'BOTTOMLEFT', -12,-12)
+        relicBG:SetMask(nil)
+        relicBG:SetAtlas(relicAtlasName)
+        relicBG:SetPoint('TOPRIGHT', icon, 'TOPRIGHT', 10, 10)
+        relicBG:SetPoint('BOTTOMLEFT', icon, 'BOTTOMLEFT', -10,-10)
         --print('', self.SocketType[index], relicAtlasName)
         if self.SocketInfo[index] == 0 then
           icon:SetAtlas("Relic-SlotBG")
+        else
+          icon:SetMask(nil);
+          icon:SetTexCoord(0, 1, 0, 1); -- Masks may overwrite our tex coords (even ones set by an atlas), force it back to using the full item icon texture
+          icon:SetMask("Interface\\CharacterFrame\\TempPortraitAlphaMask");
+          icon:SetTexture(self.SocketInfo[index])
+
         end
 
         socketsHeight = self.Sockets.SocketBg[index]:GetHeight()