changeset 117:a4dfdd4f1cf3 v7.3.2-20171215

- Fixed filter pins not working on Argus maps - More taint counter-measures
author Nenue
date Fri, 15 Dec 2017 16:38:09 -0500
parents bf4a36378bb9
children 5916b9b8486b
files ClassPlan.lua ClassPlanFollowers.lua ClassPlanFollowers.xml FilterBar.lua WorldMap.lua WorldPlan.lua WorldPlan.xml
diffstat 7 files changed, 244 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/ClassPlan.lua	Fri Nov 24 23:51:44 2017 -0500
+++ b/ClassPlan.lua	Fri Dec 15 16:38:09 2017 -0500
@@ -145,6 +145,7 @@
   self.profile = characters[profileName] or {
     showItems = true
   }
+  self.profileName = profileName
   self.characters = characters
   characters[profileName] = self.profile
 
@@ -175,9 +176,9 @@
   end
   frame.sortedItems = {}
   for index, listKey in ipairs(frame.listKey) do
+    self.profile[listKey] = self.profile[listKey] or {}
     frame.profile = self.profile
     frame.data = self.data
-    self.profile[listKey] = self.profile[listKey] or {}
     local listTitle = frame.listTitle[index]
     setmetatable(self.profile[listKey], { __tostring = function() return listTitle end })
     frame.sortedItems[listKey] = {}
@@ -235,16 +236,11 @@
 
 local max = math.max
 function ClassPlan:RefreshData()
-  local detailsFailed
   for index, handler in pairs(self.Handlers) do
     print(' |cFF00FF00'..handler:GetName()..' data update|r')
     handler:RefreshData()
   end
-  if detailsFailed then
-    db.print('Unable to obtain player details. Trying again later.')
-  else
     self.requestingData = nil
-  end
 end
 
 function ClassPlan:Update()
@@ -254,7 +250,9 @@
   for index, handler in ipairs(self.Handlers) do
     local itemsHeight = handler:UpdateItems()
     if itemsHeight then
+
       self.currentHeight = max(itemsHeight, self.currentHeight)
+      print('calc height', handler, self.currentHeight)
     end
   end
 
@@ -299,6 +297,11 @@
     index = index + 1
   end
 
+  for i = index, #self.characterButtons do
+    self.characterButtons[i]:Hide()
+  end
+
+
   self.HeaderInset:SetHeight(CP_HEADER_SIZE)
   self.HeaderInset:ClearAllPoints()
   self.HeaderInset:SetPoint('TOPLEFT' ,self, 'TOPLEFT')
@@ -376,7 +379,7 @@
       ListTab:SetPoint('BOTTOMRIGHT', frame, 'TOPRIGHT', 0, -CP_HEADER_SIZE)
       ListTab.Label:SetText(frame.listTitle[frame.currentListIndex])
       ListTab:Show()
-      print(ListTab:GetSize())
+      print(ListTab:GetName(), ListTab:GetSize())
     end
     self.currentHeight = max(self.currentHeight, frame.currentHeight or 0)
   end
@@ -470,13 +473,10 @@
 function ClassPlanHandlerBase:RefreshData()
   print('|cFF0088FF'..self:GetName()..':RefreshData()')
   local activeKey = self.activeKey
-  local detailsFailed
   self.truncatedItems = 0
   self.currentTime = time()
   if self:GetParent().profile then
     self:GetPlayerData()
-  else
-    detailsFailed  = true
   end
   for _, listKey in ipairs(self.listKey) do
     local sortedItems = self.sortedItems[listKey]
@@ -543,10 +543,7 @@
   self.Name:SetTextColor(data.classColor.r, data.classColor.g, data.classColor.b)
 end
 
-function ClassPlanHandlerBase:Acquire(id)
-end
-function ClassPlanHandlerBase:FreeBlock (block)
-end
+function ClassPlanHandlerBase:Reanchor() end
 
 function ClassPlanHandlerBase:UpdateItems()
   print('|cFF0088FF '..self:GetName()..':UpdateItems()|r', self.activeKey)
@@ -561,6 +558,16 @@
     scrollOffset = (numItems - self.maxItems)
   end
 
+  if self.OnUpdateRequested then
+    local overrideHeight = self:OnUpdateRequested()
+    if overrideHeight then
+      return overrideHeight
+    end
+
+
+  end
+
+
   self.ListTab.Count:SetText(numItems)
   self.blocks = self.blocks or  {}
   local blocks = self.blocks
@@ -647,6 +654,12 @@
 
   self.scrollOffset = scrollOffset
   self.isStale = nil
+
+
+  if self.OnItemsUpdated then
+    return self:OnItemsUpdated()
+  end
+
   return totalHeight
 end
 
@@ -708,7 +721,7 @@
   local frame = self:GetParent()
   frame:SetList()
   if frame.OnHeaderClick then
-    frame.OnHeaderClick(frame)
+    frame:OnHeaderClick()
   end
 end
 
@@ -723,6 +736,10 @@
   self.SelectGlow:SetShown(self.isMine)
 end
 
+function ClassPlanCharacterButtonMixin:OnLoad()
+  self:RegisterForClicks('AnyDown')
+end
+
 function ClassPlanCharacterButtonMixin:OnEnter()
   if not self.profileKey then
     return
@@ -730,7 +747,7 @@
 
   GameTooltip:SetOwner(self, 'ANCHOR_RIGHT')
   local info = ClassOrderPlan.data.characters[self.profileKey]
-  GameTooltip:AddLine(self.characterName, self.classColor.r, self.classColor.g, self.classColor.b)
+  GameTooltip:AddLine(self.characterName .. ' - ' .. self.characterRealm, self.classColor.r, self.classColor.g, self.classColor.b)
   local numItems = 0
   if info.missions then
     GameTooltip:AddLine(#info.missions .. ' mission'..((#info.missions == 1) and '' or 's')..' in progress')
@@ -751,13 +768,22 @@
 end
 
 function ClassPlanCharacterButtonMixin:OnClick(button, down)
-  print('OnClick', self.profileKey)
   local clist = ClassOrderPlan.data.characters
 
   if button == 'RightButton' then
-    for _, profile in pairs(clist) do
-      profile.showItems = true
+
+    if IsShiftKeyDown() then
+      print('delete profile', self.profileKey)
+      clist[self.profileKey] = nil
+    else
+
+      for _, profile in pairs(clist) do
+        profile.showItems = true
+      end
     end
+
+
+
   else
     if clist[self.profileKey].showItems then
       clist[self.profileKey].showItems = nil
@@ -769,7 +795,10 @@
     handler.isStale = true
   end
 
+
+
   ClassOrderPlan:RefreshData()
   ClassOrderPlan:Update()
-  print(clist[self.profileKey].showItems)
+  print('OnClick', self.profileKey)
+  print( clist[self.profileKey] and clist[self.profileKey].showItems)
 end
--- a/ClassPlanFollowers.lua	Fri Nov 24 23:51:44 2017 -0500
+++ b/ClassPlanFollowers.lua	Fri Dec 15 16:38:09 2017 -0500
@@ -1,10 +1,10 @@
 
-local print = DEVIAN_WORKSPACE and function(...) print('ClassPlan', ...) end or nop
+local print = DEVIAN_WORKSPACE and function(...) print('ClassPlanF', ...) end or nop
 local c  = {
 
-  templateName = 'ClassPlanShipmentEntry',
+  templateName = 'ClassPlanFollowerEntry',
   listKey = {'followers','troops'},
-  listTitle = {'Followers'},
+  listTitle = {'Followers', 'Troops'},
   events = {
     'GARRISON_FOLLOWER_LIST_UPDATE',
     'GARRISON_FOLLOWER_XP_CHANGED',
@@ -26,47 +26,132 @@
   self:GetPlayerData()
 end
 
-function c:OnUpdate() end
-
 function c:GetPlayerData()
 
-  print('|cFF0088FF'..self:GetName()..':GetPlayerData()|r')
-  local profileList = self:GetParent().profile.followers
-  local troopList = self:GetParent().profile.troops
+  print('|cFF0088FF'..self:GetName()..':GetPlayerData()|r', self.followerType, time())
+  local profile = self:GetParent().profile
 
   local followerInfo = C_Garrison.GetFollowers(self.followerType)
 
 
+
   if followerInfo then
-    table.wipe(profileList)
+    table.wipe(profile.followers)
+    table.wipe(profile.troops)
     for followerID, follower in pairs(followerInfo) do
       print(FOLLOWER_QUALITY_COLORS[follower.quality].hex, follower.name, follower.isTroop)
       if follower.isTroop then
-        troopList[followerID] = follower
+        print('added troop')
+        profile.troops[followerID] = follower
       else
         print(follower.isMaxLevel, follower.xp, follower.levelXP, follower.iLevel)
 
-        profileList[followerID] = follower
+        profile.followers[followerID] = follower
       end
 
 
-      profileList[followerID] = follower
+      --profileList[followerID] = follower
     end
   end
 
+  return true
 end
 
-function c:UpdateItems()
+function c:UpdateTroops (followers, baseIndex)
+  baseIndex = baseIndex or 1
+  for followerID, follower in pairs(followers) do
+    --local frame = self.
+  end
+
+
+  return baseIndex
+end
+
+function c:OnUpdateRequested ()
+  print('OnUpdateRequested()')
+end
+
+function c:OnItemsUpdated()
+  print('OnItemsUpdated()')
+  return nil
+end
+
+function c:RefreshData()
+
+  print('|cFF0088FF'..self:GetName()..':RefreshData()')
+  local activeKey = self.activeKey
+  self.truncatedItems = 0
+  self.currentTime = time()
+  if self:GetParent().profile then
+    self:GetPlayerData()
+  end
+  local profile = self.profile
+  for _, listKey in ipairs(self.listKey) do
+    local sortedItems = self.sortedItems[listKey]
+    wipe(sortedItems)
+      local isMine = (profile == self.profile)
+      print(listKey, isMine, profile.showItems)
+      local profileList = self.profile[listKey]
+      if profileList and #profileList >= 1 then
+        local classColor = profile.classColor or RAID_CLASS_COLORS['HUNTER']
+        if profile.showItems then
+          for index, data in ipairs(profileList) do
+            data.classColor = classColor
+            data.profileKey = ClassOrderPlan.profileName
+            data.isMine = isMine
+            if self.OnGetItem then
+              self:OnGetItem(data)
+            end
+            tinsert(sortedItems, data)
+          end
+        else
+          self.truncatedItems = self.truncatedItems + 1
+        end
+      end
+
+    if self.SortHandler then
+      sort(sortedItems, self.SortHandler)
+    end
+  end
+
+  for k,v in pairs(self.sortedItems) do
+    print('  ', k)
+  end
+
+  self.isStale = true
+end
+
+--[[
+-- function c:UpdateItems()
 
   local profileList = self:GetParent().profile.followers
 
   local troopList = self:GetParent().profile.troops
 
-  
+  print('UpdateItems()  ')
+
 
 end
+--]]
 function c:Reanchor()
+  self:SetPoint('TOPLEFT', ClassOrderPlan.BackgroundInset, 'BOTTOMLEFT')
+  self:SetPoint('RIGHT', ClassOrderPlan.BackgroundInset, 'RIGHT')
 end
 
+local f = {}
+function f:Update()
+  self.Icon:SetTexture()
+end
+function f:OnLoad()
+  self.Owner = self.Overlay.Owner
 
-ClassPlanFollowerMixin = CreateFromMixins(ClassPlanHandlerBase, c)
\ No newline at end of file
+  self.Count = self.Overlay.Count
+  self.Name = self.Overlay.Name
+end
+
+function f.SortHandler (a, b)
+  return true
+end
+
+ClassPlanFollowersHandler = CreateFromMixins(ClassPlanHandlerBase, c)
+ClassPlanFollowerEntryMixin = CreateFromMixins(ClassPlanEntryBase, f)
\ No newline at end of file
--- a/ClassPlanFollowers.xml	Fri Nov 24 23:51:44 2017 -0500
+++ b/ClassPlanFollowers.xml	Fri Dec 15 16:38:09 2017 -0500
@@ -1,11 +1,40 @@
 <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
 ..\FrameXML\UI.xsd">
   <Script file="ClassPlanFollowers.lua" />
-  <Frame name="$parentFollowers" parent="ClassOrderPlan" parentKey="FollowerList"  parentArray="Handlers" mixin="ClassPlanFollowerMixin" inherits="ClassPlanPanelTemplate">
+
+
+  <Button name="ClassPlanFollowerEntry" inherits="ClassPlanListEntryTemplate" mixin="ClassPlanFollowerEntryMixin" virtual="true">
+    <Size y="24" />
+    <Anchors>
+      <Anchor point="RIGHT" />
+    </Anchors>
     <Scripts>
-      <OnEvent method="OnEvent"/>
+      <OnLoad method="OnLoad" />
       <OnUpdate method="OnUpdate" />
+      <OnEvent method="OnEvent" />
       <OnShow method="OnShow" />
     </Scripts>
+    <Layers>
+      <Layer level="BACKGROUND">
+        <Texture name="$parentPortrait" parentKey="Portrait">
+          <Size x="40" y="40" />
+          <Anchors>
+            <Anchor point="LEFT" />
+          </Anchors>
+        </Texture>
+      </Layer>
+    </Layers>
+  </Button>
+
+
+  <Frame name="$parentFollowers" parent="ClassOrderPlan" parentKey="Followers" mixin="ClassPlanFollowersHandler" inherits="ClassPlanPanelTemplate">
+
+    <Scripts>
+      <OnLoad method="OnLoad" />
+      <OnUpdate method="OnUpdate" />
+      <OnEvent method="OnEvent" />
+      <OnShow method="OnShow" />
+      <OnMouseDown method="OnMouseDown" />
+    </Scripts>
   </Frame>
 </Ui>
\ No newline at end of file
--- a/FilterBar.lua	Fri Nov 24 23:51:44 2017 -0500
+++ b/FilterBar.lua	Fri Dec 15 16:38:09 2017 -0500
@@ -416,14 +416,18 @@
     GameTooltip:AddLine(self.info.label)
     wipe(found)
 
+
+
     if self.numQuestsHere >= 1 then
       if self.numQuestsHere < self.numQuestsTotal then
         GameTooltip:AddLine('This Zone', 1, 1, 0)
       end
       for index, pin in ipairs(self.LocalMatches) do
-        local colorInfo = (pin.quality and ITEM_QUALITY_COLORS[pin.quality]) or rgbWhite
-        found[pin] = pin
-        GameTooltip:AddLine('|T'.. tostring(pin.itemTexture)..':16:16|t ' .. tostring(pin.title) ..(pin.cheevos and " |cFFFFFF00!|R" or ''), 0, 1, 0)
+        if not IsQuestFlaggedCompleted(pin.questID) then
+          local colorInfo = (pin.quality and ITEM_QUALITY_COLORS[pin.quality]) or rgbWhite
+          found[pin] = pin
+          GameTooltip:AddLine('|T'.. tostring(pin.itemTexture)..':16:16|t ' .. tostring(pin.title) ..(pin.cheevos and " |cFFFFFF00!|R" or ''), 0, 1, 0)
+        end
       end
     end
 
@@ -431,12 +435,14 @@
       if self.numQuestsHere >= 1 then
         GameTooltip:AddLine(' ')
       end
-      GameTooltip:AddLine('Other Maps', 1, 1, 0)
+      GameTooltip:AddLine('Other Zones', 1, 1, 0)
       for index, pin in ipairs(self.GlobalMatches) do
-        if not found[pin] then
-          local colorInfo = (pin.quality and ITEM_QUALITY_COLORS[pin.quality]) or rgbWhite
-          found[pin] = pin
-          GameTooltip:AddLine('|T'.. tostring(pin.itemTexture)..':16:16|t ' .. tostring(pin.title) ..(pin.cheevos and " |cFFFFFF00!|R" or ''), 1, 1, 1)
+        if not IsQuestFlaggedCompleted(pin.questID) then
+          if not found[pin] then
+            local colorInfo = (pin.quality and ITEM_QUALITY_COLORS[pin.quality]) or rgbWhite
+            found[pin] = pin
+            GameTooltip:AddLine('|T'.. tostring(pin.itemTexture)..':16:16|t ' .. tostring(pin.title) ..(pin.cheevos and " |cFFFFFF00!|R" or ''), 1, 1, 1)
+          end
         end
       end
     end
--- a/WorldMap.lua	Fri Nov 24 23:51:44 2017 -0500
+++ b/WorldMap.lua	Fri Dec 15 16:38:09 2017 -0500
@@ -35,8 +35,28 @@
 
 local ToggleButton = {}
 local BROKEN_ISLES_ID, DALARAN_ID, AZSUNA_ID, VALSHARAH_ID, HIGHMOUNTAIN_ID, STORMHEIM_ID, SURAMAR_ID, EOA_ID = 1007, 1014, 1015,1018, 1024, 1017, 1033, 1096
-local WORLD_QUEST_MAPS = { [DALARAN_ID] = 'Dalaran70',  [AZSUNA_ID] = 'Azsuna',  [VALSHARAH_ID] = "Val'sharah",
-  [HIGHMOUNTAIN_ID] = 'Highmountain', [STORMHEIM_ID] = 'Stormheim',  [SURAMAR_ID] = 'Suramar',  [EOA_ID] = 'EyeOfAszhara', }
+local ARGUS_ID, ANTORAN_ID, KROKUUN_ID, MACAREE_ID = 1184, 1171, 1135, 1170
+local WORLD_QUEST_MAPS = {
+  [DALARAN_ID] = true,
+  [AZSUNA_ID] = true,
+  [VALSHARAH_ID] = true,
+  [HIGHMOUNTAIN_ID] = true,
+  [STORMHEIM_ID] = true,
+  [SURAMAR_ID] = true,
+  [EOA_ID] = true,
+  [ARGUS_ID] = true,
+  [ANTORAN_ID] = true,
+  [KROKUUN_ID] = true,
+  [MACAREE_ID] = true
+}
+
+local SUBCONTINENT_MAPS = {
+    [ANTORAN_ID] = ARGUS_ID,
+    [KROKUUN_ID] = ARGUS_ID,
+    [MACAREE_ID] = ARGUS_ID,
+}
+
+
 
 local REWARD_CASH = WORLD_QUEST_REWARD_TYPE_FLAG_GOLD
 local REWARD_ARTIFACT_POWER = WORLD_QUEST_REWARD_TYPE_FLAG_ARTIFACT_POWER
@@ -188,6 +208,11 @@
     self:Refresh()
   end
 
+  if self.tasksDirty then
+    self:UpdateTaskPOIs()
+  end
+
+
   if #db.UpdatedPins >= 1 then
     --print('|cFF00FF88pending update', #db.UpdatedPins)
     self:UpdateNext()
@@ -306,6 +331,13 @@
 
 function Module:UpdateTaskPOIs()
   canTargetQuests = SpellCanTargetQuest()
+
+  if InCombatLockdown() then
+    self.tasksDirty = true
+    return
+  end
+
+
   for i = 1, NUM_WORLDMAP_TASK_POIS do
     local poiFrame = _G['WorldMapFrameTaskPOI'..i]
     if poiFrame and poiFrame.worldQuest then
@@ -317,6 +349,8 @@
       end
     end
   end
+
+  self.tasksDirty = false
 end
 -- re-anchors and scales pins that have had either of these changed due to data loading delays
 function Module:UpdateNext()
@@ -589,6 +623,13 @@
         if db.QuestsByZone[mapID] then
           db.QuestsByZone[mapID][questID] = pin
         end
+
+        if SUBCONTINENT_MAPS[mapID] then
+          db.QuestsByZone[SUBCONTINENT_MAPS[mapID]] = db.QuestsByZone[SUBCONTINENT_MAPS[mapID]] or {}
+          db.QuestsByZone[SUBCONTINENT_MAPS[mapID]][questID] = pin
+        end
+
+
       else
         print('|cFFFF4400discarding|r', pin.title)
       end
--- a/WorldPlan.lua	Fri Nov 24 23:51:44 2017 -0500
+++ b/WorldPlan.lua	Fri Dec 15 16:38:09 2017 -0500
@@ -9,6 +9,7 @@
 local select, type, tostring, tonumber = select, type, tostring, tonumber
 local ITEM_QUALITY_COLORS = ITEM_QUALITY_COLORS
 local BROKEN_ISLES_ID = 1007
+local ARGUS_ID = 1184
 local GetCurrentMapAreaID = GetCurrentMapAreaID
 local GetTime, IsLoggedIn = GetTime, IsLoggedIn
 local DEBUG_HISTORY = {}
@@ -425,7 +426,11 @@
   [1080] = true, -- Thunder Totem
   [1072] = true, -- True Shot Lodge,
 
-}
+  [1184] = true, -- Argus continent
+  [1171] = true, -- Antoran Wastes,
+  [1135] = true, -- Krokuun,
+  [1170] = true, -- Mac'aree
+ }
 
 function WorldPlanCore:SetCurrentMap(event)
   local mapAreaID, isContinent = GetCurrentMapAreaID()
--- a/WorldPlan.xml	Fri Nov 24 23:51:44 2017 -0500
+++ b/WorldPlan.xml	Fri Dec 15 16:38:09 2017 -0500
@@ -58,7 +58,7 @@
   <Include file="ClassPlan.xml" />
   <Include file="ClassPlanMissions.xml" />
   <Include file="ClassPlanShipments.xml" />
-  <Include file="ClassPlanFollowers.xml" />
+  <!--<Include file="ClassPlanFollowers.xml" />-->
   <Include file="MapFrame.xml" />