#PLAYERTASK - show freetext briefing also if not using SRS

This commit is contained in:
Applevangelist 2022-10-18 13:32:18 +02:00
parent 0bc09548cf
commit 23f45359f8
3 changed files with 28 additions and 11 deletions

View File

@ -1,4 +1,4 @@
--- **Ops** - Allow a player in a helo like the Gazelle, KA-50 to recon and lase groud targets. --- **Ops** - Allow a player in a helo like the Gazelle, KA-50 to recon and lase ground targets.
-- --
-- ## Features: -- ## Features:
-- --

View File

@ -944,7 +944,7 @@ do
-- --
-- ## 2 Task Types -- ## 2 Task Types
-- --
-- Targets can be of types GROUP, SET\_GROUP, UNIT, SET\_UNIT, STATIC, SET\_STATIC, AIRBASE, ZONE or COORDINATE. The system will auto-create tasks for players from these targets. -- Targets can be of types GROUP, SET\_GROUP, UNIT, SET\_UNIT, STATIC, SET\_STATIC, SET\_SCENERY, AIRBASE, ZONE or COORDINATE. The system will auto-create tasks for players from these targets.
-- Tasks are created as @{Ops.PlayerTask#PLAYERTASK} objects, which leverage @{Ops.Target#TARGET} for the management of the actual target. The system creates these task types -- Tasks are created as @{Ops.PlayerTask#PLAYERTASK} objects, which leverage @{Ops.Target#TARGET} for the management of the actual target. The system creates these task types
-- from the target objects: -- from the target objects:
-- --
@ -964,6 +964,8 @@ do
-- * ZONE and COORDINATE - Targets will be scanned for GROUND or STATIC enemy units and tasks created from these -- * ZONE and COORDINATE - Targets will be scanned for GROUND or STATIC enemy units and tasks created from these
-- * Intercept - Any airborne targets, if the controller is of type "A2A" -- * Intercept - Any airborne targets, if the controller is of type "A2A"
-- * Anti-Ship - Any ship targets, if the controller is of type "A2S" -- * Anti-Ship - Any ship targets, if the controller is of type "A2S"
-- * CTLD - Combat transport and logistics deployment
-- * CSAR - Combat search and rescue
-- --
-- ## 3 Task repetition -- ## 3 Task repetition
-- --
@ -1099,6 +1101,8 @@ do
-- FLASHON = "%s - Flashing directions is now ON!", -- FLASHON = "%s - Flashing directions is now ON!",
-- FLASHOFF = "%s - Flashing directions is now OFF!", -- FLASHOFF = "%s - Flashing directions is now OFF!",
-- FLASHMENU = "Flash Directions Switch", -- FLASHMENU = "Flash Directions Switch",
-- BRIEFING = "Briefing",
-- TARGETLOCATION ="Target location",
-- }, -- },
-- --
-- e.g. -- e.g.
@ -1320,6 +1324,8 @@ PLAYERTASKCONTROLLER.Messages = {
FLASHON = "%s - Flashing directions is now ON!", FLASHON = "%s - Flashing directions is now ON!",
FLASHOFF = "%s - Flashing directions is now OFF!", FLASHOFF = "%s - Flashing directions is now OFF!",
FLASHMENU = "Flash Directions Switch", FLASHMENU = "Flash Directions Switch",
BRIEFING = "Briefing",
TARGETLOCATION ="Target location",
}, },
DE = { DE = {
TASKABORT = "Auftrag abgebrochen!", TASKABORT = "Auftrag abgebrochen!",
@ -1382,14 +1388,16 @@ PLAYERTASKCONTROLLER.Messages = {
FLASHON = "%s - Richtungsangaben einblenden ist EIN!", FLASHON = "%s - Richtungsangaben einblenden ist EIN!",
FLASHOFF = "%s - Richtungsangaben einblenden ist AUS!", FLASHOFF = "%s - Richtungsangaben einblenden ist AUS!",
FLASHMENU = "Richtungsangaben Schalter", FLASHMENU = "Richtungsangaben Schalter",
BRIEFING = "Briefing",
TARGETLOCATION ="Zielkoordinate",
}, },
} }
--- PLAYERTASK class version. --- PLAYERTASK class version.
-- @field #string version -- @field #string version
PLAYERTASKCONTROLLER.version="0.1.42" PLAYERTASKCONTROLLER.version="0.1.43"
--- Constructor --- Create and run a new TASKCONTROLLER instance.
-- @param #PLAYERTASKCONTROLLER self -- @param #PLAYERTASKCONTROLLER self
-- @param #string Name Name of this controller -- @param #string Name Name of this controller
-- @param #number Coalition of this controller, e.g. coalition.side.BLUE -- @param #number Coalition of this controller, e.g. coalition.side.BLUE
@ -2590,7 +2598,7 @@ function PLAYERTASKCONTROLLER:_JoinTask(Group, Client, Task, Force)
--local m=MESSAGE:New(text,"10","Tasking"):ToAll() --local m=MESSAGE:New(text,"10","Tasking"):ToAll()
end end
if self.UseSRS then if self.UseSRS then
self:I(self.lid..text) self:T(self.lid..text)
self.SRSQueue:NewTransmission(text,nil,self.SRS,nil,2) self.SRSQueue:NewTransmission(text,nil,self.SRS,nil,2)
end end
self.TasksPerPlayer:Push(Task,playername) self.TasksPerPlayer:Push(Task,playername)
@ -2747,8 +2755,12 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Group, Client, Task)
textTTS = taskname textTTS = taskname
local detail = task:GetFreetext() local detail = task:GetFreetext()
local detailTTS = task:GetFreetextTTS() local detailTTS = task:GetFreetextTTS()
text = text .. "\nBriefing: "..detail.."\nTarget location "..CoordText local brieftxt = self.gettext:GetEntry("BRIEFING",self.locale)
textTTS = textTTS .. "; Briefing: "..detailTTS.."\nTarget location "..CoordText local locatxt = self.gettext:GetEntry("TARGETLOCATION",self.locale)
text = text .. string.format("\n%s: %s\n%s %s",brieftxt,detail,locatxt,CoordText)
--text = text .. "\nBriefing: "..detail.."\nTarget location "..CoordText
--textTTS = textTTS .. "; Briefing: "..detailTTS.."\nTarget location "..CoordText
textTTS = textTTS .. string.format("; %s: %s; %s %s",brieftxt,detailTTS,locatxt,CoordText)
end end
-- Pilots -- Pilots
@ -2768,6 +2780,10 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Group, Client, Task)
-- Task Report -- Task Report
text = text .. clienttxt text = text .. clienttxt
if task:HasFreetext() then
local brieftxt = self.gettext:GetEntry("BRIEFING",self.locale)
text = text .. string.format("\n%s: ",brieftxt)..task:GetFreetext()
end
textTTS = textTTS .. clienttxt textTTS = textTTS .. clienttxt
if self.UseSRS then if self.UseSRS then
if string.find(CoordText," BR, ") then if string.find(CoordText," BR, ") then
@ -2787,9 +2803,9 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Group, Client, Task)
CoordText = string.gsub(ttstext," BR, "," Bee, Arr, ") CoordText = string.gsub(ttstext," BR, "," Bee, Arr, ")
end end
elseif task:HasFreetext() then elseif task:HasFreetext() then
-- add freetext -- add tts freetext
text = text .. "\nBriefing: "..task:GetFreetext() local brieftxt = self.gettext:GetEntry("BRIEFING",self.locale)
ttstext = ttstext .. "; Briefing: "..task:GetFreetextTTS() ttstext = ttstext .. string.format("; %s: ",brieftxt)..task:GetFreetextTTS()
end end
self.SRSQueue:NewTransmission(ttstext,nil,self.SRS,nil,2) self.SRSQueue:NewTransmission(ttstext,nil,self.SRS,nil,2)
end end

View File

@ -4,7 +4,7 @@
-- --
-- * Manages target, number alive, life points, damage etc. -- * Manages target, number alive, life points, damage etc.
-- * Events when targets are damaged or destroyed -- * Events when targets are damaged or destroyed
-- * Various target objects: UNIT, GROUP, STATIC, AIRBASE, COORDINATE, SET_GROUP, SET_UNIT -- * Various target objects: UNIT, GROUP, STATIC, AIRBASE, COORDINATE, SET_GROUP, SET_UNIT, SET_SCENERY
-- --
-- === -- ===
-- --
@ -261,6 +261,7 @@ end
-- * SET_UNIT -- * SET_UNIT
-- * SET_STATIC -- * SET_STATIC
-- * SET_OPSGROUP -- * SET_OPSGROUP
-- * SET_SCENERY
-- --
-- @param #TARGET self -- @param #TARGET self
-- @param Wrapper.Positionable#POSITIONABLE Object The target GROUP, UNIT, STATIC, AIRBASE or COORDINATE. -- @param Wrapper.Positionable#POSITIONABLE Object The target GROUP, UNIT, STATIC, AIRBASE or COORDINATE.