AIRBOSS v0.2.5w

This commit is contained in:
funkyfranky 2018-11-14 16:11:54 +01:00
parent fa05352882
commit 3bc2baaf9d
2 changed files with 478 additions and 220 deletions

View File

@ -290,16 +290,28 @@ end
function RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop) function RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop)
self:F({FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop}) self:F({FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop})
-- Set file name.
self:SetFileName(FileName) self:SetFileName(FileName)
local Duration = 5
if SubtitleDuration then Duration = SubtitleDuration end -- Set frequency.
-- SubtitleDuration argument was missing, adding it if Frequency then
if Subtitle then self:SetSubtitle(Subtitle, Duration) end self:SetFrequency(Frequency)
-- self:SetSubtitleDuration is non existent, removing faulty line end
-- if SubtitleDuration then self:SetSubtitleDuration(SubtitleDuration) end
if Frequency then self:SetFrequency(Frequency) end -- Set modulation AM/FM.
if Modulation then self:SetModulation(Modulation) end if Modulation then
if Loop then self:SetLoop(Loop) end self:SetModulation(Modulation)
end
-- Set subtitle.
if Subtitle then
self:SetSubtitle(Subtitle, SubtitleDuration or 0)
end
-- Set Looping.
if Loop then
self:SetLoop(Loop)
end
return self return self
end end
@ -313,19 +325,26 @@ end
-- * If your POSITIONABLE is a UNIT or a GROUP, the Power is ignored. -- * If your POSITIONABLE is a UNIT or a GROUP, the Power is ignored.
-- * If your POSITIONABLE is not a UNIT or a GROUP, the Subtitle, SubtitleDuration are ignored -- * If your POSITIONABLE is not a UNIT or a GROUP, the Subtitle, SubtitleDuration are ignored
-- @param #RADIO self -- @param #RADIO self
-- @param #string filename (Optinal) Sound file name. Default self.FileName.
-- @param #string subtitle (Optional) Subtitle. Default self.Subtitle.
-- @param #number subtitleduraction (Optional) Subtitle duraction. Default self.SubtitleDuration.
-- @return #RADIO self -- @return #RADIO self
function RADIO:Broadcast() function RADIO:Broadcast(filename, subtitle, subtitleduration)
self:F() self:F()
filename=filename or self.FileName
subtitle=subtitle or self.Subtitle
subtitleduration=subtitleduration or self.SubtitleDuration
-- If the POSITIONABLE is actually a UNIT or a GROUP, use the more complicated DCS command system -- If the POSITIONABLE is actually a UNIT or a GROUP, use the more complicated DCS command system
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
self:T2("Broadcasting from a UNIT or a GROUP") self:T2("Broadcasting from a UNIT or a GROUP")
self.Positionable:SetCommand({ self.Positionable:SetCommand({
id = "TransmitMessage", id = "TransmitMessage",
params = { params = {
file = self.FileName, file = filename,
duration = self.SubtitleDuration, duration = subtitleduration,
subtitle = self.Subtitle, subtitle = subtitle,
loop = self.Loop, loop = self.Loop,
} }
}) })
@ -338,6 +357,8 @@ function RADIO:Broadcast()
return self return self
end end
--- Stops a transmission --- Stops a transmission
-- This function is especially usefull to stop the broadcast of looped transmissions -- This function is especially usefull to stop the broadcast of looped transmissions
-- @param #RADIO self -- @param #RADIO self

File diff suppressed because it is too large Load Diff