mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-22 06:45:20 +00:00
Add RADIO:StopBroadcast()
This commit is contained in:
@@ -289,7 +289,7 @@ end
|
|||||||
-- -- If your POSITIONABLE is not a UNIT or a GROUP, the Subtitle, SubtitleDuration and Loop are ignored
|
-- -- If your POSITIONABLE is not a UNIT or a GROUP, the Subtitle, SubtitleDuration and Loop are ignored
|
||||||
function RADIO:Broadcast()
|
function RADIO:Broadcast()
|
||||||
self:F()
|
self:F()
|
||||||
-- 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:GetDCSObject():getController():setCommand({
|
self.Positionable:GetDCSObject():getController():setCommand({
|
||||||
@@ -309,3 +309,22 @@ function RADIO:Broadcast()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Stops a transmission
|
||||||
|
-- @param #RADIO self
|
||||||
|
-- @return #RADIO self
|
||||||
|
-- @usage
|
||||||
|
-- -- Especially usefull to stop the broadcast of looped transmissions
|
||||||
|
-- -- Only works with broadcasts from UNIT or GROUP
|
||||||
|
function RADIO:StopBroadcast()
|
||||||
|
self:F()
|
||||||
|
-- If the POSITIONABLE is a UNIT or a GROUP, stop the transmission with the DCS "StopTransmission" command
|
||||||
|
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
|
||||||
|
self.Positionable:GetDCSObject():getController():setCommand({
|
||||||
|
id = "StopTransmission",
|
||||||
|
params = {}
|
||||||
|
})
|
||||||
|
else
|
||||||
|
self:E("This broadcast can't be stopped. It's not looped either, so please wait for the end of the sound file playback")
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user