From 1a6b44c2113d3cbac97ac85d7f5f5bcb9039cf29 Mon Sep 17 00:00:00 2001 From: Darth Predator Date: Sun, 27 Nov 2016 20:56:52 +0300 Subject: [PATCH] Altered item populate function for loc bar dropdown to work like toolbars.lua should now more accurately detect items --- ElvUI_SLE/modules/minimap/locationbar.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ElvUI_SLE/modules/minimap/locationbar.lua b/ElvUI_SLE/modules/minimap/locationbar.lua index cafa903..57f730d 100644 --- a/ElvUI_SLE/modules/minimap/locationbar.lua +++ b/ElvUI_SLE/modules/minimap/locationbar.lua @@ -366,13 +366,17 @@ end function LP:PopulateItems() local noItem = false - if T.select(2, T.GetItemInfo(6948)) == nil then noItem = true end + + for index, data in T.pairs(LP.PortItems) do + if T.select(2, T.GetItemInfo(data[1])) == nil then noItem = true end + end + if noItem then E:Delay(2, LP.PopulateItems) else - for i = 1, #LP.PortItems do - local id, name, toy = T.unpack(LP.PortItems[i]) - LP.PortItems[i] = {text = name or T.GetItemInfo(id), icon = SLE:GetIconFromID("item", id),secure = {buttonType = "item",ID = id, isToy = toy}, UseTooltip = true} + for index, data in T.pairs(LP.PortItems) do + local id, name, toy = data[1], data[2], data[3] + LP.PortItems[index] = {text = name or T.GetItemInfo(id), icon = SLE:GetIconFromID("item", id),secure = {buttonType = "item",ID = id, isToy = toy}, UseTooltip = true} end end end @@ -394,7 +398,6 @@ function LP:ItemList(check) tmp.text = "|cff636363"..tmp.text.."|r"..T.format(LP.CDformats[LP.db.portals.cdFormat], cd) T.tinsert(LP.MainMenu, tmp) else - -- tmp.text = tmp.text T.tinsert(LP.MainMenu, data) end -- 1.7.9.5