mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #18 from FlightControl-Master/Escort
Fixed target scanning. There is still an small bug outstanding. Need to clear the task queue.
This commit is contained in:
commit
07ee6b189a
@ -89,8 +89,8 @@ function ESCORT:New( EscortClient, EscortGroup, EscortName, EscortBriefing )
|
|||||||
if EscortGroup:IsHelicopter() then
|
if EscortGroup:IsHelicopter() then
|
||||||
-- Scanning Targets
|
-- Scanning Targets
|
||||||
self.EscortMenuScanForTargets = MENU_CLIENT:New( self.EscortClient, "Scan targets", self.EscortMenu )
|
self.EscortMenuScanForTargets = MENU_CLIENT:New( self.EscortClient, "Scan targets", self.EscortMenu )
|
||||||
self.EscortMenuReportNearbyTargetsOn = MENU_CLIENT_COMMAND:New( self.EscortClient, "Scan targets 30 seconds", self.EscortMenuScanForTargets, ESCORT._ScanTargets30Seconds, { ParamSelf = self, ParamScanDuration = 30 } )
|
self.EscortMenuReportNearbyTargetsOn = MENU_CLIENT_COMMAND:New( self.EscortClient, "Scan targets 30 seconds", self.EscortMenuScanForTargets, ESCORT._ScanTargets, { ParamSelf = self, ParamScanDuration = 30 } )
|
||||||
self.EscortMenuReportNearbyTargetsOn = MENU_CLIENT_COMMAND:New( self.EscortClient, "Scan targets 60 seconds", self.EscortMenuScanForTargets, ESCORT._ScanTargets60Seconds, { ParamSelf = self, ParamScanDuration = 60 } )
|
self.EscortMenuReportNearbyTargetsOn = MENU_CLIENT_COMMAND:New( self.EscortClient, "Scan targets 60 seconds", self.EscortMenuScanForTargets, ESCORT._ScanTargets, { ParamSelf = self, ParamScanDuration = 60 } )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Attack Targets
|
-- Attack Targets
|
||||||
@ -283,41 +283,24 @@ function ESCORT._SwitchReportNearbyTargets( MenuParam )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- @param #MENUPARAM MenuParam
|
--- @param #MENUPARAM MenuParam
|
||||||
function ESCORT._ScanTargets30Seconds( MenuParam )
|
function ESCORT._ScanTargets( MenuParam )
|
||||||
MenuParam.ParamSelf:T()
|
|
||||||
|
|
||||||
local self = MenuParam.ParamSelf
|
local self = MenuParam.ParamSelf
|
||||||
local EscortGroup = self.EscortGroup
|
local EscortGroup = self.EscortGroup
|
||||||
local EscortClient = self.EscortClient
|
local EscortClient = self.EscortClient
|
||||||
|
|
||||||
|
local ScanDuration = MenuParam.ParamScanDuration
|
||||||
|
|
||||||
routines.removeFunction( self.FollowScheduler )
|
routines.removeFunction( self.FollowScheduler )
|
||||||
|
self.FollowScheduler = nil
|
||||||
|
|
||||||
EscortGroup:PushTask(
|
EscortGroup:PushTask(
|
||||||
EscortGroup:TaskControlled(
|
EscortGroup:TaskControlled(
|
||||||
EscortGroup:TaskOrbitCircle( 200, 20 ),
|
EscortGroup:TaskOrbitCircle( 200, 20 ),
|
||||||
EscortGroup:TaskCondition( nil, nil, nil, nil, 30, nil )
|
EscortGroup:TaskCondition( nil, nil, nil, nil, ScanDuration, nil )
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
EscortGroup:MessageToClient( "Scanning targets for 30 seconds.", 10, EscortClient )
|
EscortGroup:MessageToClient( "Scanning targets for " .. ScanDuration .. " seconds.", ScanDuration, EscortClient )
|
||||||
end
|
|
||||||
|
|
||||||
--- @param #MENUPARAM MenuParam
|
|
||||||
function ESCORT._ScanTargets60Seconds( MenuParam )
|
|
||||||
MenuParam.ParamSelf:T()
|
|
||||||
|
|
||||||
local self = MenuParam.ParamSelf
|
|
||||||
local EscortGroup = self.EscortGroup
|
|
||||||
local EscortClient = self.EscortClient
|
|
||||||
|
|
||||||
routines.removeFunction( self.FollowScheduler )
|
|
||||||
|
|
||||||
EscortGroup:PushTask(
|
|
||||||
EscortGroup:TaskControlled(
|
|
||||||
EscortGroup:TaskOrbitCircle( 200, 20 ),
|
|
||||||
EscortGroup:TaskCondition( nil, nil, nil, nil, 60, nil )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
EscortGroup:MessageToClient( "Scanning targets for 60 seconds.", 10, EscortClient )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #MENUPARAM MenuParam
|
--- @param #MENUPARAM MenuParam
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user