- Added a randomization to some of the internal schedulers to ensure that the simulation does not get unnecessary hickups and guarantees more fluent play.

- Added the option SetFlashStatus() to the CommandCenter to ensure flashing of subscribed tasks automatically to inform the player while in-flight. Also extended TASK to ensure the flasing gets initialized once the player joins the task.
This commit is contained in:
FlightControl 2019-09-03 17:25:45 +02:00
parent 14b35cb069
commit 372dd704d2
4 changed files with 19 additions and 6 deletions

View File

@ -676,7 +676,7 @@ do -- ZONE_CAPTURE_COALITION
--BASE:GetParent( self ).onafterGuard( self ) --BASE:GetParent( self ).onafterGuard( self )
if not self.SmokeScheduler then if not self.SmokeScheduler then
self.SmokeScheduler = self:ScheduleRepeat( 1, 1, 0.1, nil, self.StatusSmoke, self ) self.SmokeScheduler = self:ScheduleRepeat( self.StartInterval, self.RepeatInterval, 0.1, nil, self.StatusSmoke, self )
end end
end end
@ -747,13 +747,13 @@ do -- ZONE_CAPTURE_COALITION
-- --
function ZONE_CAPTURE_COALITION:Start( StartInterval, RepeatInterval ) function ZONE_CAPTURE_COALITION:Start( StartInterval, RepeatInterval )
StartInterval = StartInterval or 15 self.StartInterval = StartInterval or 15
RepeatInterval = RepeatInterval or 15 self.RepeatInterval = RepeatInterval or 15
if self.ScheduleStatusZone then if self.ScheduleStatusZone then
self:ScheduleStop( self.ScheduleStatusZone ) self:ScheduleStop( self.ScheduleStatusZone )
end end
self.ScheduleStatusZone = self:ScheduleRepeat( StartInterval, RepeatInterval, 0.1, nil, self.StatusZone, self ) self.ScheduleStatusZone = self:ScheduleRepeat( self.StartInterval, self.RepeatInterval, 1.5, nil, self.StatusZone, self )
end end

View File

@ -201,6 +201,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
self:SetAutoAssignTasks( false ) self:SetAutoAssignTasks( false )
self:SetAutoAcceptTasks( true ) self:SetAutoAcceptTasks( true )
self:SetAutoAssignMethod( COMMANDCENTER.AutoAssignMethods.Random ) self:SetAutoAssignMethod( COMMANDCENTER.AutoAssignMethods.Random )
self:SetFlashStatus( false )
self:HandleEvent( EVENTS.Birth, self:HandleEvent( EVENTS.Birth,
--- @param #COMMANDCENTER self --- @param #COMMANDCENTER self
@ -791,3 +792,12 @@ function COMMANDCENTER:ReportDetails( ReportGroup, Task )
self:MessageToGroup( Report:Text(), ReportGroup ) self:MessageToGroup( Report:Text(), ReportGroup )
end end
--- Let the command center flash a report of the status of the subscribed task to a group.
-- @param #COMMANDCENTER self
function COMMANDCENTER:SetFlashStatus( Flash )
self:F()
self.FlashStatus = Flash or true
end

View File

@ -856,6 +856,8 @@ do -- Group Assignment
CommandCenter:SetMenu() CommandCenter:SetMenu()
self:MenuFlashTaskStatus( TaskGroup, self:GetMission():GetCommandCenter().FlashStatus )
return self return self
end end

View File

@ -133,7 +133,8 @@ function CLIENT:FindByName( ClientName, ClientBriefing, Error )
end end
function CLIENT:Register( ClientName ) function CLIENT:Register( ClientName )
local self = BASE:Inherit( self, UNIT:Register( ClientName ) )
local self = BASE:Inherit( self, UNIT:Register( ClientName ) ) -- #CLIENT
self:F( ClientName ) self:F( ClientName )
self.ClientName = ClientName self.ClientName = ClientName
@ -141,7 +142,7 @@ function CLIENT:Register( ClientName )
self.ClientAlive2 = false self.ClientAlive2 = false
--self.AliveCheckScheduler = routines.scheduleFunction( self._AliveCheckScheduler, { self }, timer.getTime() + 1, 5 ) --self.AliveCheckScheduler = routines.scheduleFunction( self._AliveCheckScheduler, { self }, timer.getTime() + 1, 5 )
self.AliveCheckScheduler = SCHEDULER:New( self, self._AliveCheckScheduler, { "Client Alive " .. ClientName }, 1, 5 ) self.AliveCheckScheduler = SCHEDULER:New( self, self._AliveCheckScheduler, { "Client Alive " .. ClientName }, 1, 5, 0.5 )
self:F( self ) self:F( self )
return self return self