mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
@@ -1,17 +1,17 @@
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- configuration file for the LotATC Export script
|
||||
--
|
||||
-- This configuration is tailored for a mission generated by DCS Liberation
|
||||
-- see https://github.com/dcs-liberation/dcs_liberation
|
||||
-- This configuration is tailored for a mission generated by DCS Retribution
|
||||
-- see https://github.com/dcs-retribution/dcs-retribution
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- LotATC Export plugin - configuration
|
||||
logger:info("DCSLiberation|LotATC Export plugin - configuration")
|
||||
logger:info("DCSRetribution|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
|
||||
-- 2. DCS saved games folder as configured in DCS Retribution
|
||||
|
||||
local drawingEnvDir = os.getenv("LOTATC_DRAWINGS_DIR")
|
||||
if drawingEnvDir then
|
||||
@@ -21,28 +21,28 @@ local function discoverLotAtcDrawingsPath()
|
||||
end
|
||||
end
|
||||
|
||||
if dcsLiberation then
|
||||
logger:info("DCSLiberation|LotATC Export plugin - configuration dcsLiberation")
|
||||
if dcsRetribution then
|
||||
logger:info("DCSRetribution|LotATC Export plugin - configuration dcsRetribution")
|
||||
|
||||
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 dcsRetribution.plugins then
|
||||
logger:info("DCSRetribution|LotATC Export plugin - configuration dcsRetribution.plugins")
|
||||
|
||||
if dcsLiberation.plugins.lotatc then
|
||||
logger:info("DCSLiberation|LotATC Export plugin - dcsLiberation.plugins.lotatcExport")
|
||||
if dcsRetribution.plugins.lotatc then
|
||||
logger:info("DCSRetribution|LotATC Export plugin - dcsRetribution.plugins.lotatcExport")
|
||||
|
||||
exportRedAA = dcsLiberation.plugins.lotatc.exportRedAA
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportRedAA = %s",tostring(exportRedAA)))
|
||||
exportRedAA = dcsRetribution.plugins.lotatc.exportRedAA
|
||||
logger:info(string.format("DCSRetribution|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 = dcsRetribution.plugins.lotatc.exportBlueAA
|
||||
logger:info(string.format("DCSRetribution|LotATC Export plugin - exportBlueAA = %s",tostring(exportBlueAA)))
|
||||
|
||||
exportBlueAA = dcsLiberation.plugins.lotatc.exportSymbols
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportSymbols = %s",tostring(exportSymbols)))
|
||||
exportBlueAA = dcsRetribution.plugins.lotatc.exportSymbols
|
||||
logger:info(string.format("DCSRetribution|LotATC Export plugin - exportSymbols = %s",tostring(exportSymbols)))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--[[
|
||||
Export script for LotATC drawings
|
||||
|
||||
Allows to export certain DCS Liberation objects as predefined drawing in LotATC.
|
||||
Allows to export certain DCS Retribution objects as predefined drawing in LotATC.
|
||||
|
||||
This script runs at mission startup and generates a drawing JSON file to be imported
|
||||
in LotATC.
|
||||
@@ -51,7 +51,7 @@ local function lotatcExport_get_aa_nato_name(unit, isFriend)
|
||||
return nil
|
||||
end
|
||||
|
||||
-- logger:info(string.format("DCSLiberation|LotATC Export plugin - try get NATO name for unit %s", unit.dcsGroupName))
|
||||
-- logger:info(string.format("DCSRetribution|LotATC Export plugin - try get NATO name for unit %s", unit.dcsGroupName))
|
||||
|
||||
local iads = redIADS
|
||||
if isFriend then
|
||||
@@ -60,7 +60,7 @@ local function lotatcExport_get_aa_nato_name(unit, isFriend)
|
||||
|
||||
local samSite = iads:getSAMSiteByGroupName(unit.dcsGroupName)
|
||||
if samSite and samSite.natoName then
|
||||
-- logger:info(string.format("DCSLiberation|LotATC Export plugin - NATO name is %s", samSite.natoName))
|
||||
-- logger:info(string.format("DCSRetribution|LotATC Export plugin - NATO name is %s", samSite.natoName))
|
||||
return samSite.natoName
|
||||
else
|
||||
return nil
|
||||
@@ -89,7 +89,7 @@ local function lotatcExport_get_name(unit, isFriend)
|
||||
end
|
||||
|
||||
local function lotatc_write_json(filename, json)
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - writing %s", filename))
|
||||
logger:info(string.format("DCSRetribution|LotATC Export plugin - writing %s", filename))
|
||||
|
||||
local function Write()
|
||||
local fp = io.open(filename, 'w')
|
||||
@@ -109,7 +109,7 @@ local function lotatcExport_threat_circles_for_faction(faction, color, isFriend)
|
||||
local drawings = {}
|
||||
|
||||
for _,aa in pairs(faction) do
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - exporting threat circle for %s", aa.dcsGroupName))
|
||||
logger:info(string.format("DCSRetribution|LotATC Export plugin - exporting threat circle for %s", aa.dcsGroupName))
|
||||
|
||||
local convLat, convLon = coord.LOtoLL({x = aa.positionX, y = 0, z = aa.positionY})
|
||||
|
||||
@@ -117,7 +117,7 @@ local function lotatcExport_threat_circles_for_faction(faction, color, isFriend)
|
||||
|
||||
table.insert(drawings,
|
||||
{
|
||||
["author"] = "DCSLiberation",
|
||||
["author"] = "DCSRetribution",
|
||||
["brushStyle"] = 1,
|
||||
["color"] = color,
|
||||
["colorBg"] = "#00000000",
|
||||
@@ -153,7 +153,7 @@ local function lotatcExport_symbols_for_faction(faction, color, isFriend)
|
||||
local drawings = {}
|
||||
|
||||
for _,aa in pairs(faction) do
|
||||
logger:info(string.format("DCSLiberation|LotATC Export plugin - exporting AA symbol for %s", aa.dcsGroupName))
|
||||
logger:info(string.format("DCSRetribution|LotATC Export plugin - exporting AA symbol for %s", aa.dcsGroupName))
|
||||
|
||||
local convLat, convLon = coord.LOtoLL({x = aa.positionX, y = 0, z = aa.positionY})
|
||||
|
||||
@@ -172,7 +172,7 @@ local function lotatcExport_symbols_for_faction(faction, color, isFriend)
|
||||
|
||||
table.insert(drawings,
|
||||
{
|
||||
["author"] = "DCSLiberation",
|
||||
["author"] = "DCSRetribution",
|
||||
["brushStyle"] = 1,
|
||||
["classification"] = {
|
||||
["classification"] = classification,
|
||||
@@ -244,10 +244,10 @@ function LotatcExport()
|
||||
-- wants to see the RED AA.
|
||||
|
||||
if LotAtcExportConfig.exportRedAA then
|
||||
lotatc_export_faction(dcsLiberation.RedAA, LotAtcExportConfig.redColor, [[blue\]], false)
|
||||
lotatc_export_faction(dcsRetribution.RedAA, LotAtcExportConfig.redColor, [[blue\]], false)
|
||||
end
|
||||
|
||||
if LotAtcExportConfig.exportBlueAA then
|
||||
lotatc_export_faction(dcsLiberation.BlueAA, LotAtcExportConfig.blueColor, [[red\]], true)
|
||||
lotatc_export_faction(dcsRetribution.BlueAA, LotAtcExportConfig.blueColor, [[red\]], true)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user