Quantcast

Tiny fix for Tooltip Seperator

Xruptor [08-14-16 - 13:26]
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.
Filename
BagSync.lua
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