GROUP/UNIT - added :GetNatoReportingName()

This commit is contained in:
Applevangelist 2022-04-23 16:41:47 +02:00
parent 4c7ac68858
commit 2f4d5b32b6
3 changed files with 31 additions and 1 deletions

View File

@ -483,7 +483,8 @@ ENUMS.ReportingName =
Mirage = "Mirage", -- various non-NATO Mirage = "Mirage", -- various non-NATO
-- Bomber -- Bomber
H6J = "H6-J", H6J = "H6-J",
Bear = "Tu-142", -- also Tu-95 Sea_Bear = "Tu-142", -- also Tu-95
Bear = "Tu-95", -- also Tu-142
Blinder = "Tu-22", Blinder = "Tu-22",
Blackjack = "Tu-160", Blackjack = "Tu-160",
-- AIC / Transport / Other -- AIC / Transport / Other

View File

@ -900,6 +900,24 @@ function GROUP:GetTypeName()
return nil return nil
end end
--- [AIRPLANE] Get the NATO reporting name of a UNIT. Currently airplanes only!
--@param #UNIT self
--@return #string NatoReportingName or "Bogey" if unknown.
function GROUP:GetNatoReportingName()
self:F2( self.GroupName )
local DCSGroup = self:GetDCSObject()
if DCSGroup then
local GroupTypeName = DCSGroup:getUnit(1):getTypeName()
self:T3( GroupTypeName )
return UTILS.GetReportingName(GroupTypeName)
end
return "Bogey"
end
--- Gets the player name of the group. --- Gets the player name of the group.
-- @param #GROUP self -- @param #GROUP self
-- @return #string The player name of the group. -- @return #string The player name of the group.

View File

@ -408,6 +408,17 @@ function UNIT:GetClient()
return nil return nil
end end
--- [AIRPLANE] Get the NATO reporting name of a UNIT. Currently airplanes only!
--@param #UNIT self
--@return #string NatoReportingName or "Bogey" if unknown.
function UNIT:GetNatoReportingName()
local typename = self:GetTypeName()
return UTILS.GetReportingName(typename)
end
--- Returns the unit's number in the group. --- Returns the unit's number in the group.
-- The number is the same number the unit has in ME. -- The number is the same number the unit has in ME.
-- It may not be changed during the mission. -- It may not be changed during the mission.