Mercurial > wow > spotlight-hidden-artifact-skin-tracking
comparison Spotlight.lua @ 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 | defdd6787d6d |
children | 59c355620405 |
comparison
equal
deleted
inserted
replaced
2:bcb59f5bceef | 3:c5024af04845 |
---|---|
1 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Spotlight", { | 1 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Spotlight", { |
2 type = "data source", | 2 type = "data source", |
3 text = "Everything Unlocked!", | 3 text = "Nothing to track!", |
4 icon = GetInventoryItemTexture("player", 16), | 4 icon = GetInventoryItemTexture("player", 16), |
5 OnClick = function(clickedframe, button) | 5 OnClick = function(clickedframe, button) |
6 Spotlight.ShowPercent = not Spotlight.ShowPercent; | 6 Spotlight.ShowPercent = not Spotlight.ShowPercent; |
7 Spotlight.Update(); | 7 Spotlight.Update(); |
8 end, | 8 end, |
75 local output = ""; | 75 local output = ""; |
76 for key, value in pairs(Spotlight.IDs) do | 76 for key, value in pairs(Spotlight.IDs) do |
77 Spotlight.Status[key].Completed = select(3, GetAchievementCriteriaInfo(value,1)); | 77 Spotlight.Status[key].Completed = select(3, GetAchievementCriteriaInfo(value,1)); |
78 if not Spotlight.Status[key].Completed then | 78 if not Spotlight.Status[key].Completed then |
79 Spotlight.Status[key].Progress = Spotlight.Calculate(key); | 79 Spotlight.Status[key].Progress = Spotlight.Calculate(key); |
80 output = output .. string.format(" %.1s", key) .. ":" .. Spotlight.Format(key); | 80 if Spotlight.Status[key].Progress > 0 then |
81 output = output .. string.format(" %.1s", key) .. ":" .. Spotlight.Format(key); | |
82 end | |
81 end | 83 end |
82 end | 84 end |
83 dataobj.icon = GetInventoryItemTexture("player", 16); | 85 dataobj.icon = GetInventoryItemTexture("player", 16); |
84 dataobj.text = output; | 86 dataobj.text = output; |
85 end | 87 end |
109 | 111 |
110 local function EventHandler(self, event, ...) | 112 local function EventHandler(self, event, ...) |
111 if event == "VARIABLES_LOADED" then | 113 if event == "VARIABLES_LOADED" then |
112 Initialize(); | 114 Initialize(); |
113 end | 115 end |
114 if event == "CRITERIA_UPDATE" then | 116 if event == "CRITERIA_UPDATE" or "PLAYER_ENTERING_WORLD" then |
115 Spotlight.Update(); | 117 Spotlight.Update(); |
116 end | 118 end |
117 end | 119 end |
118 | 120 |
119 local EventListener = CreateFrame("FRAME", "Spotlight"); | 121 local EventListener = CreateFrame("FRAME", "Spotlight"); |
120 EventListener:RegisterEvent("VARIABLES_LOADED"); | 122 EventListener:RegisterEvent("VARIABLES_LOADED"); |
121 EventListener:RegisterEvent("CRITERIA_UPDATE"); | 123 EventListener:RegisterEvent("CRITERIA_UPDATE"); |
124 EventListener:RegisterEvent("PLAYER_ENTERING_WORLD"); | |
122 EventListener:SetScript("OnEvent", EventHandler); | 125 EventListener:SetScript("OnEvent", EventHandler); |
123 | 126 |