mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Final tests done, publishing
This commit is contained in:
@@ -101,7 +101,7 @@ function DATABASE:New()
|
|||||||
self:HandleEvent( EVENTS.DeleteCargo )
|
self:HandleEvent( EVENTS.DeleteCargo )
|
||||||
|
|
||||||
-- Follow alive players and clients
|
-- Follow alive players and clients
|
||||||
-- self:HandleEvent( EVENTS.PlayerEnterUnit, self._EventOnPlayerEnterUnit )
|
self:HandleEvent( EVENTS.PlayerEnterUnit, self._EventOnPlayerEnterUnit )
|
||||||
self:HandleEvent( EVENTS.PlayerLeaveUnit, self._EventOnPlayerLeaveUnit )
|
self:HandleEvent( EVENTS.PlayerLeaveUnit, self._EventOnPlayerLeaveUnit )
|
||||||
|
|
||||||
self:_RegisterTemplates()
|
self:_RegisterTemplates()
|
||||||
@@ -118,7 +118,7 @@ function DATABASE:New()
|
|||||||
|
|
||||||
local CoalitionsData = { AlivePlayersRed = coalition.getPlayers( coalition.side.RED ), AlivePlayersBlue = coalition.getPlayers( coalition.side.BLUE ) }
|
local CoalitionsData = { AlivePlayersRed = coalition.getPlayers( coalition.side.RED ), AlivePlayersBlue = coalition.getPlayers( coalition.side.BLUE ) }
|
||||||
for CoalitionId, CoalitionData in pairs( CoalitionsData ) do
|
for CoalitionId, CoalitionData in pairs( CoalitionsData ) do
|
||||||
self:T( { "CoalitionData:", CoalitionData } )
|
self:E( { "CoalitionData:", CoalitionData } )
|
||||||
for UnitId, UnitData in pairs( CoalitionData ) do
|
for UnitId, UnitData in pairs( CoalitionData ) do
|
||||||
if UnitData and UnitData:isExist() then
|
if UnitData and UnitData:isExist() then
|
||||||
|
|
||||||
@@ -715,6 +715,8 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
|
|||||||
if not self.PLAYERS[PlayerName] then
|
if not self.PLAYERS[PlayerName] then
|
||||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||||
end
|
end
|
||||||
|
local Settings = SETTINGS:Set( PlayerName )
|
||||||
|
Settings:SetPlayerMenu( Event.IniUnit )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ do -- COORDINATE
|
|||||||
local Settings = Settings or _SETTINGS
|
local Settings = Settings or _SETTINGS
|
||||||
if Altitude ~= 0 then
|
if Altitude ~= 0 then
|
||||||
if Settings:IsMetric() then
|
if Settings:IsMetric() then
|
||||||
return " at" .. UTILS.Round( self.y, -3 ) .. " meters"
|
return " at " .. UTILS.Round( self.y, -3 ) .. " meters"
|
||||||
else
|
else
|
||||||
return " at " .. UTILS.Round( UTILS.MetersToFeet( self.y ), -3 ) .. " feet"
|
return " at " .. UTILS.Round( UTILS.MetersToFeet( self.y ), -3 ) .. " feet"
|
||||||
end
|
end
|
||||||
@@ -759,7 +759,7 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE TargetCoordinate The target COORDINATE.
|
-- @param #COORDINATE TargetCoordinate The target COORDINATE.
|
||||||
-- @return #string The BR text.
|
-- @return #string The BR text.
|
||||||
function COORDINATE:ToStringBR( FromCoordinate, Settings )
|
function COORDINATE:ToStringBR( FromCoordinate, Settings )
|
||||||
local DirectionVec3 = self:GetDirectionVec3( FromCoordinate )
|
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
||||||
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
||||||
local Distance = self:Get2DDistance( FromCoordinate )
|
local Distance = self:Get2DDistance( FromCoordinate )
|
||||||
return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings )
|
return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings )
|
||||||
@@ -769,7 +769,7 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param #COORDINATE TargetCoordinate The target COORDINATE.
|
-- @param #COORDINATE TargetCoordinate The target COORDINATE.
|
||||||
-- @return #string The BR text.
|
-- @return #string The BR text.
|
||||||
function COORDINATE:ToStringBRAA( FromCoordinate, Settings )
|
function COORDINATE:ToStringBRA( FromCoordinate, Settings )
|
||||||
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
||||||
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
||||||
local Distance = FromCoordinate:Get2DDistance( self )
|
local Distance = FromCoordinate:Get2DDistance( self )
|
||||||
@@ -860,7 +860,7 @@ do -- COORDINATE
|
|||||||
if Settings:IsA2A_BRA() then
|
if Settings:IsA2A_BRA() then
|
||||||
local Coordinate = Controllable:GetCoordinate()
|
local Coordinate = Controllable:GetCoordinate()
|
||||||
Coordinate:SetModeA2A()
|
Coordinate:SetModeA2A()
|
||||||
return self:ToStringBRAA( Coordinate, Settings )
|
return self:ToStringBRA( Coordinate, Settings )
|
||||||
end
|
end
|
||||||
|
|
||||||
if Settings:IsA2A_BULLS() then
|
if Settings:IsA2A_BULLS() then
|
||||||
@@ -872,7 +872,7 @@ do -- COORDINATE
|
|||||||
if Settings:IsA2G_BRA() then
|
if Settings:IsA2G_BRA() then
|
||||||
local Coordinate = Controllable:GetCoordinate()
|
local Coordinate = Controllable:GetCoordinate()
|
||||||
Coordinate:SetModeA2A()
|
Coordinate:SetModeA2A()
|
||||||
return Controllable and self:ToStringBRAA( Coordinate, Settings ) or self:ToStringMGRS( Settings )
|
return Controllable and self:ToStringBR( Coordinate, Settings ) or self:ToStringMGRS( Settings )
|
||||||
end
|
end
|
||||||
if Settings:IsA2G_LL() then
|
if Settings:IsA2G_LL() then
|
||||||
return self:ToStringLL( Settings )
|
return self:ToStringLL( Settings )
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ do -- DETECTION_BASE
|
|||||||
Unit.Category.STRUCTURE
|
Unit.Category.STRUCTURE
|
||||||
} )
|
} )
|
||||||
|
|
||||||
self:SetFriendlesRange( 6000 )
|
self:SetFriendliesRange( 6000 )
|
||||||
|
|
||||||
-- Create FSM transitions.
|
-- Create FSM transitions.
|
||||||
|
|
||||||
@@ -893,7 +893,7 @@ do -- DETECTION_BASE
|
|||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number FriendliesRange Radius to use when checking if Friendlies are nearby.
|
-- @param #number FriendliesRange Radius to use when checking if Friendlies are nearby.
|
||||||
-- @return #DETECTION_BASE self
|
-- @return #DETECTION_BASE self
|
||||||
function DETECTION_BASE:SetFriendlesRange( FriendliesRange ) --R2.2 Friendlies range
|
function DETECTION_BASE:SetFriendliesRange( FriendliesRange ) --R2.2 Friendlies range
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
self.FriendliesRange = FriendliesRange
|
self.FriendliesRange = FriendliesRange
|
||||||
@@ -1094,7 +1094,7 @@ do -- DETECTION_BASE
|
|||||||
id = world.VolumeType.SPHERE,
|
id = world.VolumeType.SPHERE,
|
||||||
params = {
|
params = {
|
||||||
point = DetectedUnit:GetVec3(),
|
point = DetectedUnit:GetVec3(),
|
||||||
radius = self.FriendliesRadius,
|
radius = self.FriendliesRange,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1405,7 +1405,7 @@ function TASK:ReportDetails( TaskGroup ) --R2.1 fixed report. Now nicely formatt
|
|||||||
local FromCoordinate = TaskGroup:GetUnit(1):GetCoordinate()
|
local FromCoordinate = TaskGroup:GetUnit(1):GetCoordinate()
|
||||||
local ToCoordinate = TaskInfo -- Core.Point#COORDINATE
|
local ToCoordinate = TaskInfo -- Core.Point#COORDINATE
|
||||||
Report:Add( TaskInfoIDText )
|
Report:Add( TaskInfoIDText )
|
||||||
Report:AddIndent( ToCoordinate:ToStringBRAA( FromCoordinate ) .. ", " .. TaskInfo:ToStringAspect( FromCoordinate ) )
|
Report:AddIndent( ToCoordinate:ToStringBRA( FromCoordinate ) .. ", " .. TaskInfo:ToStringAspect( FromCoordinate ) )
|
||||||
Report:AddIndent( ToCoordinate:ToStringBULLS( TaskGroup:GetCoalition() ) )
|
Report:AddIndent( ToCoordinate:ToStringBULLS( TaskGroup:GetCoalition() ) )
|
||||||
else
|
else
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ do -- TASK_A2G
|
|||||||
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
|
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
|
||||||
if TargetUnit then
|
if TargetUnit then
|
||||||
local Coordinate = TargetUnit:GetCoordinate()
|
local Coordinate = TargetUnit:GetCoordinate()
|
||||||
self:T( { TargetCoordinate = Coordinate, Coordinate:GetX(), Coordinate:GetAlt(), Coordinate:GetZ() } )
|
self:T( { TargetCoordinate = Coordinate, Coordinate:GetX(), Coordinate:GetY(), Coordinate:GetZ() } )
|
||||||
Task:SetTargetCoordinate( TargetUnit:GetCoordinate(), TaskUnit )
|
Task:SetTargetCoordinate( TargetUnit:GetCoordinate(), TaskUnit )
|
||||||
end
|
end
|
||||||
self:__RouteToTargetPoint( 0.1 )
|
self:__RouteToTargetPoint( 0.1 )
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ function POSITIONABLE:GetCoordinate()
|
|||||||
if DCSPositionable then
|
if DCSPositionable then
|
||||||
local PositionableVec3 = self:GetPositionVec3()
|
local PositionableVec3 = self:GetPositionVec3()
|
||||||
|
|
||||||
local PositionableCoordinate = COORDINATE:NewFromVec3( PositionableVec3 )
|
local PositionableCoordinate = POINT_VEC3:NewFromVec3( PositionableVec3 )
|
||||||
PositionableCoordinate:SetHeading( self:GetHeading() )
|
PositionableCoordinate:SetHeading( self:GetHeading() )
|
||||||
|
|
||||||
self:T2( PositionableCoordinate )
|
self:T2( PositionableCoordinate )
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170520_0827' )
|
env.info( 'Moose Generation Timestamp: 20170522_1100' )
|
||||||
|
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user