Mercurial > wow > worldplan
comparison QuestPOI.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 | 3066f3ef1258 |
| children | 44baf4f35c7c |
comparison
equal
deleted
inserted
replaced
| 51:8f6960d50026 | 52:6439015d74b1 |
|---|---|
| 187 | 187 |
| 188 local GetFactionInfoByID, GetQuestObjectiveInfo = GetFactionInfoByID, GetQuestObjectiveInfo | 188 local GetFactionInfoByID, GetQuestObjectiveInfo = GetFactionInfoByID, GetQuestObjectiveInfo |
| 189 | 189 |
| 190 function QuestPOI:OnEnter() | 190 function QuestPOI:OnEnter() |
| 191 if not WorldMapFrame:IsVisible() then | 191 if not WorldMapFrame:IsVisible() then |
| 192 WorldMap_HijackTooltip(self.owningFrame) | |
| 193 end | 192 end |
| 194 if self.filtered then | 193 if self.filtered then |
| 195 return | 194 return |
| 196 end | 195 end |
| 197 WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT"); | 196 WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT"); |
| 424 self:SetAlpha(db.PinAlpha) | 423 self:SetAlpha(db.PinAlpha) |
| 425 self.Overlay:SetShown(false) | 424 self.Overlay:SetShown(false) |
| 426 end | 425 end |
| 427 | 426 |
| 428 local overlayBaseIndex = 1300 | 427 local overlayBaseIndex = 1300 |
| 429 function QuestPOI:SetAnchor(dX, dY, mapWidth, mapHeight) | 428 function QuestPOI:SetAnchor(owner, dX, dY, mapWidth, mapHeight) |
| 430 local oX, oY = self.x, self.y | 429 local oX, oY = self.x, self.y |
| 431 if not (dX and dY) then | 430 if not (dX and dY) then |
| 432 local dX, dY = TQ_GetQuestLocation(self.questID) | 431 local dX, dY = TQ_GetQuestLocation(self.questID) |
| 433 if not dX or dX == 0 then | 432 if not dX or dX == 0 then |
| 434 local _, x, y = QuestPOIGetIconInfo(self.questID) | 433 local _, x, y = QuestPOIGetIconInfo(self.questID) |
| 438 dX, dY = self.x, self.y | 437 dX, dY = self.x, self.y |
| 439 end | 438 end |
| 440 end | 439 end |
| 441 end | 440 end |
| 442 if not (mapHeight and mapWidth) then | 441 if not (mapHeight and mapWidth) then |
| 443 mapWidth, mapHeight = self:GetParent():GetSize() | 442 mapWidth, mapHeight = owner:GetSize() |
| 444 end | 443 end |
| 445 local pX = (dX * mapWidth) | 444 local pX = (dX * mapWidth) |
| 446 local pY = (-dY * mapHeight) | 445 local pY = (-dY * mapHeight) |
| 447 | 446 |
| 448 | 447 |
| 449 self.x = dX | 448 self.x = dX |
| 450 self.y = dY | 449 self.y = dY |
| 450 self:SetParent(owner) | |
| 451 self:ClearAllPoints() | 451 self:ClearAllPoints() |
| 452 self:SetPoint('CENTER', self:GetParent(), 'TOPLEFT', pX, pY) | 452 self:SetPoint('CENTER', owner, 'TOPLEFT', pX, pY) |
| 453 self:SetShown(self.used) | 453 self:SetShown(self.used) |
| 454 | 454 |
| 455 self.Overlay:SetParent(self.owningFrame) | 455 self.Overlay:SetParent(owner) |
| 456 self.Overlay:ClearAllPoints() | 456 self.Overlay:ClearAllPoints() |
| 457 self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4) | 457 self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4) |
| 458 self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4) | 458 self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4) |
| 459 self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID()) | 459 self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID()) |
| 460 end | 460 end |
| 543 | 543 |
| 544 | 544 |
| 545 | 545 |
| 546 local styleType = (self.isPending and STYLE_TYPE_PENDING) or self.rewardType | 546 local styleType = (self.isPending and STYLE_TYPE_PENDING) or self.rewardType |
| 547 local style,subStyle = self:GetTypeInfo(self.rewardType) | 547 local style,subStyle = self:GetTypeInfo(self.rewardType) |
| 548 if self.filtered and (self.questID ~= GetSuperTrackedQuestID()) then | 548 if (self.filtered or (not self.dataLoaded)) and (self.questID ~= GetSuperTrackedQuestID()) then |
| 549 subStyle = style.minimized | 549 subStyle = style.minimized |
| 550 end | 550 end |
| 551 self.style = style | 551 self.style = style |
| 552 self.subStyle = subStyle | 552 self.subStyle = subStyle |
| 553 --print(style, subStyle) | 553 --print(style, subStyle) |
| 561 local questID = self:GetID() | 561 local questID = self:GetID() |
| 562 local iconBorder = self.RewardBorder | 562 local iconBorder = self.RewardBorder |
| 563 local trackingBorder = self.HighlightBorder | 563 local trackingBorder = self.HighlightBorder |
| 564 local icon = self.icon | 564 local icon = self.icon |
| 565 local count = self.count | 565 local count = self.count |
| 566 local isBounty = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(self.questID) | |
| 566 | 567 |
| 567 if self.itemName then | 568 if self.itemName then |
| 568 | 569 |
| 569 if self.itemNumber and self.itemNumber >= 1000 then | 570 if self.itemNumber and self.itemNumber >= 1000 then |
| 570 local numeral = floor(self.itemNumber/1000) | 571 local numeral = floor(self.itemNumber/1000) |
| 602 icon:SetVertexColor(style.r, style.g, style.b) | 603 icon:SetVertexColor(style.r, style.g, style.b) |
| 603 end | 604 end |
| 604 | 605 |
| 605 iconBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") | 606 iconBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") |
| 606 iconBorder:SetTexture(PENDING_BORDER) | 607 iconBorder:SetTexture(PENDING_BORDER) |
| 607 iconBorder:SetVertexColor(style.r, style.g, style.b, 1) | 608 if isBounty then |
| 609 iconBorder:SetVertexColor(0,.4,.9) | |
| 610 else | |
| 611 iconBorder:SetVertexColor(style.r, style.g, style.b, 1) | |
| 612 end | |
| 613 | |
| 608 iconBorder:SetDesaturated(true) | 614 iconBorder:SetDesaturated(true) |
| 609 iconBorder:SetAlpha(subStyle.alpha or 1) | 615 iconBorder:SetAlpha(subStyle.alpha or 1) |
| 610 | 616 |
| 611 trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") | 617 trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") |
| 612 trackingBorder:SetTexture(PENDING_BORDER) | 618 trackingBorder:SetTexture(PENDING_BORDER) |
| 656 if not self.worldQuest then | 662 if not self.worldQuest then |
| 657 --print('ignoring showable check') | 663 --print('ignoring showable check') |
| 658 return self.used, self.filtered | 664 return self.used, self.filtered |
| 659 end | 665 end |
| 660 self.used = TQ_IsActive(self.questID) | 666 self.used = TQ_IsActive(self.questID) |
| 661 if qType == LE_QUEST_TAG_TYPE_PROFESSION then | 667 if SpellCanTargetQuest() then |
| 668 -- hiding so player can click a valid target | |
| 669 self.used = nil | |
| 670 elseif qType == LE_QUEST_TAG_TYPE_PROFESSION then | |
| 662 if (not self.isKnownProfession) and (db.Config.ShowAllProfessionQuests == false) then | 671 if (not self.isKnownProfession) and (db.Config.ShowAllProfessionQuests == false) then |
| 663 self.used = nil | 672 self.used = nil |
| 664 end | 673 end |
| 665 end | 674 end |
| 666 rprint(' '..self.questID..':|cFFFFFF00IsShowable()|r ', self.used, self.title) | 675 rprint(' '..self.questID..':|cFFFFFF00IsShowable()|r ', self.used, self.title) |
