Feature/lanes (#40)
this fixes #35 does not close but starts work partly on #41 Reviewed-on: #40 Co-authored-by: dutchie031 <timrorije@gmail.com>
This commit was merged in pull request #40.
This commit is contained in:
@@ -392,9 +392,12 @@ function CapBase:CheckAndScheduleIntercept()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
function CapBase:OnStageNumberChanged(number)
|
||||
|
||||
function CapBase:OnStageNumberChanged(number, laneIdentifier)
|
||||
-- only react on "main" lane changes, ignore other lanes for now
|
||||
if laneIdentifier ~= nil then return end
|
||||
|
||||
self.activeStage = number
|
||||
|
||||
if self:IsBaseActiveWhenStageIsActive(number) == true then
|
||||
|
||||
@@ -2,6 +2,9 @@ local SpearheadEvents = require("classes.spearhead_events")
|
||||
local RTBMission = require("classes.capClasses.taskings.RTB")
|
||||
local Util = require("classes.util.Util")
|
||||
local DcsUtil = require("classes.util.DcsUtil")
|
||||
local GlobalConfig = require("classes.configuration.GlobalConfig")
|
||||
local CustomDrawing = require("classes.stageClasses.drawings.CustomDrawing")
|
||||
local DrawingHelper = require("classes.stageClasses.drawings.helper.DrawingHelper")
|
||||
|
||||
---@class AirGroup : OnUnitLostListener
|
||||
---@field protected _logger Logger
|
||||
@@ -12,9 +15,12 @@ local DcsUtil = require("classes.util.DcsUtil")
|
||||
---@field protected _config CapConfig
|
||||
---@field protected _checkLivenessNumber number
|
||||
---@field protected _spawnManager SpawnManager
|
||||
---@field protected _routeDrawing CustomDrawing?
|
||||
local AirGroup = {}
|
||||
AirGroup.__index = AirGroup
|
||||
|
||||
local globalConfig = GlobalConfig.New()
|
||||
|
||||
---@param logger Logger
|
||||
---@param groupName string
|
||||
---@param groupType AirGroupType
|
||||
@@ -28,6 +34,7 @@ function AirGroup:New(groupName, groupType, config, logger, spawnManager)
|
||||
self._config = config
|
||||
self._logger = logger
|
||||
self._spawnManager = spawnManager
|
||||
self._routeDrawings = {}
|
||||
|
||||
local group = Group.getByName(self._groupName)
|
||||
if group then
|
||||
@@ -92,6 +99,27 @@ function AirGroup:SetMissionPrivate(mission)
|
||||
if group and mission then
|
||||
group:getController():setTask(mission)
|
||||
self._logger:debug("mission - Task set for group: " .. self._groupName)
|
||||
|
||||
if globalConfig:isDebugMenuEnabled() == true then
|
||||
-- draw the mission route for debugging purposes
|
||||
if self._routeDrawing then
|
||||
self._routeDrawing:Remove()
|
||||
end
|
||||
|
||||
local points = {}
|
||||
if mission and mission.params and mission.params.route and mission.params.route.points then
|
||||
for _, wp in pairs(mission.params.route.points) do
|
||||
if wp.x and wp.y then
|
||||
table.insert(points, { x = wp.x, y = wp.y })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local colorString = DrawingHelper.ColorTableToColorString({ 1, 0, 0, 1 })
|
||||
self._routeDrawing = CustomDrawing.FromPoints(points, colorString, 5, 2)
|
||||
self._routeDrawing:Draw()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user