comparison Gear.lua @ 185:a7f2ba17c39a v90

Shadowlands pre-patch update.
author yellowfive
date Tue, 13 Oct 2020 10:49:07 -0700
parents c6369f8f277c
children 4aeedce4c995
comparison
equal deleted inserted replaced
184:f374d84470db 185:a7f2ba17c39a
233 break 233 break
234 end 234 end
235 end 235 end
236 236
237 local equipped = player.Equipped[player.ActiveSpec] 237 local equipped = player.Equipped[player.ActiveSpec]
238 local equippedEssences = player.Essences[player.ActiveSpec] 238 --local equippedEssences = player.Essences[player.ActiveSpec]
239 239
240 if not gear then 240 if not gear then
241 -- no gear has been imported for this spec so show a message 241 -- no gear has been imported for this spec so show a message
242 renderEmptyGear(container) 242 renderEmptyGear(container)
243 else 243 else
311 else 311 else
312 isEquipped = true 312 isEquipped = true
313 end 313 end
314 end 314 end
315 315
316 local isAzerite = optimalItem and C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItemByID(optimalItem.id) 316 --local isAzerite = optimalItem and C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItemByID(optimalItem.id)
317 local isEssence = essences and optimalItem and optimalItem.id == 158075 317 --local isEssence = essences and optimalItem and optimalItem.id == 158075
318 local isAzerite = false
319 local isEssence = false
318 320
319 -- find the item in the player's inventory that best matches what the optimization wants to use 321 -- find the item in the player's inventory that best matches what the optimization wants to use
320 local matchItem = Amr:FindMatchingItem(optimalItem, player, usedItems) 322 local matchItem = Amr:FindMatchingItem(optimalItem, player, usedItems)
321 323
322 -- slot label 324 -- slot label
682 -- we skip any stackable item, as far as we know, there is no equippable gear that can be stacked 684 -- we skip any stackable item, as far as we know, there is no equippable gear that can be stacked
683 if itemLink then 685 if itemLink then
684 local bagItem = Amr.ParseItemLink(itemLink) 686 local bagItem = Amr.ParseItemLink(itemLink)
685 if bagItem ~= nil then 687 if bagItem ~= nil then
686 -- see if this is an azerite item and read azerite power ids 688 -- see if this is an azerite item and read azerite power ids
687 loc:SetBagAndSlot(bagId, slotId) 689 --[[loc:SetBagAndSlot(bagId, slotId)
688 if C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(loc) then 690 if C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(loc) then
689 local powers = Amr.ReadAzeritePowers(loc) 691 local powers = Amr.ReadAzeritePowers(loc)
690 if powers then 692 if powers then
691 bagItem.azerite = powers 693 bagItem.azerite = powers
692 end 694 end
693 end 695 end]]
694 696
695 local diff = countItemDifferences(item, bagItem) 697 local diff = countItemDifferences(item, bagItem)
696 if diff < bestDiff then 698 if diff < bestDiff then
697 bestItem = { bag = bagId, slot = slotId } 699 bestItem = { bag = bagId, slot = slotId }
698 bestDiff = diff 700 bestDiff = diff