Update FlightControl.lua

- Added `FLIGHTCONTROL:SetTransmitOnlyWithPlayers()`
This commit is contained in:
Frank 2024-06-17 18:08:45 +02:00
parent a778e910f7
commit bdd9efa2cc

View File

@ -332,7 +332,7 @@ FLIGHTCONTROL.FlightStatus={
--- FlightControl class version.
-- @field #string version
FLIGHTCONTROL.version="0.7.6"
FLIGHTCONTROL.version="0.7.7"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
@ -420,6 +420,9 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port,
-- Init msrs queue.
self.msrsqueue=MSRSQUEUE:New(self.alias)
-- Set that transmission is only if alive players on the server.
self:SetTransmitOnlyWithPlayers(true)
-- Init msrs bases
local path = PathToSRS or MSRS.path
local port = Port or MSRS.port or 5002
@ -589,6 +592,16 @@ function FLIGHTCONTROL:SetRadioOnlyIfPlayers(Switch)
end
--- Set whether to only transmit TTS messages if there are players on the server.
-- @param #FLIGHTCONTROL self
-- @param #boolean Switch If `true`, only send TTS messages if there are alive Players. If `false` or `nil`, transmission are done also if no players are on the server.
-- @return #FLIGHTCONTROL self
function FLIGHTCONTROL:SetTransmitOnlyWithPlayers(Switch)
self.msrsqueue:SetTransmitOnlyWithPlayers(Switch)
return self
end
--- Set subtitles to appear on SRS TTS messages.
-- @param #FLIGHTCONTROL self
-- @return #FLIGHTCONTROL self