DungeonPreQuest: mark NPC quest lists

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-11-10 13:23:57 +00:00
parent 801608e066
commit d873b7f6fa
3 changed files with 102 additions and 2 deletions

View file

@ -70,6 +70,32 @@ local function UpdateRows()
end
end
-- Purple, because the gold used elsewhere is hard to read on parchment.
local LIST_MARK = "|cff8a2be2[D]|r "
local function MarkListButton(button, questID)
if not DungeonsFor(questID) then
return false
end
local text = button:GetText()
if not text or text:find(LIST_MARK, 1, true) then
return false
end
button:SetText(LIST_MARK .. text)
return true
end
local function MarkGreetingList()
for button in QuestFrameGreetingPanel.titleButtonPool:EnumerateActive() do
if button.isActive == 0 then
local questID = select(5, GetAvailableQuestInfo(button:GetID()))
if MarkListButton(button, questID) then
button:SetHeight(math.max(button:GetTextHeight() + 2, button.Icon:GetHeight()))
end
end
end
end
local banner
local function UpdateBanner()
@ -101,6 +127,18 @@ local function Setup()
banner = QuestFrameDetailPanel:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
banner:SetPoint("BOTTOM", QuestFrame, "TOP", 0, 6)
QuestFrameDetailPanel:HookScript("OnShow", UpdateBanner)
-- Gossip buttons copy this mixin when they are first created, after login.
hooksecurefunc(GossipAvailableQuestButtonMixin, "Setup", function(button, questInfo)
if MarkListButton(button, questInfo and questInfo.questID) then
button:Resize()
end
end)
-- Showing the panel runs Blizzard's XML-bound handler, while refreshing an
-- open panel calls the global by name, so both need covering.
QuestFrameGreetingPanel:HookScript("OnShow", MarkGreetingList)
hooksecurefunc("QuestFrameGreetingPanel_OnShow", MarkGreetingList)
end
local frame = CreateFrame("Frame")