DungeonPreQuest: keep markers off the player arrow
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ef6cb6ab60
commit
8b65cab742
2 changed files with 54 additions and 3 deletions
|
|
@ -26,7 +26,11 @@ function LibStub(name)
|
|||
end
|
||||
|
||||
local timers = {}
|
||||
C_Timer = { After = function(_, fn) timers[#timers + 1] = fn end }
|
||||
local overlapTick
|
||||
C_Timer = {
|
||||
After = function(_, fn) timers[#timers + 1] = fn end,
|
||||
NewTicker = function(_, fn) overlapTick = fn end,
|
||||
}
|
||||
local function flush()
|
||||
local list = timers
|
||||
timers = {}
|
||||
|
|
@ -44,7 +48,7 @@ local function texture()
|
|||
end
|
||||
|
||||
local onEvent, registered = nil, {}
|
||||
Minimap = { GetFrameLevel = function() return 1 end }
|
||||
Minimap = { GetFrameLevel = function() return 1 end, GetCenter = function() return 100, 100 end }
|
||||
CreateFrame = function(kind)
|
||||
if kind == "Frame" and not onEvent and created == 0 and not registered.frame then
|
||||
registered.frame = true
|
||||
|
|
@ -59,7 +63,10 @@ CreateFrame = function(kind)
|
|||
function f:SetSize() end
|
||||
function f:SetFrameLevel() end
|
||||
function f:CreateTexture() self.tex = texture(); return self.tex end
|
||||
function f:EnableMouse() end
|
||||
function f:EnableMouse(v) self.mouse = v end
|
||||
function f:SetAlpha(a) self.alpha = a end
|
||||
function f:IsShown() return self.visible ~= false end
|
||||
function f:GetCenter() return self.cx, self.cy end
|
||||
function f:SetScript(name, fn) self.scripts[name] = fn end
|
||||
return f
|
||||
end
|
||||
|
|
@ -163,6 +170,25 @@ check(tip.title == "The Day After" and tip.line == "Dungeon pre-quest: The Deadm
|
|||
pin.scripts.OnLeave(pin)
|
||||
check(tip.hidden, "tooltip hides on leave")
|
||||
|
||||
-- The player arrow stays visible.
|
||||
pin.cx, pin.cy = 105, 103
|
||||
overlapTick()
|
||||
check(pin.alpha == 0 and pin.mouse == false, "marker over the player arrow steps aside")
|
||||
pin.cx, pin.cy = 150, 150
|
||||
overlapTick()
|
||||
check(pin.alpha == 1 and pin.mouse == true, "marker returns once clear of the arrow")
|
||||
pin.cx, pin.cy = 115, 100
|
||||
overlapTick()
|
||||
check(pin.alpha == 1, "marker just beyond the arrow stays visible")
|
||||
pin.cx, pin.cy = 100, 100
|
||||
pin.visible = false
|
||||
overlapTick()
|
||||
check(pin.alpha == 1, "out-of-range markers are skipped")
|
||||
pin.visible = nil
|
||||
pin.cx, pin.cy = nil, nil
|
||||
overlapTick()
|
||||
check(pin.alpha == 1, "marker with no position yet is left alone")
|
||||
|
||||
-- Pooling and batching.
|
||||
local before = created
|
||||
count()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue