Added config validation messages to the log and game for missing squadron file loaded.

This commit is contained in:
iTracerFacer 2025-10-15 17:34:37 -05:00
parent 0f0f59fc84
commit 84e2e9ffae
3 changed files with 1689 additions and 9 deletions

1668
Moose_TADC/Moose_TADC.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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.