From bdd9efa2cc0ab21a34a4739cb33148af056bcde4 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 17 Jun 2024 18:08:45 +0200 Subject: [PATCH] Update FlightControl.lua - Added `FLIGHTCONTROL:SetTransmitOnlyWithPlayers()` --- Moose Development/Moose/Ops/FlightControl.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/FlightControl.lua b/Moose Development/Moose/Ops/FlightControl.lua index bf37c4061..2db7c3942 100644 --- a/Moose Development/Moose/Ops/FlightControl.lua +++ b/Moose Development/Moose/Ops/FlightControl.lua @@ -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