changeset 96:bb38bc0e787f

- fix weapon slot anchors for paperdoll
author Nenue
date Tue, 03 Jan 2017 14:06:41 -0500
parents 43303398d1b9
children 5476337198ec
files Modules/BuffFrame.lua Modules/GuildInfo.lua Modules/GuildInfo.xml Modules/PaperDoll.lua Modules/WorldState.lua Modules/WorldState.xml Veneer.toc
diffstat 5 files changed, 32 insertions(+), 160 deletions(-) [+]
line wrap: on
line diff
--- a/Modules/BuffFrame.lua	Sun Jan 01 19:56:35 2017 -0500
+++ b/Modules/BuffFrame.lua	Tue Jan 03 14:06:41 2017 -0500
@@ -243,6 +243,7 @@
     (ANCHOR_INSET_DELTA[COUNT_ANCHOR][1] * COUNT_INSET),
     (ANCHOR_INSET_DELTA[COUNT_ANCHOR][2] * COUNT_INSET))
 
+
   self.underlay:SetParent(UIParent)
 
   self.underlay:SetFrameStrata('BACKGROUND')
@@ -251,6 +252,8 @@
   self.border:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', BORDER_SIZE_R, -BORDER_SIZE_D)
   self.border:Show()
 
+  -- play nice with Blizzard's frame locking structure
+  FRAMELOCK_STATES.PETBATTLES[self:GetName()] = "hidden"
   FRAMELOCK_STATES.PETBATTLES[self.underlay:GetName()] = "hidden"
 end
 
--- a/Modules/PaperDoll.lua	Sun Jan 01 19:56:35 2017 -0500
+++ b/Modules/PaperDoll.lua	Tue Jan 03 14:06:41 2017 -0500
@@ -4,7 +4,7 @@
 -- %file-revision%
 -- Displays the item level and modifications of character sheet equipment, including artifact power
 local print = DEVIAN_WORKSPACE and function(...) print('PaperDoll', ...) end or nop
-
+local artifactSlot
 local slot_overlays = {}
 VeneerPaperDollMixin = {
   anchorFrame = 'CharacterFrame',
@@ -75,7 +75,6 @@
   self:RegisterEvent('INSPECT_READY')
 end
 function VeneerPaperDollMixin:SetupArtifactUI()
-  self:RegisterEvent('ARTIFACT_UPDATE')
 end
 
 function VeneerPaperDollMixin:Setup()
@@ -86,6 +85,7 @@
   self:RegisterEvent('UNIT_INVENTORY_CHANGED')
   self:RegisterEvent('PLAYER_EQUIPMENT_CHANGED')
   self:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED')
+  self:RegisterEvent('ARTIFACT_UPDATE')
 
   self:MarkForUpdate()
 end
@@ -112,6 +112,7 @@
     slot_overlays[panel] = slot_overlays[panel] or {}
     local overlay = slot_overlays[panel][slot]
     if not overlay then
+      print('creating slot overlay', slot)
       overlay = CreateFrame('Frame', 'VeneerPaperDollSlot' .. unit .. slot, frame, 'VeneerPaperDollSlotInfoTemplate')
       overlay:SetID(slot)
       slot_overlays[panel][slot] = overlay
@@ -135,6 +136,10 @@
         overlay.ItemLevel:SetFontObject(VeneerNumberFontLarge)
         overlay.ItemLevel:ClearAllPoints()
         overlay.ItemLevel:SetPoint('BOTTOM', overlay.Sockets, 'TOP', 0, 4)
+        if unit == 'player' then
+          artifactSlot = overlay
+        end
+
       end
 
       print(overlay.Sockets:GetPoint(1))
@@ -173,7 +178,13 @@
       self:MarkForUpdate()
     end
   elseif event == 'ARTIFACT_UPDATE' then
-    self:MarkForUpdate()
+
+    if artifactSlot then
+      print('just udpate artifact slot')
+      artifactSlot:Update(true)
+    end
+
+
   else
     if (event == 'PLAYER_SPECIALIZATION_CHANGED' or event == 'UNIT_INVENTORY_CHANGED') then
       if arg ~= 'player' then
@@ -264,7 +275,6 @@
   self.hasRelicSlots = true
   if numRelics and isEquipped then
     print('Relic Query:', itemID, numRelics)
-    self.checkRelic = nil
     for i = 1, numRelics do
       local lockedReason, relicName, relicIcon, relicLink = C_ArtifactUI.GetRelicInfo(i);
       local relicType = C_ArtifactUI.GetRelicSlotType(i);
@@ -308,10 +318,7 @@
   end
 end
 
-local SocketIcon_Update = function(frame)
-end
-
-function VeneerPaperDollSlotMixin:Update()
+function VeneerPaperDollSlotMixin:Update(forced)
   local id = self:GetID()
 
   self.SocketInfo = self.SocketInfo or {}
@@ -320,7 +327,10 @@
 
   local tooltip = VeneerPaperDollTooltip
   tooltip:SetOwner(self, 'ANCHOR_NONE')
-  print('refresh', self.unit, id)
+  if forced then
+    print('refresh', self.unit, id)
+  end
+
   tooltip:SetInventoryItem(self.unit or 'player', id)
   tooltip:Show()
 
@@ -328,7 +338,7 @@
   local numTextures = 0
   local itemLevel
   local itemLevelLine
-    print('|cFFFFFF00Sockets scan:', numLines)
+    --print('|cFFFFFF00Sockets scan:', numLines)
     for i = 1, numLines do
       local line = _G['VeneerPaperDollTooltipTextLeft'..i]
       local text = line and line:GetText()
@@ -343,7 +353,7 @@
       local texture = _G['VeneerPaperDollTooltipTexture'..i]
       if texture and texture:IsShown() then
         numTextures = numTextures + 1
-        print('picked up socket', numTextures, texture:GetTexture())
+        --print('picked up socket', numTextures, texture:GetTexture())
         self.SocketInfo[numTextures] = texture:GetTexture()
       end
     end
@@ -357,7 +367,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.SocketInfo[index])
       icon:ClearAllPoints()
 
       icon:SetTexture(self.SocketInfo[index])
@@ -377,6 +387,7 @@
         end
         socketsWidth = socketsWidth + icon:GetWidth()
       end
+      print( '|cFFFF4400', icon:GetPoint(1))
 
       local label = self.Sockets.SocketLabel[index]
       label:ClearAllPoints()
@@ -391,9 +402,10 @@
         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)
-        print('', self.SocketType[index], relicAtlasName)
+        --print('', self.SocketType[index], relicAtlasName)
 
         socketsHeight = self.Sockets.SocketBg[index]:GetHeight()
+        print(socketsWidth, socketsHeight)
       end
 
 
--- a/Modules/WorldState.lua	Sun Jan 01 19:56:35 2017 -0500
+++ b/Modules/WorldState.lua	Tue Jan 03 14:06:41 2017 -0500
@@ -20,7 +20,7 @@
 VeneerWorldStateCurrencyMixin = {
 }
 VeneerWorldStateProgressMixin = {
-  keepOpen = false,
+  keepOpen = true,
 }
 VeneerWorldStateMixin = {
   maxHeight = 0,
--- a/Modules/WorldState.xml	Sun Jan 01 19:56:35 2017 -0500
+++ b/Modules/WorldState.xml	Tue Jan 03 14:06:41 2017 -0500
@@ -4,154 +4,11 @@
   <Script file="WorldState.lua" />
 
   <Frame name="VeneerWorldState" mixin="VeneerWorldStateMixin" parent="UIParent" inherits="VeneerMixinScripts">
+    <Size x="600" y="24" />
     <Anchors>
       <Anchor point="TOP" />
     </Anchors>
-    <Size x="600" y="24" />
     <Frames>
-
-      <Frame name="$parentProgress" mixin="VeneerWorldStateProgressMixin" inherits="VeneerMixinScripts" enableMouse="true">
-        <Anchors>
-          <Anchor point="TOPLEFT" />
-        </Anchors>
-        <Animations>
-          <AnimationGroup parentKey="TransitionFadeOut" setToFinalAlpha="true">
-            <Alpha fromAlpha="1" toAlpha="0" duration="0.15" order="1" />
-            <Scripts>
-              <OnPlay>
-                --print('VnWorldState','fade out')
-                self:GetParent().faded = true
-              </OnPlay>
-              <OnStop>
-                print('VnWorldState', '|cFF44FF00stopped fadeout')
-                self:GetParent():Update()
-              </OnStop>
-              <OnFinished>
-                --print('VnWorldState', '|cFFFFFF00end of fadeout')
-                self:GetParent():Hide()
-                self:GetParent():Update()
-              </OnFinished>
-            </Scripts>
-          </AnimationGroup>
-          <AnimationGroup parentKey="TransitionFadeIn" setToFinalAlpha="true">
-            <Alpha fromAlpha="0" toAlpha="1" duration="0.15" order="1" />
-            <Scripts>
-              <OnPlay>
-                self:GetParent():ShowPanel()
-                self:GetParent().timeLived = 0
-                --print('VnWorldState', 'fade in')
-              </OnPlay>
-              <OnStop>
-                self:GetParent():Update()
-              </OnStop>
-              <OnFinished>
-                --print('VnWorldState', '|cFFFFFF00end of fade IN')
-                self:GetParent().faded = nil
-                self:GetParent().timeLived = 0
-              </OnFinished>
-            </Scripts>
-          </AnimationGroup>
-          <AnimationGroup parentKey="TimedFadeOut" setToFinalAlpha="true">
-            <Alpha childKey="ProgressText" fromAlpha="1" toAlpha="0" duration="1.12" order="1" />
-            <Alpha childKey="Background" fromAlpha="1" toAlpha="0" duration="1.12" order="1" />
-            <Scripts>
-
-              <OnFinished>
-                --print('VnWorldState', '|cFFFFFF00end of fadeout')
-                self:GetParent():Hide()
-              </OnFinished>
-            </Scripts>
-          </AnimationGroup>
-
-          <AnimationGroup parentKey="ProgressFlash" setToFinalAlpha="true">
-            <Alpha fromAlpha="0" toAlpha="1" duration="0.15" order="1" childKey="ProgressAdded" />
-            <Alpha fromAlpha="1" toAlpha="0" duration="0.45" order="2" childKey="ProgressAdded" />
-
-            <Alpha childKey="Spark" fromAlpha="0" toAlpha="1" duration="0.15" order="1" />
-            <Alpha childKey="Spark" fromAlpha="1" toAlpha="0" duration="0.15" order="2" />
-
-
-            <Alpha childKey="ProgressSpark" fromAlpha="0" toAlpha="1" duration="0.15" order="1" startDelay=".45" />
-            <Translation parentKey="translation" childKey="Spark" offsetX="600" offsetY="0" duration="0.30" order="1" />
-            <Scripts>
-              <OnPlay>
-                self:GetParent().ProgressAdded:Show()
-                self:GetParent().Spark:Show()
-              </OnPlay>
-              <OnStop>
-                self:GetParent().ProgressAdded:Hide()
-                self:GetParent().Spark:Hide()
-              </OnStop>
-              <OnFinished>
-                self:GetParent().ProgressAdded:Hide()
-                self:GetParent().Spark:Hide()
-              </OnFinished>
-            </Scripts>
-          </AnimationGroup>
-        </Animations>
-        <Layers>
-          <Layer level="BACKGROUND">
-            <Texture parentKey="Background" alphaMode="BLEND" file="Interface\LevelUp\BossBanner">
-              <Anchors>
-                <Anchor point="TOP" />
-                <Anchor point="BOTTOM" />
-                <Anchor point="LEFT" x="24" y="0" />
-                <Anchor point="RIGHT" x="-24" y="0" />
-              </Anchors>
-              <TexCoords left="0" right="0.8" top="0.45" bottom="0.55" />
-            </Texture>
-          </Layer>
-          <Layer level="BORDER">
-            <Texture parentKey="ProgressBG">
-              <Anchors>
-                <Anchor point="TOPRIGHT" />
-                <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="12" />
-              </Anchors>
-              <Color r="0" g="0" b="0" a="0.75" />
-            </Texture>
-          </Layer>
-          <Layer level="ARTWORK">
-            <Texture parentKey="ProgressBar">
-              <Anchors>
-                <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" relativeKey="$parent.ProgressBG" x="0" y="0" />
-              </Anchors>
-              <Color r="1" g="1" b="1" a="0.8" />
-            </Texture>
-          </Layer>
-          <Layer level="ARTWORK" textureSubLevel="2">
-
-            <Texture parentKey="OverflowBar" hidden="true">
-              <Anchors>
-                <Anchor point="BOTTOM" relativeKey="$parent.ProgressBG" />
-                <Anchor point="TOP" relativeKey="$parent.ProgressBG" />
-              </Anchors>
-              <Color a="1" r="0.1" g=".35" b=".85" />
-            </Texture>
-          </Layer>
-          <Layer level="OVERLAY">
-            <Texture parentKey="ProgressAdded" hidden="true">
-              <Color a="1" r="1" g="1" b="1" />
-            </Texture>
-
-            <Texture parentKey="Spark" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineBurst">
-              <Size x="60" y="15"/>
-              <Anchors>
-                <Anchor point="CENTER" relativePoint="LEFT" relativeKey="$parent.ProgressAdded" />
-              </Anchors>
-            </Texture>
-            <Texture parentKey="ProgressSpark" atlas="OBJFX_LineBurst">
-              <Size x="8" y="12" />
-            </Texture>
-
-            <FontString parentKey="Label" inherits="VeneerNumberFont">
-              <Anchors>
-                <Anchor point="CENTER" />
-              </Anchors>
-            </FontString>
-          </Layer>
-        </Layers>
-      </Frame>
-
       <Frame name="$parentZoneCurrency" mixin="VeneerWorldStateCurrencyMixin" hidden="true" inherits="VeneerMixinScripts, VeneerAnimations">
         <Size x="240" y="24" />
         <Anchors>
@@ -175,7 +32,6 @@
           </Layer>
         </Layers>
       </Frame>
-
     </Frames>
   </Frame>
   <Frame name="VeneerOrderHallHandler" hidden="true" parent="UIParent" mixin="VeneerOrderHallMixin" inherits="VeneerMixinScripts" />
--- a/Veneer.toc	Sun Jan 01 19:56:35 2017 -0500
+++ b/Veneer.toc	Tue Jan 03 14:06:41 2017 -0500
@@ -15,4 +15,5 @@
 Modules\WorldState.xml
 Modules\TalkingHead.xml
 Modules\BuffFrame.xml
-Modules\PaperDoll.xml
\ No newline at end of file
+Modules\PaperDoll.xml
+Modules\GuildInfo.xml
\ No newline at end of file