Mercurial > wow > worldplan
diff QuestPOI.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 | be4db60219ca |
line wrap: on
line diff
--- a/QuestPOI.lua Fri Oct 28 14:06:07 2016 -0400 +++ b/QuestPOI.lua Fri Oct 28 19:54:00 2016 -0400 @@ -46,6 +46,35 @@ local LE_QUEST_TAG_TYPE_PROFESSION = LE_QUEST_TAG_TYPE_PROFESSION local LE_QUEST_TAG_TYPE_NORMAL = LE_QUEST_TAG_TYPE_NORMAL +local subStyles = { + continent = { + PinSize = 14, + Border = 2, + TrackingBorder = 1, + TagSize = 6, + TimeleftStage = 0, + showNumber = false, + numberFontObject = 'WorldPlanFont' + }, + zone = { + PinSize = 22, + Border = 3, + TrackingBorder = 2, + TagSize = 12, + TimeleftStage = 3, + showNumber = true, + numberFontObject = 'WorldPlanNumberFontThin' + }, + minimized = { + PinSize = 4, + Border = 0, + TrackingBorder = 1, + NoIcon = true, + TimeleftStage = 1, + showNumber = false, + } +} + -- Pin color/display variables local familiars = { @@ -108,14 +137,14 @@ end end - return REWARD_ARTIFACT_POWER, "Interface\\ICONS\\inv_7xp_inscription_talenttome01", power, name, itemID + return REWARD_ARTIFACT_POWER, "Interface\\ICONS\\inv_7xp_inscription_talenttome01", power, name, itemID, quality elseif text:match("Item Level") then --print('equipment!', text) quantity = text:match("Item Level ([%d\+]+)") - return REWARD_GEAR, icon, quantity, name, itemID + return REWARD_GEAR, icon, quantity, name, itemID, quality elseif text:match("Crafting Reagent") then --print('|cFFFF4400it is a reagent', text) - return REWARD_REAGENT, icon, quantity, name, itemID + return REWARD_REAGENT, icon, quantity, name, itemID, quality end end @@ -123,10 +152,10 @@ local text = ttl3:GetText() if text:match("Crafting Reagent") then --print('|cFFFF4400it is a reagent', text) - return REWARD_REAGENT, icon, quantity, name, itemID + return REWARD_REAGENT, icon, quantity, name, itemID, quality end end - return 128, icon, quantity, name, itemID + return 128, icon, quantity, name, itemID, quality end function WorldPlanPOIMixin:OnEnter() @@ -134,6 +163,33 @@ if not completed then if self.worldQuestType == LE_QUEST_TAG_TYPE_PET_BATTLE and familiars[self.questID] then WorldMapTooltip:SetOwner(self, 'ANCHOR_RIGHT') + WorldMapTooltip:AddLine(self.title, 1, 1, 1) + if self.quality then + local c = ITEM_QUALITY_COLORS[self.quality] + WorldMapTooltip:AddLine(" ") + WorldMapTooltip:AddLine('Rewards') + WorldMapTooltip:AddLine(self.itemName .. (self.quantity and (' x'..self.quantity) or ''), c.r, c.g, c.b) + WorldMapTooltip:AddTexture(self.itemTexture) + + local cLine = WorldMapTooltip:NumLines() + local line = _G['WorldMapTooltipTextLeft'..cLine] + local pline = _G['WorldMapTooltipTextLeft'..(cLine-1)] + local icon = _G['WorldMapTooltipTexture'..(cLine-3)] + icon:SetSize(24,24) + icon:ClearAllPoints() + icon:SetPoint('TOPLEFT', pline, 'BOTTOMLEFT', 0, -2) + line:ClearAllPoints() + line:SetPoint('TOPLEFT', icon, 'TOPRIGHT', 7, 0) + + --- voodoo workaround for IDs getting coerced to string + if type(self.itemTexture) == 'number' then + icon:Show() + icon:SetTexture(self.itemTexture) + end + end + + + WorldMapTooltip:AddLine(" ") -- causes crash for some reason WorldMapTooltip:AddLine('Family Familiars') local trainer = familiars[self.questID].name local numCheevs = GetAchievementNumCriteria(familiars_id) @@ -181,19 +237,17 @@ qprint('|cFFFF4400applying taskInfo coords:', info.x, info.y) end - self.passesBlizzFilters = WorldMap_DoesWorldQuestInfoPassFilters(info) end local questID = self:GetID() local questTitle, rewardIcon, rewardName, rewardCount, rewardStyle, rewardType, itemID, quantity, quality, _ - local hasUpdate, isPending = self.hasUpdate, self.isPending + local hasUpdate, isPending = (self.hasUpdate or self.isNew), self.isPending if not HaveQuestData(questID) then TQ_RequestPreloadRewardData(questID) isPending = true - qprint('because not have data') else -- set reward category @@ -201,7 +255,7 @@ local numCurrency = GetNumQuestLogRewardCurrencies(questID) local money = GetQuestLogRewardMoney(questID) if numRewards >= 1 then - rewardType, rewardIcon, rewardCount, rewardName, itemID = ParseItemReward(questID) + rewardType, rewardIcon, rewardCount, rewardName, itemID, quality = ParseItemReward(questID) elseif numCurrency >= 1 then rewardName, rewardIcon, rewardCount = GetQuestLogRewardCurrencyInfo(1, questID) rewardType = REWARD_CURRENCY @@ -215,6 +269,7 @@ self.itemNumber = rewardCount or self.itemNumber self.rewardType = rewardType or REWARD_ITEM self.style = rewardStyle + self.quality = quality -- title, faction, capped state local questTitle, factionID, capped = TQ_GetQuestInfoByQuestID(questID) @@ -270,6 +325,8 @@ qprint(' ', 'rewardType:', self.rewardType, 'tag:', self.tagID) qprint(' ', tostring(self.title), " |T"..tostring(self.itemTexture)..":12:12|t", tostring(self.itemName)) end + self.cheevos = familiars[self.questID] + return hasUpdate, isPending end @@ -411,6 +468,7 @@ subStyle = style.minimized end self.style = style + self.subStyle = subStyle local borderMask = style.mask @@ -419,7 +477,6 @@ local icon = self.icon local count = self.count - self.subStyle = subStyle self.hasNumeric = style.hasNumeric self.numberRGB = style.numberRGB self.showNumber = subStyle.showNumber @@ -438,8 +495,9 @@ wqprint('change font', _G[subStyle.numberFontObject]:GetName()) self.count:SetFontObject(_G[subStyle.numberFontObject]) end + wqprint('filtered:', self.filtered, 'showNumber:', self.showNumber) - self.count:SetShown(true) + self.count:SetShown(self.showNumber) self.count:SetText(self.itemNumber) self.count:SetTextColor(unpack(self.numberRGB)) else