comparison WorldQuests.lua @ 52:6439015d74b1

- Set and use callbacks for the BountyBoard and ActionButton elements. - Check BountyBoard selections when updating pin visual - Check SpellCanTargetQuest() when determining pin visibility states
author Nenue
date Fri, 30 Dec 2016 18:31:32 -0500
parents dbd81d49af02
children b289eb3e6a32
comparison
equal deleted inserted replaced
51:8f6960d50026 52:6439015d74b1
45 if self.filtersDirty or self.isStale then 45 if self.filtersDirty or self.isStale then
46 self:Refresh() 46 self:Refresh()
47 end 47 end
48 end 48 end
49 49
50 local InternalDoRefresh = function (self)
51 WorldPlanQuests:Refresh(true)
52 end
53
50 function Module:Setup() 54 function Module:Setup()
51 print('|cFFFF4400'..self:GetName()..':Setup()') 55 print('|cFFFF4400'..self:GetName()..':Setup()')
52 56
53 for mapID, mapName in pairs(WORLD_QUEST_MAPS) do 57 for mapID, mapName in pairs(WORLD_QUEST_MAPS) do
54 db.QuestsByZone[mapID] = {} 58 db.QuestsByZone[mapID] = {}
55 end 59 end
56 60
57 hooksecurefunc("ClickWorldMapActionButton", function () self:OnClickWorldMapActionButton() end) 61 hooksecurefunc("ClickWorldMapActionButton", function () self:OnClickWorldMapActionButton() end)
58 hooksecurefunc("WorldMapScrollFrame_ReanchorQuestPOIs", function () self:Refresh() end) 62 hooksecurefunc("WorldMapScrollFrame_ReanchorQuestPOIs", function () self:Refresh() end)
59 hooksecurefunc("WorldMap_UpdateQuestBonusObjectives", function () self:OnUpdateQuestBonusObjectives() end) 63 hooksecurefunc("WorldMap_UpdateQuestBonusObjectives", function () self:OnUpdateQuestBonusObjectives() end)
64
65
66 WorldMapFrame.UIElementsFrame.BountyBoard:SetSelectedBountyChangedCallback(InternalDoRefresh);
67 WorldMapFrame.UIElementsFrame.ActionButton:SetOnCastChangedCallback(InternalDoRefresh);
60 end 68 end
61 69
62 function Module:OnConfigUpdate() 70 function Module:OnConfigUpdate()
63 if db.Config.FadeWhileGrouped then 71 if db.Config.FadeWhileGrouped then
64 db.PinAlpha = 0.15 72 db.PinAlpha = 0.15
455 rprint('|cFF00FF00update|r', x, y, pin.mapID, pin.questID, pin.title) 463 rprint('|cFF00FF00update|r', x, y, pin.mapID, pin.questID, pin.title)
456 464
457 if x and y then 465 if x and y then
458 pin.x = x 466 pin.x = x
459 pin.y = y 467 pin.y = y
460 pin.owningFrame = self.hostFrame
461 pin.throttle = 1 468 pin.throttle = 1
462
463 pin:SetParent(self.hostFrame)
464 pin:SetFrameLevel(PinBaseIndex+pin:GetID()) 469 pin:SetFrameLevel(PinBaseIndex+pin:GetID())
465 pin:SetAnchor(pin.x, pin.y, self.hostWidth, self.hostHeight) 470 pin:SetAnchor(self.hostFrame, pin.x, pin.y, self.hostWidth, self.hostHeight)
466 tinsert(self.UsedPositions, pin) 471 tinsert(self.UsedPositions, pin)
467 end 472 end
468 473
469 if mapID then 474 if mapID then
470 if not db.QuestsByZone[mapID] then 475 if not db.QuestsByZone[mapID] then