mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
commit
ae4affbf2f
@ -798,6 +798,78 @@ do -- COORDINATE
|
||||
|
||||
end
|
||||
|
||||
--- Provides a coordinate string of the point, based on the A2G coordinate format system.
|
||||
-- @param #COORDINATE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @param Core.Settings#SETTINGS Settings
|
||||
-- @return #string The coordinate Text in the configured coordinate system.
|
||||
function COORDINATE:ToStringA2G( Controllable, Settings ) -- R2.2
|
||||
|
||||
self:F( { Controllable = Controllable and Controllable:GetName() } )
|
||||
|
||||
local Settings = Settings or ( Controllable and _DATABASE:GetPlayerSettings( Controllable:GetPlayerName() ) ) or _SETTINGS
|
||||
|
||||
if Settings:IsA2G_BR() then
|
||||
-- If no Controllable is given to calculate the BR from, then MGRS will be used!!!
|
||||
if Controllable then
|
||||
local Coordinate = Controllable:GetCoordinate()
|
||||
return Controllable and self:ToStringBR( Coordinate, Settings ) or self:ToStringMGRS( Settings )
|
||||
else
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
end
|
||||
if Settings:IsA2G_LL_DMS() then
|
||||
return self:ToStringLLDMS( Settings )
|
||||
end
|
||||
if Settings:IsA2G_LL_DDM() then
|
||||
return self:ToStringLLDDM( Settings )
|
||||
end
|
||||
if Settings:IsA2G_MGRS() then
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Provides a coordinate string of the point, based on the A2A coordinate format system.
|
||||
-- @param #COORDINATE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @param Core.Settings#SETTINGS Settings
|
||||
-- @return #string The coordinate Text in the configured coordinate system.
|
||||
function COORDINATE:ToStringA2A( Controllable, Settings ) -- R2.2
|
||||
|
||||
self:F( { Controllable = Controllable and Controllable:GetName() } )
|
||||
|
||||
local Settings = Settings or ( Controllable and _DATABASE:GetPlayerSettings( Controllable:GetPlayerName() ) ) or _SETTINGS
|
||||
|
||||
if Settings:IsA2A_BRAA() then
|
||||
if Controllable then
|
||||
local Coordinate = Controllable:GetCoordinate()
|
||||
return self:ToStringBRA( Coordinate, Settings )
|
||||
else
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
end
|
||||
if Settings:IsA2A_BULLS() then
|
||||
local Coalition = Controllable:GetCoalition()
|
||||
return self:ToStringBULLS( Coalition, Settings )
|
||||
end
|
||||
if Settings:IsA2A_LL_DMS() then
|
||||
return self:ToStringLLDMS( Settings )
|
||||
end
|
||||
if Settings:IsA2A_LL_DDM() then
|
||||
return self:ToStringLLDDM( Settings )
|
||||
end
|
||||
if Settings:IsA2A_MGRS() then
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
end
|
||||
|
||||
--- Provides a coordinate string of the point, based on a coordinate format system:
|
||||
-- * Uses default settings in COORDINATE.
|
||||
-- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default.
|
||||
@ -837,46 +909,9 @@ do -- COORDINATE
|
||||
|
||||
|
||||
if ModeA2A then
|
||||
if Settings:IsA2A_BRAA() then
|
||||
if Controllable then
|
||||
local Coordinate = Controllable:GetCoordinate()
|
||||
return self:ToStringBRA( Coordinate, Settings )
|
||||
else
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
end
|
||||
if Settings:IsA2A_BULLS() then
|
||||
local Coalition = Controllable:GetCoalition()
|
||||
return self:ToStringBULLS( Coalition, Settings )
|
||||
end
|
||||
if Settings:IsA2A_LL_DMS() then
|
||||
return self:ToStringLLDMS( Settings )
|
||||
end
|
||||
if Settings:IsA2A_LL_DDM() then
|
||||
return self:ToStringLLDDM( Settings )
|
||||
end
|
||||
if Settings:IsA2A_MGRS() then
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
return self:ToStringA2A( Controllable, Settings )
|
||||
else
|
||||
if Settings:IsA2G_BR() then
|
||||
-- If no Controllable is given to calculate the BR from, then MGRS will be used!!!
|
||||
if Controllable then
|
||||
local Coordinate = Controllable:GetCoordinate()
|
||||
return Controllable and self:ToStringBR( Coordinate, Settings ) or self:ToStringMGRS( Settings )
|
||||
else
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
end
|
||||
if Settings:IsA2G_LL_DMS() then
|
||||
return self:ToStringLLDMS( Settings )
|
||||
end
|
||||
if Settings:IsA2G_LL_DDM() then
|
||||
return self:ToStringLLDDM( Settings )
|
||||
end
|
||||
if Settings:IsA2G_MGRS() then
|
||||
return self:ToStringMGRS( Settings )
|
||||
end
|
||||
return self:ToStringA2G( Controllable, Settings )
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
@ -853,7 +853,7 @@ do -- DESIGNATE
|
||||
|
||||
local Coord = self.Detection:GetDetectedItemCoordinate( DesignateIndex )
|
||||
local ID = self.Detection:GetDetectedItemID( DesignateIndex )
|
||||
local MenuText = ID .. ", " .. Coord:ToString( AttackGroup )
|
||||
local MenuText = ID .. ", " .. Coord:ToStringA2G( AttackGroup )
|
||||
|
||||
if Designating == "" then
|
||||
MenuText = "(-) " .. MenuText
|
||||
@ -862,7 +862,7 @@ do -- DESIGNATE
|
||||
for LaserCode, MenuText in pairs( self.MenuLaserCodes ) do
|
||||
MENU_GROUP_COMMAND:New( AttackGroup, string.format( MenuText, LaserCode ), DetectedMenu, self.MenuLaseCode, self, DesignateIndex, 60, LaserCode ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||
end
|
||||
MENU_GROUP_COMMAND:New( AttackGroup, "Lase targets", DetectedMenu, self.MenuLaseOn, self, DesignateIndex, 60 ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||
MENU_GROUP_COMMAND:New( AttackGroup, "Lase with random laser code(s)", DetectedMenu, self.MenuLaseOn, self, DesignateIndex, 60 ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||
MENU_GROUP_COMMAND:New( AttackGroup, "Smoke red", DetectedMenu, self.MenuSmoke, self, DesignateIndex, SMOKECOLOR.Red ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||
MENU_GROUP_COMMAND:New( AttackGroup, "Smoke blue", DetectedMenu, self.MenuSmoke, self, DesignateIndex, SMOKECOLOR.Blue ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||
MENU_GROUP_COMMAND:New( AttackGroup, "Smoke green", DetectedMenu, self.MenuSmoke, self, DesignateIndex, SMOKECOLOR.Green ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||
|
||||
@ -746,7 +746,8 @@ function TASK:SetPlannedMenuForGroup( TaskGroup, MenuTime )
|
||||
|
||||
if not Mission:IsGroupAssigned( TaskGroup ) then
|
||||
self:F( { "Replacing Join Task menu" } )
|
||||
local JoinTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Join Task" ), TaskTypeMenu, self.MenuAssignToGroup, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" ):SetRemoveParent( true )
|
||||
local JoinTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Join Task" ), TaskTypeMenu, self.MenuAssignToGroup, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" ):SetRemoveParent( true )
|
||||
local MarkTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Mark Task on Map" ), TaskTypeMenu, self.MenuMarkToGroup, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" ):SetRemoveParent( true )
|
||||
end
|
||||
|
||||
return self
|
||||
@ -854,11 +855,30 @@ end
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
function TASK:MenuAssignToGroup( TaskGroup )
|
||||
|
||||
self:E( "Assigned menu selected")
|
||||
self:E( "Join Task menu selected")
|
||||
|
||||
self:AssignToGroup( TaskGroup )
|
||||
end
|
||||
|
||||
--- @param #TASK self
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
function TASK:MenuMarkToGroup( TaskGroup )
|
||||
|
||||
self:E( "Mark Task menu selected")
|
||||
|
||||
self:UpdateTaskInfo()
|
||||
|
||||
local Coordinate = self:GetInfo( "Coordinates" ) -- Core.Point#COORDINATE
|
||||
local Briefing = self:GetTaskBriefing()
|
||||
local GroupID = TaskGroup:GetID()
|
||||
local Vec3 = Coordinate:GetVec3()
|
||||
|
||||
self:F( { Coordinate = Vec3, Briefing = Briefing, GroupID = GroupID } )
|
||||
|
||||
trigger.action.markToGroup( 1, Briefing, Vec3, GroupID )
|
||||
--trigger.action.markToAll( 1, Briefing, Vec3 )
|
||||
end
|
||||
|
||||
--- Report the task status.
|
||||
-- @param #TASK self
|
||||
function TASK:MenuTaskStatus( TaskGroup )
|
||||
@ -1033,6 +1053,17 @@ function TASK:SetInfo( TaskInfo, TaskInfoText, TaskInfoOrder )
|
||||
self.TaskInfo[TaskInfo].TaskInfoOrder = TaskInfoOrder
|
||||
end
|
||||
|
||||
--- Gets the Information of the Task
|
||||
-- @param #TASK self
|
||||
-- @param #string TaskInfo The key and title of the task information.
|
||||
-- @return #string TaskInfoText The Task info text.
|
||||
function TASK:GetInfo( TaskInfo )
|
||||
|
||||
self.TaskInfo = self.TaskInfo or {}
|
||||
self.TaskInfo[TaskInfo] = self.TaskInfo[TaskInfo] or {}
|
||||
return self.TaskInfo[TaskInfo].TaskInfoText
|
||||
end
|
||||
|
||||
--- Gets the Type of the Task
|
||||
-- @param #TASK self
|
||||
-- @return #string TaskType
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user