Map pins: skip SetPassThroughButtons in combat
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
46fd5cb8a9
commit
25e3aa4fec
4 changed files with 20 additions and 3 deletions
|
|
@ -266,7 +266,10 @@ function FlightFinderPinMixin:OnAcquired(id)
|
|||
self.Disc:SetVertexColor(0.06, 0.06, 0.08, 0.9)
|
||||
self.Ring:SetVertexColor(c[1], c[2], c[3], 1)
|
||||
self.Glyph:SetTexture(GLYPH)
|
||||
self:CheckMouseButtonPassthrough("RightButton")
|
||||
-- SetPassThroughButtons is protected in combat; a pin reused from the pool keeps its old setting
|
||||
if not InCombatLockdown() then
|
||||
self:CheckMouseButtonPassthrough("RightButton")
|
||||
end
|
||||
end
|
||||
|
||||
-- where a waypoint for the node goes: its zone map, since continents don't take waypoints
|
||||
|
|
|
|||
|
|
@ -554,7 +554,10 @@ function ShipRoutesPinMixin:OnAcquired(kind, a, b)
|
|||
self.Label:Show()
|
||||
end
|
||||
self.Disc:SetVertexColor(0.06, 0.06, 0.08, 0.9)
|
||||
self:CheckMouseButtonPassthrough("RightButton")
|
||||
-- SetPassThroughButtons is protected in combat; a pin reused from the pool keeps its old setting
|
||||
if not InCombatLockdown() then
|
||||
self:CheckMouseButtonPassthrough("RightButton")
|
||||
end
|
||||
end
|
||||
|
||||
function ShipRoutesPinMixin:OnMouseEnter()
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue