DungeonPreQuest: move log mark after the title
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ddb05c7d52
commit
adc76b9a87
2 changed files with 33 additions and 5 deletions
|
|
@ -47,13 +47,18 @@ local function region()
|
|||
local r = { shown = false }
|
||||
function r:Show() self.shown = true end
|
||||
function r:Hide() self.shown = false end
|
||||
function r:SetPoint() end
|
||||
function r:SetPoint(...) self.point = { ... } end
|
||||
function r:ClearAllPoints() self.point = nil end
|
||||
function r:SetText(t) self.text = t end
|
||||
return r
|
||||
end
|
||||
|
||||
local function button(id)
|
||||
local b = { questID = id, creates = 0 }
|
||||
local b = { questID = id, creates = 0, textWidth = 120, boxWidth = 230 }
|
||||
b.Text = {
|
||||
GetStringWidth = function() return b.textWidth end,
|
||||
GetWidth = function() return b.boxWidth end,
|
||||
}
|
||||
function b:CreateFontString() self.creates = self.creates + 1; return region() end
|
||||
return b
|
||||
end
|
||||
|
|
@ -144,6 +149,18 @@ rows = { a, b }
|
|||
hooks.QuestLogQuests_Update()
|
||||
check(a.dpqMark and a.dpqMark.shown and a.dpqMark.text:find("D", 1, true), "pre-quest row is marked")
|
||||
check(b.dpqMark == nil, "other row stays unmarked")
|
||||
check(a.dpqMark.text == "|cffc77dff[D]|r", "row uses the [D] tag: " .. tostring(a.dpqMark.text))
|
||||
check(a.dpqMark.point[2] == a.Text and a.dpqMark.point[4] == 125, "mark sits just after the title: " .. tostring(a.dpqMark.point[4]))
|
||||
|
||||
a.textWidth = 400
|
||||
hooks.QuestLogQuests_Update()
|
||||
check(a.dpqMark.point[4] == 235, "long title keeps the mark at the end of the title box")
|
||||
a.boxWidth = 0
|
||||
hooks.QuestLogQuests_Update()
|
||||
check(a.dpqMark.point[4] == 405, "unresolved title box falls back to the text width")
|
||||
a.textWidth, a.boxWidth = 80, 230
|
||||
hooks.QuestLogQuests_Update()
|
||||
check(a.dpqMark.point[4] == 85, "reused row follows its new title")
|
||||
|
||||
a.questID = 99
|
||||
hooks.QuestLogQuests_Update()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue