changeset 23:4ec7ae897af0 v1.7.2.0

Updated Spotlight's display to support icons - may make it easier to read for some people :) Thanks for the suggestion pros4c!
author Vynn <mischivin@gmail.com>
date Sat, 01 Apr 2017 21:54:13 -0400
parents 708f1d1b81c4
children 8a54373349f5
files Spotlight.lua
diffstat 1 files changed, 27 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Spotlight.lua	Sat Apr 01 21:52:27 2017 -0400
+++ b/Spotlight.lua	Sat Apr 01 21:54:13 2017 -0400
@@ -5,18 +5,28 @@
 	text = "Nothing to track!", 
 	icon = GetInventoryItemTexture("player", 16),
 	OnClick = function(clickedframe, button)
-		Spotlight.ShowPercent = not Spotlight.ShowPercent;
+		if button == "LeftButton" then
+			Spotlight.ShowPercent = not Spotlight.ShowPercent;
+		elseif	button == "RightButton" then
+			Spotlight.ShowIcon = not Spotlight.ShowIcon;
+		end
 		Spotlight.Update();
 	end,
 })
 
 SLASH_SPOTLIGHT1, SLASH_SPOTLIGHT2 = "/spotlight", "/Spotlight";
 
+local ICONS = {
+	PvP = "|T1339312:12:12:0:0:512:128:416:432:42:58|t",
+	Dungeons = "|T1339312:12:12:0:0:512:128:416:432:24:40|t",
+	WorldQuests = "|T1339312:12:12:0:0:512:128:428:444:87:103|t",
+}
+
 local function SlashHandler(msg)
 	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("       |cffe5cc80" .. key .. " - " .. Spotlight.Format(key, false) .. " (" .. Spotlight.Format(key, true) .. ")|r");
+			print("       " .. ICONS[tostring(key)] .. " |cffe5cc80" .. key .. " - " .. Spotlight.Format(key, false) .. " (" .. Spotlight.Format(key, true) .. ")|r");
 		end
 	end
 end
@@ -45,6 +55,7 @@
 			},
 		};
 		Spotlight.ShowPercent = true;
+		Spotlight.ShowIcon = false;
 	end
 
 	Spotlight.IDs = {
@@ -96,15 +107,23 @@
 			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 
+				if output == "" then
+					output = "  "; 
 				else
-					output = output .. " ||";
+					output = output .. "  ||  ";
 				end
 				if Spotlight.Status[key].Progress > 0 then
-					output = output .. string.format("|cffe5cc80 %.1s", key) .. ":|r " .. Spotlight.Format(key, Spotlight.ShowPercent);
+					if Spotlight.ShowIcon then
+						output = output .. ICONS[tostring(key)] .. Spotlight.Format(key, Spotlight.ShowPercent);
+					else
+						output = output .. string.format("|cffe5cc80%.1s", key) .. ":|r " .. Spotlight.Format(key, Spotlight.ShowPercent);
+					end
 				end
 			end
 		end
+		if output == "" then
+			output = "  Everything Unlocked!";
+		end
 
 		dataobj.icon = Spotlight.Icon
 		dataobj.text = output;
@@ -119,10 +138,11 @@
 	self:AddLine("|cffe5cc80Spotlight - Hidden Artifact Skins|r|n|n");
 	for k, v in pairs(Spotlight.IDs) do
 		if not Spotlight.Status[k].Completed then
-			self:AddDoubleLine(k .. ":", Spotlight.Format(k, false) .. " (" .. Spotlight.Format(k, true) .. ")");
+			self:AddDoubleLine(ICONS[tostring(k)] .. " " .. k .. ":", Spotlight.Format(k, false) .. " (" .. Spotlight.Format(k, true) .. ")");
 		end
 	end
-	self:AddLine("|nClick to toggle display method");
+	self:AddLine("|nLeft Click to toggle Percentage or Fractional Display");
+	self:AddLine("|nRight Click to toggle Icon or Text Labels")
 end
 
 function dataobj:OnEnter()