Mercurial > wow > askmrrobot
diff Gear.lua @ 181:5c586ff5fee5 v85
gear ui should now show essence differences
author | yellowfive |
---|---|
date | Fri, 14 Feb 2020 14:53:46 -0800 |
parents | d90a740a1d0b |
children | c6369f8f277c |
line wrap: on
line diff
--- a/Gear.lua Thu Feb 13 13:22:13 2020 -0800 +++ b/Gear.lua Fri Feb 14 14:53:46 2020 -0800 @@ -223,7 +223,7 @@ local gear local spec local setupIndex - local essences + local essences for i, setup in ipairs(Amr.db.char.GearSetups) do if setup.Id == setupId then setupIndex = i @@ -235,7 +235,8 @@ end local equipped = player.Equipped[player.ActiveSpec] - + local equippedEssences = player.Essences[player.ActiveSpec] + if not gear then -- no gear has been imported for this spec so show a message renderEmptyGear(container) @@ -394,7 +395,31 @@ end end elseif isEssence then - -- TODO: render essence differences + for i = 1, 4 do + if essences and #essences >= i then + local essence = essences[i] + local equippedEssence = equippedEssences and #equippedEssences >= i and equippedEssences[i] or nil + if essence then + local essenceInfo = C_AzeriteEssence.GetEssenceInfo(essence[2]) + if essenceInfo then + local isEssenceActive = equippedEssence and equippedEssence[2] == essence[2] + + local socketBorder, socketIcon = createSocketWidget(panelMods, prevSocket or lblItem, prevSocket, isEssenceActive) + + -- set icon and tooltip + socketIcon:SetIcon(essenceInfo.icon) + Amr:SetEssenceTooltip(socketIcon, string.format("azessence:%d:%d", essence[2], essence[3]) , "ANCHOR_TOPRIGHT") + + --[[ + if essence[1] and essence[1] > 4 then + Amr:SetSpellTooltip(socketIcon, essence[1], "ANCHOR_TOPRIGHT") + end]] + + prevSocket = socketBorder + end + end + end + end else for i = 1, #optimalItem.gemIds do -- we rely on the fact that the gear sets coming back from the site will almost always have all sockets filled, @@ -1272,16 +1297,16 @@ -- TODO: implement end ---[[ + local function testfunc(message) print(strsub(message, 13)) end -]] + function Amr:InitializeGear() Amr:AddEventHandler("ACTIVE_TALENT_GROUP_CHANGED", onActiveTalentGroupChanged) - --Amr:AddEventHandler("CHAT_MSG_CHANNEL", testfunc) + Amr:AddEventHandler("CHAT_MSG_CHANNEL", testfunc) Amr:AddEventHandler("UNIT_INVENTORY_CHANGED", function(unitID) if unitID and unitID ~= "player" then return end