changeset 3:c5024af04845

Changed some verbage in the display Updated LDB display to hide artifact progress that hasn't been started (as well as that has been completed) Fixed a bug with the LDB icon on load
author Vynn <mischivin@gmail.com>
date Sun, 29 Jan 2017 07:55:39 -0500
parents bcb59f5bceef
children 61a64da6caec
files Spotlight.lua
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Spotlight.lua	Sun Jan 29 07:53:06 2017 -0500
+++ b/Spotlight.lua	Sun Jan 29 07:55:39 2017 -0500
@@ -1,6 +1,6 @@
 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Spotlight", {
 	type = "data source", 
-	text = "Everything Unlocked!", 
+	text = "Nothing to track!", 
 	icon = GetInventoryItemTexture("player", 16),
 	OnClick = function(clickedframe, button)
 		Spotlight.ShowPercent = not Spotlight.ShowPercent;
@@ -77,7 +77,9 @@
 			Spotlight.Status[key].Completed = select(3, GetAchievementCriteriaInfo(value,1));
 			if not Spotlight.Status[key].Completed then
 				Spotlight.Status[key].Progress = Spotlight.Calculate(key);
-				output = output .. string.format(" %.1s", key) .. ":" .. Spotlight.Format(key);
+				if Spotlight.Status[key].Progress > 0 then
+					output = output .. string.format(" %.1s", key) .. ":" .. Spotlight.Format(key);
+				end
 			end
 		end
 		dataobj.icon = GetInventoryItemTexture("player", 16);
@@ -111,7 +113,7 @@
 	if event == "VARIABLES_LOADED" then
 		Initialize();
 	end
-	if event == "CRITERIA_UPDATE" then
+	if event == "CRITERIA_UPDATE" or "PLAYER_ENTERING_WORLD" then
 		Spotlight.Update();
 	end
 end
@@ -119,5 +121,6 @@
 local EventListener = CreateFrame("FRAME", "Spotlight");
 EventListener:RegisterEvent("VARIABLES_LOADED");
 EventListener:RegisterEvent("CRITERIA_UPDATE");
+EventListener:RegisterEvent("PLAYER_ENTERING_WORLD");
 EventListener:SetScript("OnEvent", EventHandler);