mirror of
https://github.com/iTracerFacer/DCS_MissionDev.git
synced 2025-12-03 04:14:46 +00:00
Added config validation messages to the log and game for missing squadron file loaded.
This commit is contained in:
1668
Moose_TADC/Moose_TADC.lua
Normal file
1668
Moose_TADC/Moose_TADC.lua
Normal file
File diff suppressed because it is too large
Load Diff
@@ -164,8 +164,6 @@ local TADC_SETTINGS = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Load squadron configs from external file
|
|
||||||
-- RED_SQUADRON_CONFIG and BLUE_SQUADRON_CONFIG are now global, loaded by the trigger
|
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
INTERCEPT RATIO CHART - How many interceptors launch per threat aircraft:
|
INTERCEPT RATIO CHART - How many interceptors launch per threat aircraft:
|
||||||
@@ -235,6 +233,8 @@ local ADVANCED_SETTINGS = {
|
|||||||
═══════════════════════════════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════════════════════════════
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Internal tracking variables - separate for each coalition
|
-- Internal tracking variables - separate for each coalition
|
||||||
local activeInterceptors = {
|
local activeInterceptors = {
|
||||||
red = {},
|
red = {},
|
||||||
@@ -257,6 +257,13 @@ local squadronAircraftCounts = {
|
|||||||
blue = {}
|
blue = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Logging function
|
||||||
|
local function log(message, detailed)
|
||||||
|
if not detailed or ADVANCED_SETTINGS.enableDetailedLogging then
|
||||||
|
env.info(ADVANCED_SETTINGS.logPrefix .. " " .. message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Performance optimization: Cache SET_GROUP objects to avoid repeated creation
|
-- Performance optimization: Cache SET_GROUP objects to avoid repeated creation
|
||||||
local cachedSets = {
|
local cachedSets = {
|
||||||
redCargo = nil,
|
redCargo = nil,
|
||||||
@@ -265,7 +272,17 @@ local cachedSets = {
|
|||||||
blueAircraft = nil
|
blueAircraft = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Initialize squadron aircraft counts for both coalitions
|
if type(RED_SQUADRON_CONFIG) ~= "table" then
|
||||||
|
local msg = "CONFIG ERROR: RED_SQUADRON_CONFIG is missing or not loaded. Make sure Moose_TADC_SquadronConfigs_Load1st.lua is loaded before this script."
|
||||||
|
log(msg, true)
|
||||||
|
MESSAGE:New(msg, 30):ToAll()
|
||||||
|
end
|
||||||
|
if type(BLUE_SQUADRON_CONFIG) ~= "table" then
|
||||||
|
local msg = "CONFIG ERROR: BLUE_SQUADRON_CONFIG is missing or not loaded. Make sure Moose_TADC_SquadronConfigs_Load1st.lua is loaded before this script."
|
||||||
|
log(msg, true)
|
||||||
|
MESSAGE:New(msg, 30):ToAll()
|
||||||
|
end
|
||||||
|
|
||||||
for _, squadron in pairs(RED_SQUADRON_CONFIG) do
|
for _, squadron in pairs(RED_SQUADRON_CONFIG) do
|
||||||
if squadron.aircraft and squadron.templateName then
|
if squadron.aircraft and squadron.templateName then
|
||||||
squadronAircraftCounts.red[squadron.templateName] = squadron.aircraft
|
squadronAircraftCounts.red[squadron.templateName] = squadron.aircraft
|
||||||
@@ -278,12 +295,7 @@ for _, squadron in pairs(BLUE_SQUADRON_CONFIG) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Logging function
|
|
||||||
local function log(message, detailed)
|
|
||||||
if not detailed or ADVANCED_SETTINGS.enableDetailedLogging then
|
|
||||||
env.info(ADVANCED_SETTINGS.logPrefix .. " " .. message)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Squadron resource summary generator
|
-- Squadron resource summary generator
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user