mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
In progress
* Markers * BR menu on designate always in A2G
This commit is contained in:
parent
bae0e4c35b
commit
4dc468e902
@ -798,6 +798,78 @@ do -- COORDINATE
|
|||||||
|
|
||||||
end
|
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:
|
--- Provides a coordinate string of the point, based on a coordinate format system:
|
||||||
-- * Uses default settings in COORDINATE.
|
-- * Uses default settings in COORDINATE.
|
||||||
-- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default.
|
-- * 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 ModeA2A then
|
||||||
if Settings:IsA2A_BRAA() then
|
return self:ToStringA2A( Controllable, Settings )
|
||||||
if Controllable then
|
|
||||||
local Coordinate = Controllable:GetCoordinate()
|
|
||||||
return self:ToStringBRA( Coordinate, Settings )
|
|
||||||
else
|
else
|
||||||
return self:ToStringMGRS( Settings )
|
return self:ToStringA2G( Controllable, 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
|
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@ -853,7 +853,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
local Coord = self.Detection:GetDetectedItemCoordinate( DesignateIndex )
|
local Coord = self.Detection:GetDetectedItemCoordinate( DesignateIndex )
|
||||||
local ID = self.Detection:GetDetectedItemID( DesignateIndex )
|
local ID = self.Detection:GetDetectedItemID( DesignateIndex )
|
||||||
local MenuText = ID .. ", " .. Coord:ToString( AttackGroup )
|
local MenuText = ID .. ", " .. Coord:ToStringA2G( AttackGroup )
|
||||||
|
|
||||||
if Designating == "" then
|
if Designating == "" then
|
||||||
MenuText = "(-) " .. MenuText
|
MenuText = "(-) " .. MenuText
|
||||||
@ -862,7 +862,7 @@ do -- DESIGNATE
|
|||||||
for LaserCode, MenuText in pairs( self.MenuLaserCodes ) do
|
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 )
|
MENU_GROUP_COMMAND:New( AttackGroup, string.format( MenuText, LaserCode ), DetectedMenu, self.MenuLaseCode, self, DesignateIndex, 60, LaserCode ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||||
end
|
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 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 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 )
|
MENU_GROUP_COMMAND:New( AttackGroup, "Smoke green", DetectedMenu, self.MenuSmoke, self, DesignateIndex, SMOKECOLOR.Green ):SetTime( MenuTime ):SetTag( self.DesignateName )
|
||||||
|
|||||||
@ -747,6 +747,7 @@ function TASK:SetPlannedMenuForGroup( TaskGroup, MenuTime )
|
|||||||
if not Mission:IsGroupAssigned( TaskGroup ) then
|
if not Mission:IsGroupAssigned( TaskGroup ) then
|
||||||
self:F( { "Replacing Join Task menu" } )
|
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
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@ -854,11 +855,28 @@ end
|
|||||||
-- @param Wrapper.Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
function TASK:MenuAssignToGroup( TaskGroup )
|
function TASK:MenuAssignToGroup( TaskGroup )
|
||||||
|
|
||||||
self:E( "Assigned menu selected")
|
self:E( "Join Task menu selected")
|
||||||
|
|
||||||
self:AssignToGroup( TaskGroup )
|
self:AssignToGroup( TaskGroup )
|
||||||
end
|
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()
|
||||||
|
|
||||||
|
self:F( { Coordinate = Coordinate:GetVec3(), Briefing = Briefing, GroupID = GroupID } )
|
||||||
|
|
||||||
|
trigger.action.markToGroup( 1, Briefing, Coordinate:GetVec3(), GroupID )
|
||||||
|
end
|
||||||
|
|
||||||
--- Report the task status.
|
--- Report the task status.
|
||||||
-- @param #TASK self
|
-- @param #TASK self
|
||||||
function TASK:MenuTaskStatus( TaskGroup )
|
function TASK:MenuTaskStatus( TaskGroup )
|
||||||
@ -1033,6 +1051,17 @@ function TASK:SetInfo( TaskInfo, TaskInfoText, TaskInfoOrder )
|
|||||||
self.TaskInfo[TaskInfo].TaskInfoOrder = TaskInfoOrder
|
self.TaskInfo[TaskInfo].TaskInfoOrder = TaskInfoOrder
|
||||||
end
|
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
|
--- Gets the Type of the Task
|
||||||
-- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @return #string TaskType
|
-- @return #string TaskType
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user