-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- configuration file for the JTAC Autolase framework
--
-- This configuration is tailored for a mission generated by DCS Liberation
-- see https://github.com/Khopa/dcs_liberation
-------------------------------------------------------------------------------------------------------------------------------------------------------------

-- JTACAutolase plugin - configuration
env.info("DCSLiberation|JTACAutolase plugin - configuration")

if dcsLiberation then
    env.info("DCSLiberation|JTACAutolase plugin - dcsLiberation")

    -- specific options
    local smoke = false

    -- retrieve specific options values
    if dcsLiberation.plugins then
        env.info("DCSLiberation|JTACAutolase plugin - dcsLiberation.plugins")
    
        if dcsLiberation.plugins.jtacautolase then
            env.info("DCSLiberation|JTACAutolase plugin - dcsLiberation.plugins.jtacautolase")
            smoke = dcsLiberation.plugins.jtacautolase.smoke
            env.info(string.format("DCSLiberation|JTACAutolase plugin - smoke = %s",tostring(smoke)))
        end
    end
    
    -- actual configuration code    
    for _, jtac in pairs(dcsLiberation.JTACs) do
        env.info(string.format("DCSLiberation|JTACAutolase plugin - setting up %s",jtac.dcsUnit))
        if JTACAutoLase then 
            env.info("DCSLiberation|JTACAutolase plugin - calling JTACAutoLase")
            JTACAutoLase(jtac.dcsUnit, jtac.laserCode, smoke, 'vehicle') 
        end
    end
    
end