Map pins: skip SetPassThroughButtons in combat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-11-12 15:23:28 +00:00
parent 46fd5cb8a9
commit 25e3aa4fec
4 changed files with 20 additions and 3 deletions

View file

@ -76,6 +76,9 @@ function NumTaxiNodes() return #taxi end
function TaxiNodeName(i) return taxi[i][1] end
function TaxiNodeGetType(i) return taxi[i][2] end
local inCombat = false
function InCombatLockdown() return inCombat end
local faction = "Alliance"
function UnitFactionGroup() return faction end
@ -95,7 +98,7 @@ MapCanvasDataProviderMixin = {
MapCanvasPinMixin = {
UseFrameLevelType = function() end,
SetScalingLimits = function() end,
CheckMouseButtonPassthrough = function() end,
CheckMouseButtonPassthrough = function(self) self.passthrough = true end,
GetMap = function() return WorldMapFrame end,
}
local function texture()
@ -200,6 +203,13 @@ waypoint = nil
loch:OnMouseClickAction("LeftButton")
check(waypoint and waypoint.m == 1432, "waypoint set on Loch Modan, got " .. tostring(waypoint and waypoint.m))
-- SetPassThroughButtons is protected in combat: pins drawn in combat skip it
check(show(1432)[8].passthrough, "passthrough set out of combat")
inCombat = true
local fought = show(1432)[8]
check(fought and not fought.passthrough, "no passthrough call in combat")
inCombat = false
-- slash toggles and counts
SlashCmdList.FLIGHTFINDER("")
check(printed and printed:find("hidden") and printed:find("%d+ / %d+"), "slash prints hidden + count: " .. tostring(printed))

View file

@ -28,6 +28,7 @@ local function to947(inst, x, y)
return a[1] + (a[8] - y) / (a[8] - a[7]) * (a[2] - a[1]), a[3] + (a[6] - x) / (a[6] - a[5]) * (a[4] - a[3])
end
function InCombatLockdown() return false end
Enum = { UIMapType = { Cosmic = 0, World = 1, Continent = 2, Zone = 3 } }
function CreateVector2D(x, y)
return { x = x, y = y, GetXY = function(self) return self.x, self.y end }