This commit is contained in:
2024-10-11 20:12:56 +02:00
parent e42eab8609
commit 958503fb30
8 changed files with 33 additions and 17 deletions
-1
View File
@@ -118,7 +118,6 @@ TIP: You can click on the type to get more details
&emsp; <u>Completion logic</u> <br/> &emsp; <u>Completion logic</u> <br/>
&emsp; TODO: documentation: Completion logic &emsp; TODO: documentation: Completion logic
</details> </details>
<details> <details>
Binary file not shown.
+2
View File
@@ -51,4 +51,6 @@ function CapConfig:new()
return o; return o;
end end
if not Spearhead.internal then Spearhead.internal = {} end
Spearhead.internal.configuration.CapConfig = CapConfig; Spearhead.internal.configuration.CapConfig = CapConfig;
+14 -2
View File
@@ -9,10 +9,22 @@ function StageConfig:new()
local enabled = SpearheadConfig.StageConfig.enabled or true local enabled = SpearheadConfig.StageConfig.enabled or true
---@return boolean ---@return boolean
o.isEnabled = function() return enabled == true end o.isEnabled = function(self) return enabled == true end
local drawStages = SpearheadConfig.StageConfig.drawStages or true
---@return boolean
o.isDrawStagesEnabled = function(self) return drawStages == true end
local autoStages = SpearheadConfig.StageConfig.autoStages or true
---@return boolean
o.isAutoStages = function(self) return autoStages end
local maxMissionsPerStage = SpearheadConfig.StageConfig.maxMissionStage
o.getMaxMissionPerStage = function(self) return maxMissionsPerStage end
o.logLevel = Spearhead.LoggerTemplate.LogLevelOptions.INFO o.logLevel = Spearhead.LoggerTemplate.LogLevelOptions.INFO
return o; return o;
end end
if not Spearhead.internal then Spearhead.internal = {} end
Spearhead.internal.configuration.StageConfig = StageConfig; Spearhead.internal.configuration.StageConfig = StageConfig;
+1 -1
View File
@@ -883,7 +883,7 @@ do --setup route util
local targetTypes = { local targetTypes = {
[1] = "Fighters", [1] = "Fighters",
[2] = "Multirole fighters", [2] = "Multirole fighters",
[3] = "Bombers", [3] = "Bombers"
} }
if attackHelos then if attackHelos then
+11 -11
View File
@@ -376,18 +376,18 @@ do -- DB
loadAirbaseGroups() loadAirbaseGroups()
loadMiscGroupsInStages() loadMiscGroupsInStages()
local cleanup = function () --CLean up all groups that are now managed inside zones by spearhead -- local cleanup = function () --CLean up all groups that are now managed inside zones by spearhead
local count = 0 -- local count = 0
for name, taken in pairs(is_group_taken) do -- for name, taken in pairs(is_group_taken) do
if taken == true then -- if taken == true then
Spearhead.DcsUtil.DestroyGroup(name) -- Spearhead.DcsUtil.DestroyGroup(name)
count = count + 1 -- count = count + 1
end -- end
end -- end
Logger:info("Destroyed " .. count .. " units that are now managed in zones by Spearhead") -- Logger:info("Destroyed " .. count .. " units that are now managed in zones by Spearhead")
end -- end
cleanup() -- cleanup()
--- key: zoneName value: { current, routes = [ { point1, point2 } ] } --- key: zoneName value: { current, routes = [ { point1, point2 } ] }
o.tables.capRoutesPerStageNumber = {} o.tables.capRoutesPerStageNumber = {}
+1 -1
View File
@@ -203,7 +203,7 @@ do --init STAGE DIRECTOR
end end
end end
local max = self.stageConfig.maxMissionsInStage or 10 local max = self.stageConfig:getMaxMissionPerStage() or 10
local availableMissionsCount = Spearhead.Util.tableLength(availableMissions) local availableMissionsCount = Spearhead.Util.tableLength(availableMissions)
if activeCount < max and availableMissionsCount > 0 then if activeCount < max and availableMissionsCount > 0 then
+4 -1
View File
@@ -47,7 +47,10 @@ SpearheadConfig = {
--[[ --[[
TODO: Add manual stage transition documentation TODO: Add manual stage transition documentation
]] ]]
autoStages = true --default true autoStages = true, --default true
--Maximum missions per stage (includes all types of missions)
maxMissionStage = 10
} }
} }