# HG changeset patch # User Nick@Zahhak # Date 1490128572 14400 # Node ID 8e130c92698fd32229365461faa7b89327954919 # Parent abcdef801db5810e39ebf4c6340a0fe22b761013 - Added methods for obtaining pin data, and registering callbacks on data updates. diff -r abcdef801db5 -r 8e130c92698f QuestPOI.lua --- a/QuestPOI.lua Sat Feb 11 14:25:57 2017 -0500 +++ b/QuestPOI.lua Tue Mar 21 16:36:12 2017 -0400 @@ -471,7 +471,7 @@ function QuestPOI:ShowFrames() if not self:IsShown() then - self:SetShown(true) + --self:SetShown(true) print('|cFFFFFF00' ..self:GetName()..':ShowFrames()') qprint('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating) else diff -r abcdef801db5 -r 8e130c92698f WorldPlan.lua --- a/WorldPlan.lua Sat Feb 11 14:25:57 2017 -0500 +++ b/WorldPlan.lua Tue Mar 21 16:36:12 2017 -0400 @@ -354,6 +354,10 @@ wipe(db.ReportChunks) end + if self.dataFlush then + self:FireCallbacks() + end + end function WorldPlanCore:Setup () @@ -556,8 +560,19 @@ -------------------------------------------------------------------------------------------------------------------- ------------------- - - +function WorldPlanCore:GetQuestPins(zoneID) + return db.UsedPins +end +function WorldPlanCore:RegisterDataCallback(func) + self.callbacks = self.callbacks or {} + self.callbacks[func] = func +end +function WorldPlanCore:FireCallbacks() + for func in pairs(self.callbacks) do + func() + end + self.dataFlush = nil +end diff -r abcdef801db5 -r 8e130c92698f WorldQuests.lua --- a/WorldQuests.lua Sat Feb 11 14:25:57 2017 -0500 +++ b/WorldQuests.lua Tue Mar 21 16:36:12 2017 -0400 @@ -247,6 +247,7 @@ if (not pin.dataLoaded) then pin:GetData() + WorldPlan.dataFlush = true end pin:CheckFilterRules() @@ -272,6 +273,7 @@ pin:HideFrames() tinsert(db.FreePins, pin) + WorldPlan.dataFlush = true print('|cFF00FF00-'.. (pin.mapID and GetMapNameByID(pin.mapID) or '???') ..'|r', id, pin.title) end @@ -429,6 +431,7 @@ if self.isStale and self:IsVisible() then self:Refresh() end + end function Module:Report()