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
|
|
@ -9,6 +9,8 @@ local Pins = LibStub("HereBeDragonsQuestie-Pins-2.0")
|
|||
local ICON = "Interface\\GossipFrame\\AvailableQuestIcon"
|
||||
local PIN_SIZE = 14
|
||||
local REFRESH_DELAY = 1
|
||||
local PLAYER_CLEARANCE = 14
|
||||
local OVERLAP_INTERVAL = 0.1
|
||||
|
||||
local active, free = {}, {}
|
||||
|
||||
|
|
@ -122,6 +124,29 @@ local function Refresh()
|
|||
end
|
||||
end
|
||||
|
||||
-- The player arrow is drawn by the minimap itself, below anything an addon can
|
||||
-- add to it, so markers step aside instead. Alpha rather than Hide, because the
|
||||
-- pin library shows its pins again on every update.
|
||||
local function UpdateOverlap()
|
||||
local centerX, centerY = Minimap:GetCenter()
|
||||
if not centerX then
|
||||
return
|
||||
end
|
||||
for _, pin in ipairs(active) do
|
||||
if pin:IsShown() then
|
||||
local x, y = pin:GetCenter()
|
||||
local overlapping = x ~= nil and (x - centerX) ^ 2 + (y - centerY) ^ 2 < PLAYER_CLEARANCE ^ 2
|
||||
if overlapping ~= pin.overlapping then
|
||||
pin.overlapping = overlapping
|
||||
pin:SetAlpha(overlapping and 0 or 1)
|
||||
pin:EnableMouse(not overlapping)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
C_Timer.NewTicker(OVERLAP_INTERVAL, UpdateOverlap)
|
||||
|
||||
-- Turning a quest in reports several events, and completion lags slightly behind.
|
||||
local queued = false
|
||||
local function QueueRefresh()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue