mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
updates
This commit is contained in:
parent
c5236d337e
commit
7b5b57c087
@ -293,6 +293,9 @@ function AI_ESCORT:onafterStart( EscortGroupSet )
|
|||||||
|
|
||||||
self.Detection:__Start( 30 )
|
self.Detection:__Start( 30 )
|
||||||
|
|
||||||
|
self:HandleEvent( EVENTS.Dead, OnEventDeadOrCrash )
|
||||||
|
self:HandleEvent( EVENTS.Crash, OnEventDeadOrCrash )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set a Detection method for the EscortUnit to be reported upon.
|
--- Set a Detection method for the EscortUnit to be reported upon.
|
||||||
@ -554,8 +557,7 @@ function AI_ESCORT:EscortMenuJoinUp( EscortGroup )
|
|||||||
if self.Menu.JoinUp == true then
|
if self.Menu.JoinUp == true then
|
||||||
if EscortGroup:IsAir() then
|
if EscortGroup:IsAir() then
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortGroup.EscortMenu )
|
||||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
|
||||||
local EscortMenuJoinUp = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Join Up", EscortMenuReportNavigation, AI_ESCORT._JoinUp, self, EscortGroup )
|
local EscortMenuJoinUp = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Join Up", EscortMenuReportNavigation, AI_ESCORT._JoinUp, self, EscortGroup )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -588,8 +590,7 @@ function AI_ESCORT:EscortMenuHoldAtEscortPosition( EscortGroup )
|
|||||||
for _, HoldAtEscortPosition in pairs( self.Menu.HoldAtEscortPosition ) do
|
for _, HoldAtEscortPosition in pairs( self.Menu.HoldAtEscortPosition ) do
|
||||||
if EscortGroup:IsAir() then
|
if EscortGroup:IsAir() then
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortGroup.EscortMenu )
|
||||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
|
||||||
local EscortMenuHoldPosition = MENU_GROUP_COMMAND
|
local EscortMenuHoldPosition = MENU_GROUP_COMMAND
|
||||||
:New(
|
:New(
|
||||||
self.PlayerGroup,
|
self.PlayerGroup,
|
||||||
@ -679,8 +680,7 @@ function AI_ESCORT:EscortMenuHoldAtLeaderPosition( EscortGroup )
|
|||||||
if EscortGroup:IsAir() then
|
if EscortGroup:IsAir() then
|
||||||
|
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortGroup.EscortMenu )
|
||||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
|
||||||
|
|
||||||
local EscortMenuHoldAtLeaderPosition = MENU_GROUP_COMMAND
|
local EscortMenuHoldAtLeaderPosition = MENU_GROUP_COMMAND
|
||||||
:New(
|
:New(
|
||||||
@ -850,8 +850,7 @@ function AI_ESCORT:MenuFlare( MenuTextFormat )
|
|||||||
function( EscortGroup )
|
function( EscortGroup )
|
||||||
|
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortGroup.EscortMenu )
|
||||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
|
||||||
local EscortMenuFlare = MENU_GROUP:New( self.PlayerGroup, MenuText, EscortMenuReportNavigation )
|
local EscortMenuFlare = MENU_GROUP:New( self.PlayerGroup, MenuText, EscortMenuReportNavigation )
|
||||||
|
|
||||||
local EscortMenuFlareGreen = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Release green flare", EscortMenuFlare, AI_ESCORT._Flare, self, EscortGroup, FLARECOLOR.Green, "Released a green flare!" )
|
local EscortMenuFlareGreen = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Release green flare", EscortMenuFlare, AI_ESCORT._Flare, self, EscortGroup, FLARECOLOR.Green, "Released a green flare!" )
|
||||||
@ -897,8 +896,7 @@ function AI_ESCORT:MenuSmoke( MenuTextFormat )
|
|||||||
if not EscortGroup:IsAir() then
|
if not EscortGroup:IsAir() then
|
||||||
|
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortGroup.EscortMenu )
|
||||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
|
||||||
local EscortMenuSmoke = MENU_GROUP:New( self.PlayerGroup, MenuText, EscortMenuReportNavigation )
|
local EscortMenuSmoke = MENU_GROUP:New( self.PlayerGroup, MenuText, EscortMenuReportNavigation )
|
||||||
|
|
||||||
local EscortMenuSmokeGreen = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Release green smoke", EscortMenuSmoke, AI_ESCORT._Smoke, self, EscortGroup, SMOKECOLOR.Green, "Releasing green smoke!" )
|
local EscortMenuSmokeGreen = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Release green smoke", EscortMenuSmoke, AI_ESCORT._Smoke, self, EscortGroup, SMOKECOLOR.Green, "Releasing green smoke!" )
|
||||||
@ -948,8 +946,7 @@ function AI_ESCORT:MenuReportTargets( Seconds )
|
|||||||
if EscortGroup:IsAir() then
|
if EscortGroup:IsAir() then
|
||||||
|
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuReportTargets = MENU_GROUP:New( self.PlayerGroup, "Report targets", EscortGroup.EscortMenu )
|
||||||
local EscortMenuReportTargets = MENU_GROUP:New( self.PlayerGroup, "Report targets", EscortMenu )
|
|
||||||
|
|
||||||
|
|
||||||
-- Report Targets
|
-- Report Targets
|
||||||
@ -958,7 +955,7 @@ function AI_ESCORT:MenuReportTargets( Seconds )
|
|||||||
--EscortGroup.EscortMenuReportNearbyTargetsOff = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Report targets off", EscortGroup.EscortMenuReportNearbyTargets, AI_ESCORT._SwitchReportNearbyTargets, self, EscortGroup, false )
|
--EscortGroup.EscortMenuReportNearbyTargetsOff = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Report targets off", EscortGroup.EscortMenuReportNearbyTargets, AI_ESCORT._SwitchReportNearbyTargets, self, EscortGroup, false )
|
||||||
|
|
||||||
-- Attack Targets
|
-- Attack Targets
|
||||||
local EscortMenuAttackTargets = MENU_GROUP:New( self.PlayerGroup, "Attack targets", EscortMenu )
|
local EscortMenuAttackTargets = MENU_GROUP:New( self.PlayerGroup, "Attack targets", EscortGroup.EscortMenu )
|
||||||
|
|
||||||
EscortGroup.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, { EscortGroup }, timer, Seconds )
|
EscortGroup.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, { EscortGroup }, timer, Seconds )
|
||||||
timer=timer+1
|
timer=timer+1
|
||||||
@ -1012,8 +1009,7 @@ function AI_ESCORT:MenuROE( MenuTextFormat )
|
|||||||
-- Rules of Engagement
|
-- Rules of Engagement
|
||||||
|
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuROE = MENU_GROUP:New( self.PlayerGroup, "Rule Of Engagement", EscortGroup.EscortMenu )
|
||||||
local EscortMenuROE = MENU_GROUP:New( self.PlayerGroup, "Rule Of Engagement", EscortMenu )
|
|
||||||
|
|
||||||
if EscortGroup:OptionROEHoldFirePossible() then
|
if EscortGroup:OptionROEHoldFirePossible() then
|
||||||
local EscortMenuROEHoldFire = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Hold fire", EscortMenuROE, AI_ESCORT._ROE, self, EscortGroup, GROUP.OptionROEHoldFire, "Holding weapons!" )
|
local EscortMenuROEHoldFire = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Hold fire", EscortMenuROE, AI_ESCORT._ROE, self, EscortGroup, GROUP.OptionROEHoldFire, "Holding weapons!" )
|
||||||
@ -1055,8 +1051,7 @@ function AI_ESCORT:MenuROT( MenuTextFormat )
|
|||||||
if EscortGroup:IsAir() then
|
if EscortGroup:IsAir() then
|
||||||
|
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuROT = MENU_GROUP:New( self.PlayerGroup, "Reaction On Threat", EscortGroup.EscortMenu )
|
||||||
local EscortMenuROT = MENU_GROUP:New( self.PlayerGroup, "Reaction On Threat", EscortMenu )
|
|
||||||
|
|
||||||
if not EscortGroup.EscortMenuEvasion then
|
if not EscortGroup.EscortMenuEvasion then
|
||||||
-- Reaction to Threats
|
-- Reaction to Threats
|
||||||
@ -1092,8 +1087,7 @@ function AI_ESCORT:MenuResumeMission()
|
|||||||
function( EscortGroup )
|
function( EscortGroup )
|
||||||
if EscortGroup:IsAir() then
|
if EscortGroup:IsAir() then
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
EscortGroup.EscortMenuResumeMission = MENU_GROUP:New( self.PlayerGroup, "Resume from", EscortGroup.EscortMenu )
|
||||||
EscortGroup.EscortMenuResumeMission = MENU_GROUP:New( self.PlayerGroup, "Resume from", EscortMenu )
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
@ -1435,7 +1429,7 @@ function AI_ESCORT:_AttackTarget( EscortGroup, DetectedItem )
|
|||||||
)
|
)
|
||||||
|
|
||||||
Tasks[#Tasks+1] = EscortGroup:TaskCombo( AttackUnitTasks )
|
Tasks[#Tasks+1] = EscortGroup:TaskCombo( AttackUnitTasks )
|
||||||
Tasks[#Tasks+1] = EscortGroup:TaskFunction( "AI_ESCORT.___Resume", EscortGroup, self )
|
Tasks[#Tasks+1] = EscortGroup:TaskFunction( "AI_ESCORT.___Resume", self )
|
||||||
|
|
||||||
EscortGroup:SetTask(
|
EscortGroup:SetTask(
|
||||||
EscortGroup:TaskCombo(
|
EscortGroup:TaskCombo(
|
||||||
@ -1590,8 +1584,7 @@ function AI_ESCORT:_ReportTargetsScheduler( EscortGroup )
|
|||||||
local TimeUpdate = timer.getTime()
|
local TimeUpdate = timer.getTime()
|
||||||
|
|
||||||
local EscortGroupName = EscortGroup:GetName()
|
local EscortGroupName = EscortGroup:GetName()
|
||||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
local EscortMenuAttackTargets = MENU_GROUP:New( self.PlayerGroup, "Attack targets", EscortGroup.EscortMenu )
|
||||||
local EscortMenuAttackTargets = MENU_GROUP:New( self.PlayerGroup, "Attack targets", EscortMenu )
|
|
||||||
|
|
||||||
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
||||||
|
|
||||||
@ -1712,3 +1705,5 @@ function AI_ESCORT:_FlightReportTargetsScheduler()
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -231,22 +231,24 @@ function AI_ESCORT_REQUEST:SpawnEscort()
|
|||||||
EscortGroup:OptionROTVertical()
|
EscortGroup:OptionROTVertical()
|
||||||
EscortGroup:OptionROEHoldFire()
|
EscortGroup:OptionROEHoldFire()
|
||||||
|
|
||||||
self:ScheduleOnce( 5,
|
self:ScheduleOnce( 0.1,
|
||||||
function()
|
function( EscortGroup )
|
||||||
local LeaderEscort = self.EscortGroupSet:GetFirst() -- Wrapper.Group#GROUP
|
local LeaderEscort = self.EscortGroupSet:GetFirst() -- Wrapper.Group#GROUP
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
Report:Add( "Joining Up " .. self.EscortGroupSet:GetUnitTypeNames():Text( ", " ) .. " from " .. LeaderEscort:GetCoordinate():ToString( self.EscortUnit ) )
|
Report:Add( "Joining Up " .. self.EscortGroupSet:GetUnitTypeNames():Text( ", " ) .. " from " .. LeaderEscort:GetCoordinate():ToString( self.EscortUnit ) )
|
||||||
|
|
||||||
LeaderEscort:MessageTypeToGroup( Report:Text(), MESSAGE.Type.Information, self.PlayerUnit )
|
LeaderEscort:MessageTypeToGroup( Report:Text(), MESSAGE.Type.Information, self.PlayerUnit )
|
||||||
|
|
||||||
self:FormationTrail( 50, 50, 50 )
|
self:FormationTrail( 50, 50, 50 )
|
||||||
if self.SpawnMode == self.__Enum.Mode.Formation then
|
if self.SpawnMode == self.__Enum.Mode.Formation then
|
||||||
self:JoinFormation( EscortGroup )
|
self:JoinFormation( EscortGroup )
|
||||||
end
|
end
|
||||||
|
|
||||||
--self:Menus( self.XStart, self.XSpace, self.YStart, self.YSpace, self.ZStart, self.ZSpace, self.ZLevels )
|
--self:Menus( self.XStart, self.XSpace, self.YStart, self.YSpace, self.ZStart, self.ZSpace, self.ZLevels )
|
||||||
|
|
||||||
|
EscortGroup.EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroup:GetName(), self.MainMenu )
|
||||||
|
|
||||||
self:EscortMenuJoinUp( EscortGroup )
|
self:EscortMenuJoinUp( EscortGroup )
|
||||||
|
|
||||||
self:EscortMenuHoldAtEscortPosition( EscortGroup )
|
self:EscortMenuHoldAtEscortPosition( EscortGroup )
|
||||||
@ -261,7 +263,18 @@ function AI_ESCORT_REQUEST:SpawnEscort()
|
|||||||
self:MenuROT()
|
self:MenuROT()
|
||||||
|
|
||||||
self:MenuResumeMission()
|
self:MenuResumeMission()
|
||||||
end
|
|
||||||
|
--- @param #AI_ESCORT self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function EscortGroup:OnEventDeadOrCrash( EventData )
|
||||||
|
self:F( { "EventDead", EventData } )
|
||||||
|
self.EscortMenu:Remove()
|
||||||
|
end
|
||||||
|
|
||||||
|
EscortGroup:HandleEvent( EVENTS.Dead, EscortGroup.OnEventDeadOrCrash )
|
||||||
|
EscortGroup:HandleEvent( EVENTS.Crash, EscortGroup.OnEventDeadOrCrash )
|
||||||
|
|
||||||
|
end, EscortGroup
|
||||||
)
|
)
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -277,6 +290,9 @@ function AI_ESCORT_REQUEST:onafterStart( EscortGroupSet )
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:HandleEvent( EVENTS.Dead, self.OnEventDeadOrCrash )
|
||||||
|
self:HandleEvent( EVENTS.Crash, self.OnEventDeadOrCrash )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user