mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
- Added a NoTrace option to the scheduler, so for those schedulers that have a schedule in microseconds, you may wanna use the function NoTrace(), to avoid spamming the dcs.log.
- Started with the implementation of multiple languages of speech. Got now a Russian and English prototype working. - Moved radio frequency settings to a squadron, so multiple squadrons can communicate in their own radio frequency.
This commit is contained in:
@@ -261,37 +261,17 @@ do -- DETECTION MANAGER
|
||||
return self.CC
|
||||
end
|
||||
|
||||
--- Set the frequency of communication and the mode of communication for voice overs.
|
||||
-- @param #DETECTION_MANAGER self
|
||||
-- @param #number RadioFrequency The frequency of communication.
|
||||
-- @param #number RadioModulation The modulation of communication.
|
||||
-- @param #number RadioPower The power in Watts of communication.
|
||||
function DETECTION_MANAGER:SetRadioFrequency( RadioFrequency, RadioModulation, RadioPower )
|
||||
|
||||
self.RadioFrequency = RadioFrequency
|
||||
self.RadioModulation = RadioModulation or radio.modulation.AM
|
||||
self.RadioPower = RadioPower or 100
|
||||
|
||||
if self.RadioQueue then
|
||||
self.RadioQueue:Stop()
|
||||
end
|
||||
|
||||
self.RadioQueue = nil
|
||||
|
||||
self.RadioQueue = RADIOSPEECH:New( self.RadioFrequency, self.RadioModulation )
|
||||
self.RadioQueue.power = self.RadioPower
|
||||
self.RadioQueue:Start( 0.5 )
|
||||
end
|
||||
|
||||
--- Send an information message to the players reporting to the command center.
|
||||
-- @param #DETECTION_MANAGER self
|
||||
-- @param #table Squadron The squadron table.
|
||||
-- @param #string Message The message to be sent.
|
||||
-- @param #string SoundFile The name of the sound file .wav or .ogg.
|
||||
-- @param #number SoundDuration The duration of the sound.
|
||||
-- @param #string SoundPath The path pointing to the folder in the mission file.
|
||||
-- @param Wrapper.Group#GROUP DefenderGroup The defender group sending the message.
|
||||
-- @return #DETECTION_MANGER self
|
||||
function DETECTION_MANAGER:MessageToPlayers( Message, DefenderGroup )
|
||||
function DETECTION_MANAGER:MessageToPlayers( Squadron, Message, DefenderGroup )
|
||||
|
||||
self:F( { Message = Message } )
|
||||
|
||||
@@ -306,18 +286,18 @@ do -- DETECTION MANAGER
|
||||
self.CC:MessageToCoalition( Message )
|
||||
end
|
||||
|
||||
Message = Message:gsub( "°", "degrees" )
|
||||
Message = Message:gsub( "(%d)%.(%d)", "%1dot%2" )
|
||||
Message = Message:gsub( "°", " degrees " )
|
||||
Message = Message:gsub( "(%d)%.(%d)", "%1 dot %2" )
|
||||
|
||||
-- Here we handle the transmission of the voice over.
|
||||
-- If for a certain reason the Defender does not exist, we use the coordinate of the airbase to send the message from.
|
||||
local RadioQueue = self.RadioQueue -- Core.RadioQueue#RADIOQUEUE
|
||||
local RadioQueue = Squadron.RadioQueue -- Core.RadioSpeech#RADIOSPEECH
|
||||
if RadioQueue then
|
||||
local DefenderUnit = DefenderGroup:GetUnit(1)
|
||||
if DefenderUnit and DefenderUnit:IsAlive() then
|
||||
RadioQueue:SetSenderUnitName( DefenderUnit:GetName() )
|
||||
end
|
||||
RadioQueue:Speak( Message )
|
||||
RadioQueue:Speak( Message, Squadron.Language )
|
||||
end
|
||||
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user