Mercurial > wow > worldplan
comparison WorldPlan.lua @ 31:d0114b51cdea
WorldPlan:
- Reworking filters to utilize newly added CVars
- Fleshed out POI tooltip for WQ's associated with Family Familiars
- Filter button tooltip includes reward icons
- Respond to tracking menu clicks when they change filter options
| author | Nenue |
|---|---|
| date | Fri, 28 Oct 2016 19:54:00 -0400 |
| parents | 8cb750e79952 |
| children | e8679ecb48d8 |
comparison
equal
deleted
inserted
replaced
| 30:8cb750e79952 | 31:d0114b51cdea |
|---|---|
| 90 TimeleftStage = 3, | 90 TimeleftStage = 3, |
| 91 showNumber = true, | 91 showNumber = true, |
| 92 numberFontObject = 'WorldPlanNumberFontThin' | 92 numberFontObject = 'WorldPlanNumberFontThin' |
| 93 }, | 93 }, |
| 94 minimized = { | 94 minimized = { |
| 95 PinSize = 4, | 95 PinSize = 6, |
| 96 Border = 0, | 96 Border = 0, |
| 97 TrackingBorder = 1, | 97 TrackingBorder = 1, |
| 98 NoIcon = true, | 98 NoIcon = true, |
| 99 TimeleftStage = 1, | 99 TimeleftStage = 1, |
| 100 showNumber = false, | 100 showNumber = false, |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 | 104 |
| 105 local POI_FILTER_STYLE = setmetatable({ | |
| 106 continentBorder = 2, | |
| 107 zoneBorder = 2, | |
| 108 }, {__index = DEFAULT_TYPE}) | |
| 109 | 105 |
| 110 | 106 |
| 111 local defaults = { | 107 local defaults = { |
| 112 defaultPinStyle = POI_DEFAULT_TYPE, | |
| 113 rewardStyle = POI_REWARD_TYPE, | |
| 114 filterStyle = POI_FILTER_STYLE, | |
| 115 ShowAllProfessionQuests = false, | 108 ShowAllProfessionQuests = false, |
| 116 DisplayContinentSummary = true, | 109 DisplayContinentSummary = true, |
| 117 DisplayContinentPins = true, | 110 DisplayContinentPins = true, |
| 118 NotifyWhenNewQuests = true, | 111 NotifyWhenNewQuests = true, |
| 119 EnablePins = true, | 112 EnablePins = true, |
| 132 local LE_QUEST_TAG_TYPE_PVP = LE_QUEST_TAG_TYPE_PVP | 125 local LE_QUEST_TAG_TYPE_PVP = LE_QUEST_TAG_TYPE_PVP |
| 133 local LE_QUEST_TAG_TYPE_PET_BATTLE = LE_QUEST_TAG_TYPE_PET_BATTLE | 126 local LE_QUEST_TAG_TYPE_PET_BATTLE = LE_QUEST_TAG_TYPE_PET_BATTLE |
| 134 local LE_QUEST_TAG_TYPE_DUNGEON = LE_QUEST_TAG_TYPE_DUNGEON | 127 local LE_QUEST_TAG_TYPE_DUNGEON = LE_QUEST_TAG_TYPE_DUNGEON |
| 135 local LE_QUEST_TAG_TYPE_PROFESSION = LE_QUEST_TAG_TYPE_PROFESSION | 128 local LE_QUEST_TAG_TYPE_PROFESSION = LE_QUEST_TAG_TYPE_PROFESSION |
| 136 local LE_QUEST_TAG_TYPE_NORMAL = LE_QUEST_TAG_TYPE_NORMAL | 129 local LE_QUEST_TAG_TYPE_NORMAL = LE_QUEST_TAG_TYPE_NORMAL |
| 137 local POI_FILTER_OPTIONS = { | |
| 138 { label = 'Filters', texture = "Interface\\WorldMap\\WorldMap-Icon" }, | |
| 139 { filterKey= 'rewardType', filterValue = REWARD_ARTIFACT_POWER, label = 'Artifact Power', texture = "Interface\\ICONS\\inv_7xp_inscription_talenttome01" }, | |
| 140 { filterKey= 'rewardType', filterValue = REWARD_CURRENCY,label = 'Order Resources', texture = "Interface\\ICONS\\inv_misc_elvencoins" }, | |
| 141 { filterKey= 'rewardType', filterValue = REWARD_GEAR, label = 'Equipment', texture = "Interface\\ICONS\\garrison_bluearmorupgrade" }, | |
| 142 { filterKey= 'rewardType', filterValue = REWARD_REAGENT, label = 'Materials', texture = 1417744 }, | |
| 143 { filterKey= 'rewardType', filterValue = REWARD_CASH, label = 'Gold', texture = ICON_MONEY }, | |
| 144 { filterKey= 'worldQuestType', filterValue = LE_QUEST_TAG_TYPE_PVP, label = 'PvP', texture = "Interface\\Icons\\Ability_PVP_GladiatorMedallion", spacing = 10 }, | |
| 145 { filterKey= 'worldQuestType', filterValue = LE_QUEST_TAG_TYPE_PET_BATTLE, label = 'Pet Battle', texture = "Interface\\Icons\\PetJournalPortrait", }, | |
| 146 { filterKey= 'worldQuestType', filterValue = LE_QUEST_TAG_TYPE_DUNGEON, label = 'Dungeon', texture = "Interface\\LFGFRAME\\UI-LFR-PORTRAIT", }, | |
| 147 { filterKey= 'worldQuestType', filterValue = LE_QUEST_TAG_TYPE_PROFESSION, label = 'Profession', texture = "Interface\\ICONS\\70_professions_scroll_02", }, | |
| 148 } | |
| 149 WorldPlanCore.BrokenIsleID = BROKEN_ISLES_ID | 130 WorldPlanCore.BrokenIsleID = BROKEN_ISLES_ID |
| 150 WorldPlanCore.FilterStyle = POI_FILTER_STYLE | 131 WorldPlanCore.FilterStyle = POI_FILTER_STYLE |
| 151 | 132 |
| 152 WorldPlanCore.FilterOptions = {} | 133 WorldPlanCore.FilterOptions = {} |
| 153 WorldPlanCore.UsedFilters = {} | 134 WorldPlanCore.UsedFilters = {} |
| 414 print('|cFFFFFF00'..self:GetName()..':Refresh()|r forced:', forced, 'init:', self.initialized) | 395 print('|cFFFFFF00'..self:GetName()..':Refresh()|r forced:', forced, 'init:', self.initialized) |
| 415 if not self.initialized then | 396 if not self.initialized then |
| 416 return | 397 return |
| 417 end | 398 end |
| 418 | 399 |
| 419 POI_DEFAULT_TYPE = db.defaultPinStyle | |
| 420 POI_REWARD_TYPE = db.rewardStyle | |
| 421 POI_FILTER_STYLE = db.filterStyle | |
| 422 | |
| 423 | |
| 424 for i, module in ipairs(self.modules) do | 400 for i, module in ipairs(self.modules) do |
| 425 if module.Reset then | 401 if module.Reset then |
| 426 print(module, 'Reset()') | 402 print(module, 'Reset()') |
| 427 module:Reset() | 403 module:Reset() |
| 428 end | 404 end |
| 547 button:Hide() | 523 button:Hide() |
| 548 end | 524 end |
| 549 end | 525 end |
| 550 end) | 526 end) |
| 551 | 527 |
| 528 hooksecurefunc("WorldMapTrackingOptionsDropDown_OnClick", function(button) | |
| 529 print("|cFF0088FFWorldMapTrackingOptionsDropDown_OnClick|r") | |
| 530 local value = button.value | |
| 531 if (value == "worldQuestFilterOrderResources" or value == "worldQuestFilterArtifactPower" or | |
| 532 value == "worldQuestFilterProfessionMaterials" or value == "worldQuestFilterGold" or | |
| 533 value == "worldQuestFilterEquipment") then | |
| 534 self:Refresh(true) | |
| 535 end | |
| 536 end) | |
| 552 end | 537 end |
| 553 | 538 |
| 554 local defaults = {} | 539 local defaults = {} |
| 555 function WorldQuests:OnLoad() | 540 function WorldQuests:OnLoad() |
| 556 print('|cFF00FF88'..self:GetName()..':OnLoad') | 541 print('|cFF00FF88'..self:GetName()..':OnLoad') |
| 763 | 748 |
| 764 if pins then | 749 if pins then |
| 765 local hostFrame = WorldMapPOIFrame | 750 local hostFrame = WorldMapPOIFrame |
| 766 local mapWidth, mapHeight = hostFrame:GetSize() | 751 local mapWidth, mapHeight = hostFrame:GetSize() |
| 767 for questID, pin in pairs(pins) do | 752 for questID, pin in pairs(pins) do |
| 768 pin.hasUpdate = true | |
| 769 pin:IsShowable() | 753 pin:IsShowable() |
| 770 if pin.used then | 754 if pin.used then |
| 755 pin.hasUpdate = true | |
| 771 pin:SetFrameLevel(PinBaseIndex+ (pin.whiteListed and 200 or 0) +numPins) | 756 pin:SetFrameLevel(PinBaseIndex+ (pin.whiteListed and 200 or 0) +numPins) |
| 772 print('level', PinBaseIndex+ (pin.whiteListed and 200 or 0) +numPins) | 757 print('level', PinBaseIndex+ (pin.whiteListed and 200 or 0) +numPins) |
| 773 pin:SetAnchor(WorldMapPOIFrame, currentMap, mapWidth, mapHeight) | 758 pin:SetAnchor(WorldMapPOIFrame, currentMap, mapWidth, mapHeight) |
| 774 numPins = numPins + 1 | 759 numPins = numPins + 1 |
| 775 end | 760 end |
| 909 self.filtered = nil | 894 self.filtered = nil |
| 910 self.used = true | 895 self.used = true |
| 911 | 896 |
| 912 print(' |cFFFF4400IsShowable()|r', self.title) | 897 print(' |cFFFF4400IsShowable()|r', self.title) |
| 913 | 898 |
| 914 if not self.passesBlizzFilters then | 899 self.questId = self:GetID() |
| 900 if not (WorldMap_DoesWorldQuestInfoPassFilters(self)) then | |
| 915 self.filtered = true | 901 self.filtered = true |
| 916 end | 902 end |
| 903 | |
| 904 for filterKey, value in pairs(WorldPlan.UsedFilters) do | |
| 905 if self[filterKey] ~= value then | |
| 906 self.filtered = true | |
| 907 end | |
| 908 end | |
| 909 | |
| 917 if not TQ_IsActive(self.questID) then | 910 if not TQ_IsActive(self.questID) then |
| 918 self.used = nil | 911 self.used = nil |
| 919 elseif qType == LE_QUEST_TAG_TYPE_PROFESSION then | 912 elseif qType == LE_QUEST_TAG_TYPE_PROFESSION then |
| 920 if not (db.ShowAllProfessionQuests or (self.tradeskillLineIndex and GetProfessionInfo(self.tradeskillLineIndex))) then | 913 if not (db.ShowAllProfessionQuests or (self.tradeskillLineIndex and GetProfessionInfo(self.tradeskillLineIndex))) then |
| 921 self.used = nil | 914 self.used = nil |
