mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add plugin for exporting RED and BLUE threat circles to LotATC.
Implemented as a plugin because LotATC needs actual lat/lon, and the only APIs for those are in lua. Fixes https://github.com/Khopa/dcs_liberation/issues/956.
This commit is contained in:
58
resources/plugins/lotatc/LotAtcExport-config.lua
Normal file
58
resources/plugins/lotatc/LotAtcExport-config.lua
Normal file
@@ -0,0 +1,58 @@
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- configuration file for the LotATC Export script
|
||||
--
|
||||
-- This configuration is tailored for a mission generated by DCS Liberation
|
||||
-- see https://github.com/Khopa/dcs_liberation
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- LotATC Export plugin - configuration
|
||||
logger:info("DCSLiberation|LotATC Export plugin - configuration")
|
||||
|
||||
local function discoverLotAtcDrawingsPath()
|
||||
-- establish a search pattern into the following modes
|
||||
-- 1. Environment variable LOTATC_DRAWINGS_DIR, to support server exporting with auto load from LotATC
|
||||
-- 2. DCS saved games folder as configured in DCS Liberation
|
||||
|
||||
local drawingEnvDir = os.getenv("LOTATC_DRAWINGS_DIR")
|
||||
if drawingEnvDir then
|
||||
return drawingEnvDir
|
||||
else
|
||||
return lfs.writedir()..[[\Mods\services\LotAtc\userdb\drawings\]]
|
||||
end
|
||||
end
|
||||
|
||||
if dcsLiberation then
|
||||
logger:info("DCSLiberation|LotATC Export plugin - configuration dcsLiberation")
|
||||
|
||||
local exportRedAA = true
|
||||
local exportBlueAA = false
|
||||
local exportSymbols = true
|
||||
|
||||
-- retrieve specific options values
|
||||
if dcsLiberation.plugins then
|
||||
logger:info("DCSLiberation|LotATC Export plugin - configuration dcsLiberation.plugins")
|
||||
|
||||
if dcsLiberation.plugins.lotatc then
|
||||
logger:info("DCSLiberation|LotATC Export plugin - dcsLiberation.plugins.lotatcExport")
|
||||
|
||||
exportRedAA = dcsLiberation.plugins.lotatc.exportRedAA
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportRedAA = %s",tostring(exportRedAA)))
|
||||
|
||||
exportBlueAA = dcsLiberation.plugins.lotatc.exportBlueAA
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportBlueAA = %s",tostring(exportBlueAA)))
|
||||
|
||||
exportBlueAA = dcsLiberation.plugins.lotatc.exportSymbols
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportSymbols = %s",tostring(exportSymbols)))
|
||||
end
|
||||
end
|
||||
|
||||
-- actual configuration code
|
||||
if LotAtcExportConfig then
|
||||
LotAtcExportConfig.exportRedAA = exportRedAA
|
||||
LotAtcExportConfig.exportBlueAA = exportBlueAA
|
||||
LotAtcExportConfig.exportSymbols = exportSymbols
|
||||
LotAtcExportConfig.drawingBasePath = discoverLotAtcDrawingsPath()
|
||||
|
||||
LotatcExport()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user