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:
parent
0f0f59fc84
commit
84e2e9ffae
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:
|
||||
@ -235,6 +233,8 @@ local ADVANCED_SETTINGS = {
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
]]
|
||||
|
||||
|
||||
|
||||
-- Internal tracking variables - separate for each coalition
|
||||
local activeInterceptors = {
|
||||
red = {},
|
||||
@ -257,6 +257,13 @@ local squadronAircraftCounts = {
|
||||
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
|
||||
local cachedSets = {
|
||||
redCargo = nil,
|
||||
@ -265,7 +272,17 @@ local cachedSets = {
|
||||
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
|
||||
if squadron.aircraft and squadron.templateName then
|
||||
squadronAircraftCounts.red[squadron.templateName] = squadron.aircraft
|
||||
@ -278,12 +295,7 @@ for _, squadron in pairs(BLUE_SQUADRON_CONFIG) do
|
||||
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
|
||||
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user