Merge branch 'develop' into FF/Ops

This commit is contained in:
Frank 2022-07-30 01:24:52 +02:00
commit 5083428a06
10 changed files with 1184 additions and 11 deletions

View File

@ -239,6 +239,7 @@ do -- MENU_BASE
function MENU_BASE:GetMenu( MenuText )
return self.Menus[MenuText]
end
--- Sets a menu stamp for later prevention of menu removal.
-- @param #MENU_BASE self
-- @param MenuStamp
@ -276,6 +277,7 @@ do -- MENU_BASE
end
end
do -- MENU_COMMAND_BASE
--- @type MENU_COMMAND_BASE
-- @field #function MenuCallHandler
@ -813,6 +815,7 @@ do
end
end
--- Refreshes a new radio item for a group and submenus
-- @param #MENU_GROUP self
-- @return #MENU_GROUP

View File

@ -1152,8 +1152,10 @@ do -- SET_GROUP
local NearestGroup = nil --Wrapper.Group#GROUP
local ClosestDistance = nil
for ObjectID, ObjectData in pairs( self.Set ) do
local Set = self:GetAliveSet()
for ObjectID, ObjectData in pairs( Set ) do
if NearestGroup == nil then
NearestGroup = ObjectData
ClosestDistance = PointVec2:DistanceFromPointVec2( ObjectData:GetCoordinate() )
@ -5825,8 +5827,7 @@ do -- SET_ZONE
if self.Filter.Prefixes then
local MZonePrefix = false
for ZonePrefixId, ZonePrefix in pairs( self.Filter.Prefixes ) do
env.info(string.format("zone %s %s", MZoneName, ZonePrefix))
self:I( { "Prefix:", string.find( MZoneName, ZonePrefix, 1 ), ZonePrefix } )
self:T2( { "Prefix:", string.find( MZoneName, ZonePrefix, 1 ), ZonePrefix } )
if string.find( MZoneName, ZonePrefix, 1 ) then
MZonePrefix = true
end

View File

@ -106,10 +106,11 @@ AUTOLASE = {
-- @field #string unitname
-- @field #string reccename
-- @field #string unittype
-- @field Core.Point#COORDINATE coordinate
--- AUTOLASE class version.
-- @field #string version
AUTOLASE.version = "0.0.11"
AUTOLASE.version = "0.0.12"
-------------------------------------------------------------------
-- Begin Functional.Autolase.lua
@ -578,6 +579,17 @@ function AUTOLASE:ShowStatus(Group)
local typename = entry.unittype
local code = entry.lasercode
local locationstring = entry.location
local playername = Group:GetPlayerName()
if playername then
local settings = _DATABASE:GetPlayerSettings(playername)
if settings then
if settings:IsA2G_MGRS() then
locationstring = entry.coordinate:ToStringMGRS(settings)
elseif settings:IsA2G_LL_DMS() then
locationstring = entry.coordinate:ToStringLLDMS()
end
end
end
local text = string.format("%s lasing %s code %d\nat %s",reccename,typename,code,locationstring)
report:Add(text)
lines = lines + 1
@ -832,7 +844,16 @@ function AUTOLASE:onafterMonitor(From, Event, To)
local code = self:GetLaserCode(reccename)
local spot = SPOT:New(recce)
spot:LaseOn(unit,code,self.LaseDuration)
local locationstring = unit:GetCoordinate():ToStringLLDDM()
local locationstring = unit:GetCoordinate():ToStringLLDDM()
if _SETTINGS:IsA2G_MGRS() then
local precision = _SETTINGS:GetMGRS_Accuracy()
local settings = {}
settings.MGRS_Accuracy = precision
locationstring = unit:GetCoordinate():ToStringMGRS(settings)
elseif _SETTINGS:IsA2G_LL_DMS() then
locationstring = unit:GetCoordinate():ToStringLLDMS()
end
local laserspot = { -- #AUTOLASE.LaserSpot
laserspot = spot,
lasedunit = unit,
@ -843,6 +864,7 @@ function AUTOLASE:onafterMonitor(From, Event, To)
unitname = unitname,
reccename = reccename,
unittype = unit:GetTypeName(),
coordinate = unit:GetCoordinate(),
}
if self.smoketargets then
local coord = unit:GetCoordinate()

View File

@ -2049,9 +2049,15 @@ function RAT:_InitAircraft(DCSgroup)
--self.aircraft.descriptors=DCSdesc
-- aircraft dimensions
self.aircraft.length=DCSdesc.box.max.x
self.aircraft.height=DCSdesc.box.max.y
self.aircraft.width=DCSdesc.box.max.z
if DCSdesc.box then
self.aircraft.length=DCSdesc.box.max.x
self.aircraft.height=DCSdesc.box.max.y
self.aircraft.width=DCSdesc.box.max.z
elseif DCStype == "Mirage-F1CE" then
self.aircraft.length=16
self.aircraft.height=5
self.aircraft.width=9
end
self.aircraft.box=math.max(self.aircraft.length,self.aircraft.width)
-- info message

View File

@ -104,6 +104,7 @@ __Moose.Include( 'Scripts/Moose/Ops/Fleet.lua' )
__Moose.Include( 'Scripts/Moose/Ops/Awacs.lua' )
__Moose.Include( 'Scripts/Moose/Ops/Operation.lua' )
__Moose.Include( 'Scripts/Moose/Ops/FlightControl.lua' )
__Moose.Include( 'Scripts/Moose/Ops/PlayerTask.lua' )
__Moose.Include( 'Scripts/Moose/AI/AI_Balancer.lua' )
__Moose.Include( 'Scripts/Moose/AI/AI_Air.lua' )

File diff suppressed because it is too large Load Diff

View File

@ -498,6 +498,8 @@ AIRBASE.MarianaIslands={
-- * AIRBASE.SouthAtlantic.Ushuaia
-- * AIRBASE.SouthAtlantic.Ushuaia_Helo_Port
-- * AIRBASE.SouthAtlantic.Punta_Arenas
-- * AIRBASE.SouthAtlantic.Pampa_Guanaco
-- * AIRBASE.SouthAtlantic.San_Julian
--
--@field MarianaIslands
AIRBASE.SouthAtlantic={
@ -509,6 +511,8 @@ AIRBASE.SouthAtlantic={
["Ushuaia"]="Ushuaia",
["Ushuaia_Helo_Port"]="Ushuaia Helo Port",
["Punta_Arenas"]="Punta Arenas",
["Pampa_Guanaco"]="Pampa Guanaco",
["San_Julian"]="San Julian",
}
--- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".

View File

@ -532,7 +532,7 @@ function POSITIONABLE:GetBoundingRadius(mindist)
return nil
end
--- Returns the altitude of the POSITIONABLE.
--- Returns the altitude above sea level of the POSITIONABLE.
-- @param Wrapper.Positionable#POSITIONABLE self
-- @return DCS#Distance The altitude of the POSITIONABLE.
-- @return #nil The POSITIONABLE is not existing or alive.
@ -775,7 +775,7 @@ function POSITIONABLE:GetRelativeVelocity(positionable)
end
--- Returns the POSITIONABLE height in meters.
--- Returns the POSITIONABLE height above sea level in meters.
-- @param Wrapper.Positionable#POSITIONABLE self
-- @return DCS#Vec3 The height of the positionable.
-- @return #nil The POSITIONABLE is not existing or alive.

View File

@ -179,8 +179,28 @@ function UNIT:GetDCSObject()
return nil
end
--- Returns the unit altitude above sea level in meters.
-- @param Wrapper.Unit#UNIT self
-- @param #boolean FromGround Measure from the ground or from sea level (ASL). Provide **true** for measuring from the ground (AGL). **false** or **nil** if you measure from sea level.
-- @return #number The height of the group or nil if is not existing or alive.
function UNIT:GetAltitude(FromGround)
local DCSUnit = Unit.getByName( self.UnitName )
if DCSUnit then
local altitude = 0
local point = DCSUnit.getPoint() --DCS#Vec3
altitude = point.y
if FromGround then
local land = land.getHeight( { x = point.x, y = point.z } ) or 0
altitude = altitude - land
end
return altitude
end
return nil
end
--- Respawn the @{Wrapper.Unit} using a (tweaked) template of the parent Group.
--

View File

@ -99,6 +99,7 @@ Ops/CTLD.lua
Ops/Awacs.lua
Ops/Operation.lua
Ops/FlightControl.lua
Ops/PlayerTask.lua
AI/AI_Balancer.lua
AI/AI_Air.lua