Mercurial > wow > worldplan
comparison WorldPlan.lua @ 63:8e130c92698f
- Added methods for obtaining pin data, and registering callbacks on data updates.
| author | Nick@Zahhak |
|---|---|
| date | Tue, 21 Mar 2017 16:36:12 -0400 |
| parents | abcdef801db5 |
| children | 876c3f0bfd0e |
comparison
equal
deleted
inserted
replaced
| 62:abcdef801db5 | 63:8e130c92698f |
|---|---|
| 352 | 352 |
| 353 DEFAULT_CHAT_FRAME:AddMessage("|cFF0088FF"..addonFileName.."|r: " .. table.concat(db.ReportChunks, ', ')) | 353 DEFAULT_CHAT_FRAME:AddMessage("|cFF0088FF"..addonFileName.."|r: " .. table.concat(db.ReportChunks, ', ')) |
| 354 wipe(db.ReportChunks) | 354 wipe(db.ReportChunks) |
| 355 end | 355 end |
| 356 | 356 |
| 357 if self.dataFlush then | |
| 358 self:FireCallbacks() | |
| 359 end | |
| 360 | |
| 357 end | 361 end |
| 358 | 362 |
| 359 function WorldPlanCore:Setup () | 363 function WorldPlanCore:Setup () |
| 360 print('|cFFFFFF00'..self:GetName()..':Setup()|r') | 364 print('|cFFFFFF00'..self:GetName()..':Setup()|r') |
| 361 | 365 |
| 554 end | 558 end |
| 555 | 559 |
| 556 | 560 |
| 557 -------------------------------------------------------------------------------------------------------------------- | 561 -------------------------------------------------------------------------------------------------------------------- |
| 558 ------------------- | 562 ------------------- |
| 559 | 563 function WorldPlanCore:GetQuestPins(zoneID) |
| 560 | 564 return db.UsedPins |
| 565 end | |
| 566 function WorldPlanCore:RegisterDataCallback(func) | |
| 567 self.callbacks = self.callbacks or {} | |
| 568 self.callbacks[func] = func | |
| 569 end | |
| 570 function WorldPlanCore:FireCallbacks() | |
| 571 for func in pairs(self.callbacks) do | |
| 572 func() | |
| 573 end | |
| 574 self.dataFlush = nil | |
| 575 end | |
| 561 | 576 |
| 562 | 577 |
| 563 | 578 |
| 564 | 579 |
| 565 | 580 |
