From 2c6cb0bc74ed15aec185e8cf0a58841311c89d9e Mon Sep 17 00:00:00 2001 From: Xruptor Date: Sun, 14 Aug 2016 09:26:42 -0400 Subject: [PATCH] Tiny fix for Tooltip Seperator -Minor fix to address certain situations where the tooltip separator adds an additional line to the tooltip when there is nothing to report. Causing the tooltip to bounce up and down as it removes then adds the tooltip separator constantly. -This issue is mostly related to items whom display that "You haven't collected this appearance yet" notification. --- BagSync.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/BagSync.lua b/BagSync.lua index 46217dd..59d627a 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -942,10 +942,12 @@ local function AddItemToTooltip(frame, link) --workaround --lag check (check for previously displayed data) if so then display it if lastItem and itemLink and itemLink == lastItem then - for i = 1, #lastDisplayed do - local ename, ecount = strsplit('@', lastDisplayed[i]) - if ename and ecount then - frame:AddDoubleLine(ename, ecount) + if table.getn(lastDisplayed) > 0 then + for i = 1, #lastDisplayed do + local ename, ecount = strsplit('@', lastDisplayed[i]) + if ename and ecount then + frame:AddDoubleLine(ename, ecount) + end end end frame:Show() @@ -1068,10 +1070,12 @@ local function AddItemToTooltip(frame, link) --workaround end --add it all together now - for i = 1, #lastDisplayed do - local ename, ecount = strsplit('@', lastDisplayed[i]) - if ename and ecount then - frame:AddDoubleLine(ename, ecount) + if table.getn(lastDisplayed) > 0 then + for i = 1, #lastDisplayed do + local ename, ecount = strsplit('@', lastDisplayed[i]) + if ename and ecount then + frame:AddDoubleLine(ename, ecount) + end end end -- 1.7.9.5