comparison QuestPOI.lua @ 62:abcdef801db5

- more region hiding fixes
author Nick@Zahhak
date Sat, 11 Feb 2017 14:25:57 -0500
parents a133ee697ca2
children 8e130c92698f
comparison
equal deleted inserted replaced
61:a133ee697ca2 62:abcdef801db5
258 end 258 end
259 end 259 end
260 end 260 end
261 WorldMap_AddQuestRewardsToTooltip(questID) 261 WorldMap_AddQuestRewardsToTooltip(questID)
262 262
263 self.MouseGlow:Show()
264 WorldMapTooltip:Show() 263 WorldMapTooltip:Show()
265 --WorldMapTooltip.recalculatePadding = true; 264 --WorldMapTooltip.recalculatePadding = true;
266 --print(WorldMapTooltip:GetParent()) 265 --print(WorldMapTooltip:GetParent())
267 --print(WorldMapTooltip:IsVisible()) 266 --print(WorldMapTooltip:IsVisible())
268 end 267 end
269 function QuestPOI:OnLeave() 268 function QuestPOI:OnLeave()
270 if self.filtered and (self.questID ~= GetSuperTrackedQuestID()) then 269 if self.filtered and (self.questID ~= GetSuperTrackedQuestID()) then
271 return 270 return
272 end 271 end
273 WorldMap_RestoreTooltip() 272 WorldMap_RestoreTooltip()
274 self.MouseGlow:Hide()
275 WorldMapTooltip:Hide(); 273 WorldMapTooltip:Hide();
276 end 274 end
277 275
278 -- attempt to pull pin data 276 -- attempt to pull pin data
279 local GetQuestTagInfo, GetProfessionInfo = GetQuestTagInfo, GetProfessionInfo 277 local GetQuestTagInfo, GetProfessionInfo = GetQuestTagInfo, GetProfessionInfo
419 qprint('|cFF0088FFflagged for refresh') 417 qprint('|cFF0088FFflagged for refresh')
420 self:Refresh() 418 self:Refresh()
421 end 419 end
422 420
423 if self.isNew or (not self.Overlay:IsShown()) then 421 if self.isNew or (not self.Overlay:IsShown()) then
424 qprint('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating)
425 --qprint('|cFFFFFF00popping new pin handler') 422 --qprint('|cFFFFFF00popping new pin handler')
426 self:StartFade() 423 self:StartFade()
427 end 424 end
428 425
429 if not self.isAnimating then 426 if not self.isAnimating then
430 self:SetAlpha(db.PinAlpha) -- fix stuck alpha 427 self:SetAlpha(db.PinAlpha) -- fix stuck alpha
431 end 428 end
432 if self.used then 429
433 self.Overlay:SetShown(true) 430 self:ShowFrames()
434 end 431 end
435 432
436 end
437 function QuestPOI:OnHide() 433 function QuestPOI:OnHide()
438 --DEFAULT_CHAT_FRAME:AddMessage('|cFFFFFF00'..self:GetName()..'|r:OnHide()') 434 --DEFAULT_CHAT_FRAME:AddMessage('|cFFFFFF00'..self:GetName()..'|r:OnHide()')
439 self.Overlay:SetShown(false) 435 self:HideFrames()
440 self.Overlay:SetShown(false)
441 self.timeLabel:SetShown(false)
442
443 -- reset flags 436 -- reset flags
444 self:SetAlpha(db.PinAlpha) 437 self:SetAlpha(db.PinAlpha)
445 self.isAnimating = nil 438 self.isAnimating = nil
446 end 439 end
447 440
448 -- different from owningFrame 441 -- different from owningFrame
449 function QuestPOI:SetAnchor(owner, dX, dY, mapWidth, mapHeight) 442 function QuestPOI:SetAnchor(owner, dX, dY, mapWidth, mapHeight)
450 wqprint(self:GetName()..':SetAnchor', self.filtered, self.used) 443 wqprint(self:GetName()..':SetAnchor()', owner, dX, dY, self.filtered, self.used)
444 if not self.used then
445 self:HideFrames()
446 return
447 end
448
449
451 self:SetParent(owner) 450 self:SetParent(owner)
452 self:ClearAllPoints() 451 self:ClearAllPoints()
453 self:SetFrameLevel(pinBaseIndex + self:GetID()) 452 self:SetFrameLevel(pinBaseIndex + self:GetID())
454 self.Overlay:SetParent(owner) 453 self.Overlay:SetParent(owner)
455 self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID()) 454 self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID())
463 self.y = dY 462 self.y = dY
464 self:SetPoint('CENTER', owner, 'TOPLEFT', pX, pY) 463 self:SetPoint('CENTER', owner, 'TOPLEFT', pX, pY)
465 else 464 else
466 self:SetPoint('CENTER') 465 self:SetPoint('CENTER')
467 end 466 end
468 self:SetShown(self.used) 467
468 self:ShowFrames()
469 end
470
471
472 function QuestPOI:ShowFrames()
473 if not self:IsShown() then
474 self:SetShown(true)
475 print('|cFFFFFF00' ..self:GetName()..':ShowFrames()')
476 qprint('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating)
477 else
478
479 --print(self:GetName()..':ShowFrames()')
480 end
481 self.count:SetShown(true)
482 self.Overlay:SetShown(true)
483 self.count:SetShown(true)
484 self.timeLabel:SetShown(true)
485 end
486
487 function QuestPOI:HideFrames()
488 if self:IsShown() then
489 print(self:GetName()..':HideFrames()')
490 self:SetShown(false)
491 end
492 self.count:SetShown(false)
493 self.Overlay:SetShown(false)
494 self.count:SetShown(false)
495 self.timeLabel:SetShown(false)
496 self.used = nil
469 end 497 end
470 498
471 function QuestPOI:OnLoad() 499 function QuestPOI:OnLoad()
472 qprint('|cFF00FF88'..self:GetName()..':OnLoad()|r',db.Config) 500 qprint('|cFF00FF88'..self:GetName()..':OnLoad()|r',db.Config)
473 self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED') 501 self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED')
474 502
475 self.title = '|cFF0088FF' .. RETRIEVING_DATA..'|r' 503 self.title = '|cFF0088FF' .. RETRIEVING_DATA..'|r'
476 self.isPending = true 504 self.isPending = true
477 self.count = self.Overlay.count 505 self.count = self.Overlay.count
506 self.timeLabel = self.Overlay.timeLabel
478 self.Description = self.Overlay.Description 507 self.Description = self.Overlay.Description
479 self.timeLabel = self.Overlay.timeLabel
480 self.updateRate = PIN_REQUEST_DELAY 508 self.updateRate = PIN_REQUEST_DELAY
481 self.itemName = '|cFF0088FF' .. RETRIEVING_DATA..'|r' 509 self.itemName = '|cFF0088FF' .. RETRIEVING_DATA..'|r'
482 510
483 self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4) 511 self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4)
484 self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4) 512 self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4)
547 tl = timeState 575 tl = timeState
548 self.timeLabel:SetText(text) 576 self.timeLabel:SetText(text)
549 end 577 end
550 else 578 else
551 if self.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION then 579 if self.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION then
552 self:SetShown(false) 580 self:HideFrames()
553 end 581 end
554 end 582 end
555 583
556 if tl and (timeLeft < 120) then 584 if tl and (timeLeft < 120) then
557 self.HighlightBorder:SetVertexColor(1,0,0,0.7) 585 self.HighlightBorder:SetVertexColor(1,0,0,0.7)
564 self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1)) 592 self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1))
565 else 593 else
566 if not self.completed then 594 if not self.completed then
567 self.completed = true 595 self.completed = true
568 WorldPlan:print('|cFFFFFF00'..tostring(self.title).. '|r is no longer active.') 596 WorldPlan:print('|cFFFFFF00'..tostring(self.title).. '|r is no longer active.')
569 self:SetShown(false) 597 self:HideFrames()
570 self.Overlay:SetShown(false) 598 end
571 self.timeLabel:SetShown(false)
572 end
573
574 end 599 end
575 end 600 end
576 601
577 function QuestPOI:Refresh () 602 function QuestPOI:Refresh ()
578 603
759 784
760 iconBorder:SetPoint('CENTER', (style.x or 0), (style.y or 0)) 785 iconBorder:SetPoint('CENTER', (style.x or 0), (style.y or 0))
761 trackingBorder:SetPoint('CENTER', (style.x or 0), (style.y or 0)) 786 trackingBorder:SetPoint('CENTER', (style.x or 0), (style.y or 0))
762 787
763 788
764 if style.hasNumeric then 789 if (subStyle.showNumber and self.itemNumber) and style.hasNumeric then
765 self.count:SetTextColor(unpack(style.numberRGB)) 790 self.count:SetTextColor(unpack(style.numberRGB))
766 if subStyle.numberFontObject then 791 if subStyle.numberFontObject then
767 --wqprint('change font', _G[subStyle.numberFontObject]:GetName()) 792 --wqprint('change font', _G[subStyle.numberFontObject]:GetName())
768 self.count:SetFontObject(_G[subStyle.numberFontObject]) 793 self.count:SetFontObject(_G[subStyle.numberFontObject])
769 end 794 end
770 end 795 else
771 796 self.count:SetText(nil)
772 self.count:SetShown((subStyle.showNumber and self.itemNumber) and style.hasNumeric) 797 end
773 798 end
774
775 end