#7: Completed quests kept showing as available '!'. The server completed- quest list arrives async via QUEST_QUERY_COMPLETE, often after available quests were first drawn. Recalculate available quests once char.complete is populated by that event so completed quests are removed (also clears the already-completed subset of #8). #9: An accepted quest's available '!' could linger on the minimap until /reload. UnloadQuestFramesByDataType unloaded the frame but left its name in questIdFrames and _G; it now removes those references so the icon is torn down immediately on both map and minimap. #10: Added 'Hide repeatable quests below level 60' (Icons tab, off by default) to hide repeatable available quests (e.g. the Ascension Callboard) from map/minimap until level 60. Enforced in _DrawQuestIfAvailable and ShouldBeHidden so existing minimap pins are removed too; reappear at 60. Lint: selene 0 errors. Tests: 145 successes / same 7 pre-existing failures.
This commit is contained in:
@@ -542,6 +542,7 @@ function _Qframe:ShouldBeHidden()
|
||||
and ((not DailyQuests:IsActiveDailyQuest(questId)) -- hide not-today-dailies
|
||||
or ((not profile.enableAvailable) and normal)
|
||||
or ((not profile.showRepeatableQuests) and repeatable)
|
||||
or (profile.hideRepeatableBelowMaxLevel and repeatable and (UnitLevel("player") or 0) < 60) -- Hide Callboard/repeatable quests below 60 (#10)
|
||||
or ((not profile.showEventQuests) and event)
|
||||
or ((not profile.showDungeonQuests) and dungeon)
|
||||
or ((not profile.showRaidQuests) and raid)
|
||||
|
||||
@@ -129,9 +129,14 @@ end
|
||||
|
||||
function QuestieMap:UnloadQuestFramesByDataType(questId, dataType)
|
||||
if QuestieMap.questIdFrames[questId] then
|
||||
for _, frame in pairs(QuestieMap:GetFramesForQuest(questId)) do
|
||||
for name, frame in pairs(QuestieMap:GetFramesForQuest(questId)) do
|
||||
if frame and frame.data and frame.data.Type == dataType then
|
||||
frame:Unload()
|
||||
-- Also drop the registry/global reference. Without this the frame name
|
||||
-- lingered in questIdFrames and _G, so the available '!' could stay on the
|
||||
-- minimap after a quest was accepted until a full /reload rebuilt frames. (#9)
|
||||
QuestieMap.questIdFrames[questId][name] = nil
|
||||
_G[name] = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -187,6 +187,23 @@ function QuestieOptions.tabs.icons:Initialize()
|
||||
QuestieQuest:ToggleNotes(value)
|
||||
end,
|
||||
},
|
||||
hideRepeatableBelowMaxLevel = {
|
||||
type = "toggle",
|
||||
order = 2.035,
|
||||
name = function() return l10n('Hide repeatable quests below level 60'); end,
|
||||
desc = function() return l10n('Hides repeatable available quests (such as the Ascension Callboard) from the map and minimap until the character reaches level 60, where they become relevant.'); end,
|
||||
width = 1.595,
|
||||
disabled = function() return (not Questie.db.profile.enabled) or (not Questie.db.profile.showRepeatableQuests); end,
|
||||
get = function(info) return Questie.db.profile.hideRepeatableBelowMaxLevel end,
|
||||
set = function(info, value)
|
||||
Questie.db.profile.hideRepeatableBelowMaxLevel = value
|
||||
QuestieQuest:ToggleNotes(true)
|
||||
local AvailableQuests = QuestieLoader:ImportModule("AvailableQuests")
|
||||
if AvailableQuests and AvailableQuests.CalculateAndDrawAll then
|
||||
AvailableQuests.CalculateAndDrawAll()
|
||||
end
|
||||
end,
|
||||
},
|
||||
showPvPQuests = {
|
||||
type = "toggle",
|
||||
order = 2.04,
|
||||
|
||||
@@ -177,6 +177,7 @@ function QuestieOptionsDefaults:Load()
|
||||
hideUnexploredMapIcons = false,
|
||||
hideUntrackedQuestsMapIcons = false,
|
||||
showRepeatableQuests = true,
|
||||
hideRepeatableBelowMaxLevel = false,
|
||||
showEventQuests = true,
|
||||
showDungeonQuests = true,
|
||||
showRaidQuests = true,
|
||||
|
||||
@@ -122,6 +122,9 @@ _CalculateAvailableQuests = function()
|
||||
|
||||
local completedQuests = Questie.db.char.complete
|
||||
local showRepeatableQuests = Questie.db.profile.showRepeatableQuests
|
||||
-- Hide repeatable available quests (e.g. the Ascension Callboard '!') below level 60,
|
||||
-- where they aren't relevant yet. (#10)
|
||||
local hideRepeatableBelowMax = Questie.db.profile.hideRepeatableBelowMaxLevel and playerLevel < 60
|
||||
local showDungeonQuests = Questie.db.profile.showDungeonQuests
|
||||
local showRaidQuests = Questie.db.profile.showRaidQuests
|
||||
local showPvPQuests = Questie.db.profile.showPvPQuests
|
||||
@@ -163,6 +166,7 @@ _CalculateAvailableQuests = function()
|
||||
|
||||
if (
|
||||
((not showRepeatableQuests) and QuestieDB.IsRepeatable(questId)) or -- Don't show repeatable quests if option is disabled
|
||||
(hideRepeatableBelowMax and QuestieDB.IsRepeatable(questId)) or -- Hide repeatable (Callboard) quests below level 60 (#10)
|
||||
((not showPvPQuests) and QuestieDB.IsPvPQuest(questId)) or -- Don't show PvP quests if option is disabled
|
||||
((not showDungeonQuests) and QuestieDB.IsDungeonQuest(questId)) or -- Don't show dungeon quests if option is disabled
|
||||
((not showRaidQuests) and QuestieDB.IsRaidQuest(questId)) or -- Don't show raid quests if option is disabled
|
||||
|
||||
Reference in New Issue
Block a user