Mercurial > wow > askmrrobot
comparison Gear.lua @ 165:3be9cc6f7d20 v77
Updated for 8.2, initial essence support.
author | yellowfive |
---|---|
date | Tue, 25 Jun 2019 10:27:20 -0700 |
parents | 35612aee8e15 |
children | d90a740a1d0b |
comparison
equal
deleted
inserted
replaced
164:a6aa4fa7e2dd | 165:3be9cc6f7d20 |
---|---|
221 local player = Amr:ExportCharacter() | 221 local player = Amr:ExportCharacter() |
222 | 222 |
223 local gear | 223 local gear |
224 local spec | 224 local spec |
225 local setupIndex | 225 local setupIndex |
226 local essences | |
226 for i, setup in ipairs(Amr.db.char.GearSetups) do | 227 for i, setup in ipairs(Amr.db.char.GearSetups) do |
227 if setup.Id == setupId then | 228 if setup.Id == setupId then |
228 setupIndex = i | 229 setupIndex = i |
229 gear = setup.Gear | 230 gear = setup.Gear |
230 spec = setup.SpecSlot | 231 spec = setup.SpecSlot |
232 essences = setup.Essences | |
231 break | 233 break |
232 end | 234 end |
233 end | 235 end |
234 | 236 |
235 local equipped = player.Equipped[player.ActiveSpec] | 237 local equipped = player.Equipped[player.ActiveSpec] |
309 isEquipped = true | 311 isEquipped = true |
310 end | 312 end |
311 end | 313 end |
312 | 314 |
313 local isAzerite = optimalItem and C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItemByID(optimalItem.id) | 315 local isAzerite = optimalItem and C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItemByID(optimalItem.id) |
316 local isEssence = essences and optimalItem and optimalItem.id == 158075 | |
314 | 317 |
315 -- find the item in the player's inventory that best matches what the optimization wants to use | 318 -- find the item in the player's inventory that best matches what the optimization wants to use |
316 local matchItem = Amr:FindMatchingItem(optimalItem, player, usedItems) | 319 local matchItem = Amr:FindMatchingItem(optimalItem, player, usedItems) |
317 | 320 |
318 -- slot label | 321 -- slot label |
368 end | 371 end |
369 | 372 |
370 -- modifications | 373 -- modifications |
371 if optimalItem then | 374 if optimalItem then |
372 | 375 |
373 -- gems or azerite powers | 376 -- gems or azerite powers or essences |
374 local prevSocket = nil | 377 local prevSocket = nil |
375 | 378 |
376 if isAzerite then | 379 if isAzerite then |
377 local azt = optimalItem.azerite or {} | 380 local azt = optimalItem.azerite or {} |
378 for i,spellId in ipairs(azt) do | 381 for i,spellId in ipairs(azt) do |
388 Amr:SetSpellTooltip(socketIcon, spellId, "ANCHOR_TOPRIGHT") | 391 Amr:SetSpellTooltip(socketIcon, spellId, "ANCHOR_TOPRIGHT") |
389 | 392 |
390 prevSocket = socketBorder | 393 prevSocket = socketBorder |
391 end | 394 end |
392 end | 395 end |
396 elseif isEssence then | |
397 -- TODO: render essence differences | |
393 else | 398 else |
394 for i = 1, #optimalItem.gemIds do | 399 for i = 1, #optimalItem.gemIds do |
395 -- we rely on the fact that the gear sets coming back from the site will almost always have all sockets filled, | 400 -- we rely on the fact that the gear sets coming back from the site will almost always have all sockets filled, |
396 -- because it's a pain to get the actual number of sockets on an item from within the game | 401 -- because it's a pain to get the actual number of sockets on an item from within the game |
397 local g = optimalItem.gemIds[i] | 402 local g = optimalItem.gemIds[i] |