changeset 26:6c495455f069

Fixed a bug in the LDB display for completed skins (thanks pros4c for catching!). Changed the way unlocked skins are displayed in most circumstances.
author Vynn <mischivin@gmail.com>
date Sun, 02 Apr 2017 14:22:45 -0400
parents 2a0df868533a
children 915a2b4cd5d5
files Spotlight.lua
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Spotlight.lua	Sun Apr 02 14:20:40 2017 -0400
+++ b/Spotlight.lua	Sun Apr 02 14:22:45 2017 -0400
@@ -26,7 +26,11 @@
 	print("|T" .. Spotlight.Icon .. ":0|t |cffe5cc80Spotlight|r - Artifact Hidden Skin Progress:");
 	if Spotlight.IDs then
 		for key, value in pairs(Spotlight.IDs) do
-			print("       " .. ICONS[tostring(key)] .. " |cffe5cc80" .. key .. " - " .. Spotlight.Format(key, false) .. " (" .. Spotlight.Format(key, true) .. ")|r");
+			if not Spotlight.Status[key].Completed then 
+				print("       " .. ICONS[tostring(key)] .. " |cffe5cc80" .. key .. " - " .. Spotlight.Format(key, false) .. " (" .. Spotlight.Format(key, true) .. ")|r");
+			else
+				print("       " .. ICONS[tostring(key)] .. " |cffe5cc80" .. key .. " - |cff00ff00Completed!|r");
+			end
 		end
 	end
 end
@@ -107,12 +111,12 @@
 			Spotlight.Status[key].Completed = select(3, GetAchievementCriteriaInfo(value,1));
 			if not Spotlight.Status[key].Completed then
 				Spotlight.Status[key].Progress = Spotlight.Calculate(key);
-				if output == "" then
-					output = "  "; 
-				else
-					output = output .. "  ||  ";
-				end
-				if Spotlight.Status[key].Progress > 0 then
+				if Spotlight.Status[key].Progress >= 0 then
+					if output == "" then
+						output = "  "; 
+					else
+						output = output .. "  ||  ";
+					end
 					if Spotlight.ShowIcon then
 						output = output .. ICONS[tostring(key)] .. Spotlight.Format(key, Spotlight.ShowPercent);
 					else
@@ -122,7 +126,7 @@
 			end
 		end
 		if output == "" then
-			output = "  Everything Unlocked!";
+			output = "  |cff00ff00All Hidden Skins Unlocked!|r";
 		end
 
 		dataobj.icon = Spotlight.Icon
@@ -139,6 +143,9 @@
 	for k, v in pairs(Spotlight.IDs) do
 		if not Spotlight.Status[k].Completed then
 			self:AddDoubleLine(ICONS[tostring(k)] .. " " .. k .. ":", Spotlight.Format(k, false) .. " (" .. Spotlight.Format(k, true) .. ")");
+		else
+			self:AddDoubleLine(ICONS[tostring(k)] .. " " .. k .. ":", "|cff00ff00Completed!|r";
+
 		end
 	end
 	self:AddLine("|nLeft Click to toggle Percentage or Fractional Display");