Mercurial > wow > worldplan
comparison FilterBar.lua @ 45:db570c6a0ffb v1.0-rc12
- Fixed filter buttons losing their anchor after FlightMap interactions
- Fixed flickering tooltips
- Fixed a source of hangs while opening the world map, particularly in non-Broken-Isle continents.
- Workaround for World Map Action Button: Temporarily activate blizzard POI buttons while a quest-targeting spell is on the cursor.
| author | Nenue |
|---|---|
| date | Mon, 26 Dec 2016 10:20:52 -0500 |
| parents | 77c2ffb5c7f5 |
| children | 54aa7f8ebca8 |
comparison
equal
deleted
inserted
replaced
| 44:59e9d66195dd | 45:db570c6a0ffb |
|---|---|
| 72 Module.cvarFiltersDirty = false | 72 Module.cvarFiltersDirty = false |
| 73 WorldPlanFilterPinMixin = {} | 73 WorldPlanFilterPinMixin = {} |
| 74 local Pin = WorldPlanFilterPinMixin | 74 local Pin = WorldPlanFilterPinMixin |
| 75 | 75 |
| 76 function Module:OnLoad() | 76 function Module:OnLoad() |
| 77 self:SetParent(WorldMapFrame) | 77 self:SetParent(WorldMapFrame.UIElementsFrame) |
| 78 self:ClearAllPoints() | |
| 79 self:SetPoint('TOPRIGHT') | |
| 78 WorldPlan:AddHandler(self) | 80 WorldPlan:AddHandler(self) |
| 79 for index, info in ipairs(db.DefaultFilters) do | 81 for index, info in ipairs(db.DefaultFilters) do |
| 80 info.zone = db.DefaultFilterType | 82 info.zone = db.DefaultFilterType |
| 81 info.continent = db.DefaultFilterType | 83 info.continent = db.DefaultFilterType |
| 82 info.pinMask = "Interface\\Minimap\\UI-Minimap-Background" | 84 info.pinMask = "Interface\\Minimap\\UI-Minimap-Background" |
| 83 WorldPlan:AddTypeInfo(self,index, info) | 85 WorldPlan:AddTypeInfo(self,index, info) |
| 84 end | 86 end |
| 85 | |
| 86 end | 87 end |
| 87 | 88 |
| 88 | 89 |
| 89 function Module:OnEvent(event) | 90 function Module:OnEvent(event) |
| 90 print('|cFF00FF88'..self:GetName()..':OnEvent()', event) | 91 print('|cFF00FF88'..self:GetName()..':OnEvent()', event) |
| 94 local bountyIndex | 95 local bountyIndex |
| 95 local debug_headers = {} | 96 local debug_headers = {} |
| 96 | 97 |
| 97 function Module:Setup() | 98 function Module:Setup() |
| 98 print('|cFF00FF88'..self:GetName()..':Setup()') | 99 print('|cFF00FF88'..self:GetName()..':Setup()') |
| 100 self.isStale = true | |
| 99 end | 101 end |
| 100 | 102 |
| 101 | 103 |
| 102 function Module:OnUpdate() | 104 function Module:OnUpdate() |
| 103 if self.isStale then | 105 if self.isStale then |
| 169 | 171 |
| 170 local questResults = {{}} | 172 local questResults = {{}} |
| 171 function Module:Update() | 173 function Module:Update() |
| 172 local blocks = self.buttons | 174 local blocks = self.buttons |
| 173 | 175 |
| 174 local relativeFrame = WorldMapFrame.UIElementsFrame.TrackingOptionsButton | 176 local relativeFrame = self |
| 175 if FlightMapFrame and FlightMapFrame:IsVisible() then | |
| 176 relativeFrame = FlightMapFrame | |
| 177 end | |
| 178 self:SetParent(relativeFrame) | |
| 179 self:SetPoint('TOPRIGHT') | |
| 180 | 177 |
| 181 local numHeaders = 0 | 178 local numHeaders = 0 |
| 182 print('|cFF00FF88'..self:GetName()..':Update()|r', 'currentMap=',WorldPlan.currentMapID) | 179 print('|cFF00FF88'..self:GetName()..':Update()|r', 'currentMap=',WorldPlan.currentMapID) |
| 183 | 180 |
| 184 | 181 |
| 192 local numQuestsTotal = 0 | 189 local numQuestsTotal = 0 |
| 193 info.questList = info.questList or {} | 190 info.questList = info.questList or {} |
| 194 wipe(info.questList) | 191 wipe(info.questList) |
| 195 | 192 |
| 196 for questID, pin in pairs(db.QuestsByID) do | 193 for questID, pin in pairs(db.QuestsByID) do |
| 197 print(pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION, (db.Config.ShowAllProfessionQuests or pin.isKnownProfession)) | 194 --print(pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION, (db.Config.ShowAllProfessionQuests or pin.isKnownProfession)) |
| 198 if (pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION) or (db.Config.ShowAllProfessionQuests or pin.isKnownProfession) then | 195 if (pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION) or (db.Config.ShowAllProfessionQuests or pin.isKnownProfession) then |
| 199 print(pin.title) | 196 --print(pin.title) |
| 200 if not info.filterKey then | 197 if not info.filterKey then |
| 201 if mapQuests[questID] then | 198 if mapQuests[questID] then |
| 202 numQuestsHere = numQuestsHere + 1 | 199 numQuestsHere = numQuestsHere + 1 |
| 203 end | 200 end |
| 204 numQuestsTotal = numQuestsTotal + 1 | 201 numQuestsTotal = numQuestsTotal + 1 |
| 301 self.count:SetText(self.numQuestsHere) | 298 self.count:SetText(self.numQuestsHere) |
| 302 self.cVar = info.cVar | 299 self.cVar = info.cVar |
| 303 | 300 |
| 304 self.itemTexture = self.texture | 301 self.itemTexture = self.texture |
| 305 | 302 |
| 303 self:ClearAllPoints() | |
| 306 if self.isFirst then | 304 if self.isFirst then |
| 307 if FlightMapFrame and FlightMapFrame:IsVisible() then | 305 self:SetPoint('TOPRIGHT', self.relativeFrame, 'TOPRIGHT', -5, -42) |
| 308 self:SetPoint('TOPRIGHT', FlightMapFrame, 'TOPRIGHT', -4, -25) | |
| 309 else | |
| 310 self:SetPoint('TOP', self.relativeFrame, 'BOTTOM', 0, -5) | |
| 311 end | |
| 312 | |
| 313 else | 306 else |
| 314 self:SetPoint('TOPRIGHT', self.relativeFrame, 'BOTTOMRIGHT', 0, -(self.spacing or 0)) | 307 self:SetPoint('TOPLEFT', self.relativeFrame, 'BOTTOMLEFT', 0, -(self.spacing or 0)) |
| 315 end | 308 end |
| 316 print('anchor to', self.relativeFrame:GetName(), info.mask) | 309 print('anchor', self.relativeFrame:IsShown(), self:GetPoint(1)) |
| 317 | 310 |
| 318 self.icon:SetDesaturated(self.numQuestsHere == 0) | 311 self.icon:SetDesaturated(self.numQuestsHere == 0) |
| 319 | 312 |
| 320 local r, g, b, a = 0,0,0,1 | 313 local r, g, b, a = 0,0,0,1 |
| 321 local desaturated = false | 314 local desaturated = false |
