26 lines
1.1 KiB
Lua
26 lines
1.1 KiB
Lua
-- Replace only MTK's tracer UI callback. Its physics, hits, ammunition and
|
|
-- VisualProjectilePC lifecycle stay owned by the original mod.
|
|
local legacy, replacement
|
|
local function install()
|
|
local bridge = MTKViewpointProjectiles
|
|
if not bridge or not VisualProjectilePC then return end
|
|
if not bridge.bind(VisualProjectilePC.removeByID, VisualProjectilePC.list) then
|
|
print("[MTKViewpointTurrets] MTK projectile API differs; original drawing retained.")
|
|
return
|
|
end
|
|
if replacement then return end
|
|
legacy = bridge.legacyRenderer()
|
|
if not legacy then
|
|
print("[MTKViewpointTurrets] MTK tracer callback not identified; original drawing retained.")
|
|
return
|
|
end
|
|
replacement = function()
|
|
if not MTKViewpointCamera or not MTKViewpointCamera.enabled() then return legacy() end
|
|
end
|
|
Events.OnPreUIDraw.Remove(legacy)
|
|
Events.OnPreUIDraw.Add(replacement)
|
|
print("[MTKViewpointTurrets] 3D projectile renderer registered; isometric tracers retained in iso view.")
|
|
end
|
|
Events.OnGameBoot.Add(install)
|
|
Events.OnGameStart.Add(install)
|