This commit is contained in:
Applevangelist 2023-02-15 10:31:40 +01:00
parent bf50adaa22
commit b649ad73a8
3 changed files with 56 additions and 52 deletions

View File

@ -5,7 +5,7 @@
-- SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to:
--
-- * Spot for a defined duration.
-- * Updates of laer spot position every 0.2 seconds for moving targets.
-- * Updates of laser spot position every 0.2 seconds for moving targets.
-- * Wiggle the spot at the target.
-- * Provide a @{Wrapper.Unit} as a target, instead of a point.
-- * Implement a status machine, LaseOn, LaseOff.
@ -57,7 +57,7 @@ do
--
-- ## 1. SPOT constructor
--
-- * @{#SPOT.New}(..\Presentations\SPOT\Dia2.JPG): Creates a new SPOT object.
-- * @{#SPOT.New}(): Creates a new SPOT object.
--
-- ## 2. SPOT is a FSM
--

View File

@ -1460,7 +1460,7 @@ PLAYERTASKCONTROLLER.Messages = {
--- PLAYERTASK class version.
-- @field #string version
PLAYERTASKCONTROLLER.version="0.1.57"
PLAYERTASKCONTROLLER.version="0.1.58"
--- Create and run a new TASKCONTROLLER instance.
-- @param #PLAYERTASKCONTROLLER self
@ -2245,56 +2245,60 @@ function PLAYERTASKCONTROLLER:_CheckTargetQueue()
end
end
if self.UseTypeNames and object:IsGround() then
-- * Threat level 0: Unit is unarmed.
-- * Threat level 1: Unit is infantry.
-- * Threat level 2: Unit is an infantry vehicle.
-- * Threat level 3: Unit is ground artillery.
-- * Threat level 4: Unit is a tank.
-- * Threat level 5: Unit is a modern tank or ifv with ATGM.
-- * Threat level 6: Unit is a AAA.
-- * Threat level 7: Unit is a SAM or manpad, IR guided.
-- * Threat level 8: Unit is a Short Range SAM, radar guided.
-- * Threat level 9: Unit is a Medium Range SAM, radar guided.
-- * Threat level 10: Unit is a Long Range SAM, radar guided.
local threat = object:GetThreatLevel()
local typekey = "INFANTRY"
if threat == 0 or threat == 2 then
typekey = "TECHNICAL"
elseif threat == 3 then
typekey = "ARTILLERY"
elseif threat == 4 or threat == 5 then
typekey = "TANKS"
elseif threat == 6 or threat == 7 then
typekey = "AIRDEFENSE"
elseif threat >= 8 then
typekey = "SAM"
end
local typename = self.gettext:GetEntry(typekey,self.locale)
local gname = self.gettext:GetEntry("GROUP",self.locale)
target.TypeName = string.format("%s %s",typename,gname)
--self:T(self.lid.."Target TypeName = "..target.TypeName)
end
if object:IsInstanceOf("UNIT") or object:IsInstanceOf("GROUP") then
if self.UseTypeNames and object:IsShip() then
local threat = object:GetThreatLevel()
local typekey = "UNARMEDSHIP"
if threat == 1 then
typekey = "LIGHTARMEDSHIP"
elseif threat == 2 then
typekey = "CORVETTE"
elseif threat == 3 or threat == 4 then
typekey = "FRIGATE"
elseif threat == 5 or threat == 6 then
typekey = "CRUISER"
elseif threat == 7 or threat == 8 then
typekey = "DESTROYER"
elseif threat >= 9 then
typekey = "CARRIER"
if self.UseTypeNames and object:IsGround() then
-- * Threat level 0: Unit is unarmed.
-- * Threat level 1: Unit is infantry.
-- * Threat level 2: Unit is an infantry vehicle.
-- * Threat level 3: Unit is ground artillery.
-- * Threat level 4: Unit is a tank.
-- * Threat level 5: Unit is a modern tank or ifv with ATGM.
-- * Threat level 6: Unit is a AAA.
-- * Threat level 7: Unit is a SAM or manpad, IR guided.
-- * Threat level 8: Unit is a Short Range SAM, radar guided.
-- * Threat level 9: Unit is a Medium Range SAM, radar guided.
-- * Threat level 10: Unit is a Long Range SAM, radar guided.
local threat = object:GetThreatLevel()
local typekey = "INFANTRY"
if threat == 0 or threat == 2 then
typekey = "TECHNICAL"
elseif threat == 3 then
typekey = "ARTILLERY"
elseif threat == 4 or threat == 5 then
typekey = "TANKS"
elseif threat == 6 or threat == 7 then
typekey = "AIRDEFENSE"
elseif threat >= 8 then
typekey = "SAM"
end
local typename = self.gettext:GetEntry(typekey,self.locale)
local gname = self.gettext:GetEntry("GROUP",self.locale)
target.TypeName = string.format("%s %s",typename,gname)
--self:T(self.lid.."Target TypeName = "..target.TypeName)
end
local typename = self.gettext:GetEntry(typekey,self.locale)
target.TypeName = typename
--self:T(self.lid.."Target TypeName = "..target.TypeName)
if self.UseTypeNames and object:IsShip() then
local threat = object:GetThreatLevel()
local typekey = "UNARMEDSHIP"
if threat == 1 then
typekey = "LIGHTARMEDSHIP"
elseif threat == 2 then
typekey = "CORVETTE"
elseif threat == 3 or threat == 4 then
typekey = "FRIGATE"
elseif threat == 5 or threat == 6 then
typekey = "CRUISER"
elseif threat == 7 or threat == 8 then
typekey = "DESTROYER"
elseif threat >= 9 then
typekey = "CARRIER"
end
local typename = self.gettext:GetEntry(typekey,self.locale)
target.TypeName = typename
--self:T(self.lid.."Target TypeName = "..target.TypeName)
end
end
self:_AddTask(target)

View File

@ -2810,7 +2810,7 @@ function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations)
if self:IsAlive() then
local IsPlayer = self:IsPlayer()
local shortcallsign = self:GetCallsign() or "unknown91" -- e.g.Uzi91, but we want Uzi 9 1
local callsignroot = string.match(shortcallsign, '(%a+)') -- Uzi
local callsignroot = string.match(shortcallsign, '(%a+)') or "Ghost" -- Uzi
--self:I("CallSign = " .. callsignroot)
local groupname = self:GetName()
local callnumber = string.match(shortcallsign, "(%d+)$" ) or "91" -- 91