Mercurial > wow > askmrrobot
changeset 131:318c93e0cd6b v61
Fixed an issue with the shopping list.
author | yellowfive |
---|---|
date | Wed, 18 Jul 2018 15:19:04 -0700 |
parents | 559f1d35bc72 |
children | 2279d58793c6 |
files | AskMrRobot-Serializer/AskMrRobot-Serializer.lua AskMrRobot.toc Shopping.lua |
diffstat | 3 files changed, 16 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/AskMrRobot-Serializer/AskMrRobot-Serializer.lua Wed Jul 18 13:08:38 2018 -0700 +++ b/AskMrRobot-Serializer/AskMrRobot-Serializer.lua Wed Jul 18 15:19:04 2018 -0700 @@ -1,6 +1,6 @@ -- AskMrRobot-Serializer will serialize and communicate character data between users. -local MAJOR, MINOR = "AskMrRobot-Serializer", 60 +local MAJOR, MINOR = "AskMrRobot-Serializer", 61 local Amr, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not Amr then return end -- already loaded by something else
--- a/AskMrRobot.toc Wed Jul 18 13:08:38 2018 -0700 +++ b/AskMrRobot.toc Wed Jul 18 15:19:04 2018 -0700 @@ -1,7 +1,7 @@ ## Interface: 80000 ## Title: Ask Mr. Robot ## Author: Team Robot, Inc. -## Version: 60 +## Version: 61 ## Notes: Gear import/export, combat logging, and more. ## URL: www.askmrrobot.com ## SavedVariables: AskMrRobotDb4
--- a/Shopping.lua Wed Jul 18 13:08:38 2018 -0700 +++ b/Shopping.lua Wed Jul 18 15:19:04 2018 -0700 @@ -210,13 +210,16 @@ panel:AddChild(btn) btn:SetPoint("LEFT", icon.frame, "RIGHT", 5, 0) - Amr.GetItemInfo(itemId, function(obj, name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture) - -- set icon, name, and a tooltip - obj.itemIcon:SetIcon(texture) - obj.itemText:SetText(link:gsub("%[", ""):gsub("%]", "")) - obj.itemText:SetUserData("itemName", name) - Amr:SetItemTooltip(obj.itemText, link) - end, { itemIcon = icon, itemText = btn }) + local item = Item:CreateFromItemID(itemId) + if item then + local itemLink = item:GetItemLink() + if itemLink then + icon:SetIcon(item:GetItemIcon()) + btn:SetText(itemLink:gsub("%[", ""):gsub("%]", "")) + btn:SetUserData("itemName", item:GetItemName()) + Amr:SetItemTooltip(btn, itemLink) + end + end end end @@ -362,7 +365,7 @@ -- compare gear to everything the player owns, and return the minimum gems/enchants/materials needed to optimize, -- grouped by inventory ID so that we can combine multiple specs without double-counting -local function getShoppingData(player, gear, spec) +local function getShoppingData(player, gear) local ret = {} @@ -379,8 +382,7 @@ if not optimalItem.relicBonusIds and (not matchItem or not matchItem.relicBonusIds) then for i = 1, 3 do local g = optimalItem.gemIds[i] - local isGemEquipped = g ~= 0 and matchItem and matchItem.gemIds and matchItem.gemIds[i] == g - + local isGemEquipped = g == 0 or (matchItem and matchItem.gemIds and matchItem.gemIds[i] == g) if not isGemEquipped then if not ret[inventoryId] then ret[inventoryId] = { gems = {}, enchants = {}, materials = {} } @@ -428,9 +430,9 @@ local enchantItemIdToId = {} for i, spec in ipairs(required.specs) do - local gear = Amr.db.char.GearSets[spec] + local gear = Amr.db.char.GearSets[i] if gear then - required.stuff[i] = getShoppingData(player, gear, spec) + required.stuff[i] = getShoppingData(player, gear) else required.stuff[i] = {} end