mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
xx
This commit is contained in:
parent
50436b8ced
commit
083bf13fe4
@ -98,7 +98,7 @@ PLAYERTASK = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASK.version="0.1.24"
|
PLAYERTASK.version="0.1.25"
|
||||||
|
|
||||||
--- Generic task condition.
|
--- Generic task condition.
|
||||||
-- @type PLAYERTASK.Condition
|
-- @type PLAYERTASK.Condition
|
||||||
@ -1308,6 +1308,8 @@ do
|
|||||||
-- @field Core.ClientMenu#CLIENTMENU ActiveTopMenu
|
-- @field Core.ClientMenu#CLIENTMENU ActiveTopMenu
|
||||||
-- @field Core.ClientMenu#CLIENTMENU ActiveInfoMenu
|
-- @field Core.ClientMenu#CLIENTMENU ActiveInfoMenu
|
||||||
-- @field Core.ClientMenu#CLIENTMENU MenuNoTask
|
-- @field Core.ClientMenu#CLIENTMENU MenuNoTask
|
||||||
|
-- @field #boolean InformationMenu Show Radio Info Menu
|
||||||
|
-- @field #number TaskInfoDuration How long to show the briefing info on the screen
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1663,6 +1665,8 @@ PLAYERTASKCONTROLLER = {
|
|||||||
UseTypeNames = false,
|
UseTypeNames = false,
|
||||||
Scoring = nil,
|
Scoring = nil,
|
||||||
MenuNoTask = nil,
|
MenuNoTask = nil,
|
||||||
|
InformationMenu = false,
|
||||||
|
TaskInfoDuration = 30,
|
||||||
}
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1799,6 +1803,7 @@ PLAYERTASKCONTROLLER.Messages = {
|
|||||||
CRUISER = "Cruiser",
|
CRUISER = "Cruiser",
|
||||||
DESTROYER = "Destroyer",
|
DESTROYER = "Destroyer",
|
||||||
CARRIER = "Aircraft Carrier",
|
CARRIER = "Aircraft Carrier",
|
||||||
|
RADIOS = "Radios",
|
||||||
},
|
},
|
||||||
DE = {
|
DE = {
|
||||||
TASKABORT = "Auftrag abgebrochen!",
|
TASKABORT = "Auftrag abgebrochen!",
|
||||||
@ -1882,12 +1887,13 @@ PLAYERTASKCONTROLLER.Messages = {
|
|||||||
CRUISER = "Kreuzer",
|
CRUISER = "Kreuzer",
|
||||||
DESTROYER = "Zerstörer",
|
DESTROYER = "Zerstörer",
|
||||||
CARRIER = "Flugzeugträger",
|
CARRIER = "Flugzeugträger",
|
||||||
|
RADIOS = "Frequenzen",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASKCONTROLLER.version="0.1.67"
|
PLAYERTASKCONTROLLER.version="0.1.69"
|
||||||
|
|
||||||
--- Create and run a new TASKCONTROLLER instance.
|
--- Create and run a new TASKCONTROLLER instance.
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
@ -1949,6 +1955,10 @@ function PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter)
|
|||||||
|
|
||||||
self.UseTypeNames = false
|
self.UseTypeNames = false
|
||||||
|
|
||||||
|
self.InformationMenu = false
|
||||||
|
|
||||||
|
self.TaskInfoDuration = 30
|
||||||
|
|
||||||
self.IsClientSet = false
|
self.IsClientSet = false
|
||||||
|
|
||||||
if ClientFilter and type(ClientFilter) == "table" and ClientFilter.ClassName and ClientFilter.ClassName == "SET_CLIENT" then
|
if ClientFilter and type(ClientFilter) == "table" and ClientFilter.ClassName and ClientFilter.ClassName == "SET_CLIENT" then
|
||||||
@ -2166,6 +2176,16 @@ function PLAYERTASKCONTROLLER:SetAllowFlashDirection(OnOff)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Set to show a menu entry to retrieve the radio frequencies used.
|
||||||
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
|
-- @param #boolean OnOff Set to `true` to switch on and `false` to switch off. Default is OFF.
|
||||||
|
-- @return #PLAYERTASKCONTROLLER self
|
||||||
|
function PLAYERTASKCONTROLLER:SetShowRadioInfoMenu(OnOff)
|
||||||
|
self:T(self.lid.."SetAllowRadioInfoMenu")
|
||||||
|
self.InformationMenu = OnOff
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- [User] Do not show menu entries to smoke or flare targets
|
--- [User] Do not show menu entries to smoke or flare targets
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @return #PLAYERTASKCONTROLLER self
|
-- @return #PLAYERTASKCONTROLLER self
|
||||||
@ -2261,7 +2281,7 @@ function PLAYERTASKCONTROLLER:_GetTextForSpeech(text)
|
|||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
--- [User] Set repetition options for tasks
|
--- [User] Set repetition options for tasks.
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @param #boolean OnOff Set to `true` to switch on and `false` to switch off (defaults to true)
|
-- @param #boolean OnOff Set to `true` to switch on and `false` to switch off (defaults to true)
|
||||||
-- @param #number Repeats Number of repeats (defaults to 5)
|
-- @param #number Repeats Number of repeats (defaults to 5)
|
||||||
@ -2279,6 +2299,16 @@ function PLAYERTASKCONTROLLER:SetTaskRepetition(OnOff, Repeats)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Set how long the briefing is shown on screen.
|
||||||
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
|
-- @param #number Seconds Duration in seconds. Defaults to 30 seconds.
|
||||||
|
-- @return #PLAYERTASKCONTROLLER self
|
||||||
|
function PLAYERTASKCONTROLLER:SetBriefingDuration(Seconds)
|
||||||
|
self:T(self.lid.."SetBriefingDuration")
|
||||||
|
self.TaskInfoDuration = Seconds or 30
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] Send message to SET_CLIENT of players
|
--- [Internal] Send message to SET_CLIENT of players
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @param #string Text the text to be send
|
-- @param #string Text the text to be send
|
||||||
@ -3464,6 +3494,32 @@ function PLAYERTASKCONTROLLER:_SwitchFlashing(Group, Client)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function PLAYERTASKCONTROLLER:_ShowRadioInfo(Group, Client)
|
||||||
|
self:T(self.lid.."_ShowRadioInfo")
|
||||||
|
local playername, ttsplayername = self:_GetPlayerName(Client)
|
||||||
|
|
||||||
|
if self.UseSRS then
|
||||||
|
local frequency = self.Frequency
|
||||||
|
local freqtext = ""
|
||||||
|
if type(frequency) == "table" then
|
||||||
|
freqtext = self.gettext:GetEntry("FREQUENCIES",self.locale)
|
||||||
|
freqtext = freqtext..table.concat(frequency,", ")
|
||||||
|
else
|
||||||
|
local freqt = self.gettext:GetEntry("FREQUENCY",self.locale)
|
||||||
|
freqtext = string.format(freqt,frequency)
|
||||||
|
end
|
||||||
|
|
||||||
|
local switchtext = self.gettext:GetEntry("BROADCAST",self.locale)
|
||||||
|
|
||||||
|
playername = ttsplayername or self:_GetTextForSpeech(playername)
|
||||||
|
--local text = string.format("%s, %s, switch to %s for task assignment!",EventData.IniPlayerName,self.MenuName or self.Name,freqtext)
|
||||||
|
local text = string.format(switchtext,playername,self.MenuName or self.Name,freqtext)
|
||||||
|
self.SRSQueue:NewTransmission(text,nil,self.SRS,nil,2,{Group},text,30,self.BCFrequency,self.BCModulation)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] Flashing directional info for a client
|
--- [Internal] Flashing directional info for a client
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @return #PLAYERTASKCONTROLLER self
|
-- @return #PLAYERTASKCONTROLLER self
|
||||||
@ -3683,7 +3739,7 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Task, Group, Client)
|
|||||||
text = self.gettext:GetEntry("NOACTIVETASK",self.locale)
|
text = self.gettext:GetEntry("NOACTIVETASK",self.locale)
|
||||||
end
|
end
|
||||||
if not self.NoScreenOutput then
|
if not self.NoScreenOutput then
|
||||||
local m=MESSAGE:New(text,15,"Tasking"):ToClient(Client)
|
local m=MESSAGE:New(text,self.TaskInfoDuration or 30,"Tasking"):ToClient(Client)
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -4037,6 +4093,11 @@ function PLAYERTASKCONTROLLER:_CreateJoinMenuTemplate()
|
|||||||
self.MenuNoTask = nil
|
self.MenuNoTask = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.InformationMenu then
|
||||||
|
local radioinfo = self.gettext:GetEntry("RADIOS",self.locale)
|
||||||
|
JoinTaskMenuTemplate:NewEntry(radioinfo,self.JoinTopMenu,self._ShowRadioInfo,self)
|
||||||
|
end
|
||||||
|
|
||||||
self.JoinTaskMenuTemplate = JoinTaskMenuTemplate
|
self.JoinTaskMenuTemplate = JoinTaskMenuTemplate
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user