mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Got something working with these coordinates
This commit is contained in:
parent
96fdf72400
commit
ece08e5e37
@ -346,8 +346,7 @@ do -- ACT_ROUTE_POINT
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ROUTE_POINT:onafterReport( ProcessUnit, From, Event, To )
|
function ACT_ROUTE_POINT:onafterReport( ProcessUnit, From, Event, To )
|
||||||
|
|
||||||
local TaskUnitCoordinate = ProcessUnit:GetCoordinate()
|
local RouteText = self:GetRouteText( ProcessUnit )
|
||||||
local RouteText = self:GetRouteText( TaskUnitCoordinate )
|
|
||||||
self:Message( RouteText )
|
self:Message( RouteText )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -798,9 +798,11 @@ do -- COORDINATE
|
|||||||
-- @return #string The coordinate Text in the configured coordinate system.
|
-- @return #string The coordinate Text in the configured coordinate system.
|
||||||
function COORDINATE:ToString( Controllable, Settings ) -- R2.2
|
function COORDINATE:ToString( Controllable, Settings ) -- R2.2
|
||||||
|
|
||||||
|
self:E( { Controllable = Controllable } )
|
||||||
|
|
||||||
local Settings = Settings or _SETTINGS
|
local Settings = Settings or _SETTINGS
|
||||||
|
|
||||||
local IsAir = Controllable and Controllable:IsAir() or false
|
local IsAir = Controllable and Controllable:IsAirPlane() or false
|
||||||
|
|
||||||
if IsAir then
|
if IsAir then
|
||||||
local Coordinate = Controllable:GetCoordinate()
|
local Coordinate = Controllable:GetCoordinate()
|
||||||
|
|||||||
@ -160,10 +160,11 @@ do -- SETTINGS
|
|||||||
self.SystemMenu = nil
|
self.SystemMenu = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
self.SystemMenu = MENU_MISSION:New( "Coordinate Settings" )
|
self.SystemMenu = MENU_MISSION:New( "Settings" )
|
||||||
|
|
||||||
local A2GCoordinateMenu = MENU_MISSION:New( "A2G Coordinate System", self.SystemMenu )
|
local A2GCoordinateMenu = MENU_MISSION:New( "A2G Coordinate System", self.SystemMenu )
|
||||||
|
|
||||||
if self:IsA2GLL() then
|
if self:IsA2G_LL() then
|
||||||
MENU_MISSION_COMMAND:New( "Activate MGRS", A2GCoordinateMenu, self.A2GMenuSystem, self, "MGRS" )
|
MENU_MISSION_COMMAND:New( "Activate MGRS", A2GCoordinateMenu, self.A2GMenuSystem, self, "MGRS" )
|
||||||
MENU_MISSION_COMMAND:New( "LL Accuracy 1", A2GCoordinateMenu, self.MenuLL_Accuracy, self, 1 )
|
MENU_MISSION_COMMAND:New( "LL Accuracy 1", A2GCoordinateMenu, self.MenuLL_Accuracy, self, 1 )
|
||||||
MENU_MISSION_COMMAND:New( "LL Accuracy 2", A2GCoordinateMenu, self.MenuLL_Accuracy, self, 2 )
|
MENU_MISSION_COMMAND:New( "LL Accuracy 2", A2GCoordinateMenu, self.MenuLL_Accuracy, self, 2 )
|
||||||
@ -172,7 +173,7 @@ do -- SETTINGS
|
|||||||
MENU_MISSION_COMMAND:New( "LL Decimal Off", A2GCoordinateMenu, self.MenuLL_DMS, self, false )
|
MENU_MISSION_COMMAND:New( "LL Decimal Off", A2GCoordinateMenu, self.MenuLL_DMS, self, false )
|
||||||
end
|
end
|
||||||
|
|
||||||
if self:IsA2GMGRS() then
|
if self:IsA2G_MGRS() then
|
||||||
MENU_MISSION_COMMAND:New( "Activate LL", A2GCoordinateMenu, self.A2GMenuSystem, self, "LL" )
|
MENU_MISSION_COMMAND:New( "Activate LL", A2GCoordinateMenu, self.A2GMenuSystem, self, "LL" )
|
||||||
MENU_MISSION_COMMAND:New( "MGRS Accuracy 1", A2GCoordinateMenu, self.MenuMGRS_Accuracy, self, 1 )
|
MENU_MISSION_COMMAND:New( "MGRS Accuracy 1", A2GCoordinateMenu, self.MenuMGRS_Accuracy, self, 1 )
|
||||||
MENU_MISSION_COMMAND:New( "MGRS Accuracy 2", A2GCoordinateMenu, self.MenuMGRS_Accuracy, self, 2 )
|
MENU_MISSION_COMMAND:New( "MGRS Accuracy 2", A2GCoordinateMenu, self.MenuMGRS_Accuracy, self, 2 )
|
||||||
@ -183,12 +184,12 @@ do -- SETTINGS
|
|||||||
|
|
||||||
local A2ACoordinateMenu = MENU_MISSION:New( "A2A Coordinate System", self.SystemMenu )
|
local A2ACoordinateMenu = MENU_MISSION:New( "A2A Coordinate System", self.SystemMenu )
|
||||||
|
|
||||||
if self:IsA2ABULLS() then
|
if self:IsA2A_BULLS() then
|
||||||
MENU_MISSION_COMMAND:New( "Activate BRA", A2GCoordinateMenu, self.A2AMenuSystem, self, "BRA" )
|
MENU_MISSION_COMMAND:New( "Activate BRA", A2ACoordinateMenu, self.A2AMenuSystem, self, "BRA" )
|
||||||
end
|
end
|
||||||
|
|
||||||
if self:IsA2ABRA() then
|
if self:IsA2A_BRA() then
|
||||||
MENU_MISSION_COMMAND:New( "Activate BULLS", A2GCoordinateMenu, self.A2AMenuSystem, self, "BULLS" )
|
MENU_MISSION_COMMAND:New( "Activate BULLS", A2ACoordinateMenu, self.A2AMenuSystem, self, "BULLS" )
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@ -197,30 +198,30 @@ do -- SETTINGS
|
|||||||
--- @param #SETTINGS self
|
--- @param #SETTINGS self
|
||||||
function SETTINGS:A2GMenuSystem( A2GSystem )
|
function SETTINGS:A2GMenuSystem( A2GSystem )
|
||||||
self.A2GSystem = A2GSystem
|
self.A2GSystem = A2GSystem
|
||||||
self:CoordinateMenu()
|
self:SettingsMenu()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
--- @param #SETTINGS self
|
||||||
function SETTINGS:A2AMenuSystem( A2ASystem )
|
function SETTINGS:A2AMenuSystem( A2ASystem )
|
||||||
self.A2ASystem = A2ASystem
|
self.A2ASystem = A2ASystem
|
||||||
self:CoordinateMenu()
|
self:SettingsMenu()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
--- @param #SETTINGS self
|
||||||
function SETTINGS:MenuLL_Accuracy( LL_Accuracy )
|
function SETTINGS:MenuLL_Accuracy( LL_Accuracy )
|
||||||
self.LL_Accuracy = LL_Accuracy
|
self.LL_Accuracy = LL_Accuracy
|
||||||
self:CoordinateMenu()
|
self:SettingsMenu()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
--- @param #SETTINGS self
|
||||||
function SETTINGS:MenuLL_DMS( LL_DMS )
|
function SETTINGS:MenuLL_DMS( LL_DMS )
|
||||||
self.LL_DMS = LL_DMS
|
self.LL_DMS = LL_DMS
|
||||||
self:CoordinateMenu()
|
self:SettingsMenu()
|
||||||
end
|
end
|
||||||
--- @param #SETTINGS self
|
--- @param #SETTINGS self
|
||||||
function SETTINGS:MenuMGRS_Accuracy( MGRS_Accuracy )
|
function SETTINGS:MenuMGRS_Accuracy( MGRS_Accuracy )
|
||||||
self.MGRS_Accuracy = MGRS_Accuracy
|
self.MGRS_Accuracy = MGRS_Accuracy
|
||||||
self:CoordinateMenu()
|
self:SettingsMenu()
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -116,13 +116,12 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
local MenuMissionsSummary = MENU_GROUP_COMMAND:New( EventGroup, "Missions Status Report", MenuReporting, self.ReportMissionsStatus, self, EventGroup )
|
local MenuMissionsSummary = MENU_GROUP_COMMAND:New( EventGroup, "Missions Status Report", MenuReporting, self.ReportMissionsStatus, self, EventGroup )
|
||||||
local MenuMissionsDetails = MENU_GROUP_COMMAND:New( EventGroup, "Missions Players Report", MenuReporting, self.ReportMissionsPlayers, self, EventGroup )
|
local MenuMissionsDetails = MENU_GROUP_COMMAND:New( EventGroup, "Missions Players Report", MenuReporting, self.ReportMissionsPlayers, self, EventGroup )
|
||||||
self:ReportSummary( EventGroup )
|
self:ReportSummary( EventGroup )
|
||||||
end
|
|
||||||
local PlayerUnit = EventData.IniUnit
|
local PlayerUnit = EventData.IniUnit
|
||||||
for MissionID, Mission in pairs( self:GetMissions() ) do
|
for MissionID, Mission in pairs( self:GetMissions() ) do
|
||||||
local Mission = Mission -- Tasking.Mission#MISSION
|
local Mission = Mission -- Tasking.Mission#MISSION
|
||||||
local PlayerGroup = EventData.IniGroup -- The GROUP object should be filled!
|
local PlayerGroup = EventData.IniGroup -- The GROUP object should be filled!
|
||||||
Mission:JoinUnit( PlayerUnit, PlayerGroup )
|
Mission:JoinUnit( PlayerUnit, PlayerGroup )
|
||||||
Mission:ReportDetails()
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -2217,4 +2217,22 @@ function CONTROLLABLE:WayPointExecute( WayPoint, WaitTime )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Returns if the Controllable contains AirPlanes.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @return #boolean true if Controllable contains AirPlanes.
|
||||||
|
function CONTROLLABLE:IsAirPlane()
|
||||||
|
self:F2()
|
||||||
|
|
||||||
|
local DCSObject = self:GetDCSObject()
|
||||||
|
|
||||||
|
if DCSObject then
|
||||||
|
local Category = DCSObject:getCategory()
|
||||||
|
self:T2( Category )
|
||||||
|
return Category == Unit.Category.AIRPLANE
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Message APIs
|
-- Message APIs
|
||||||
Loading…
x
Reference in New Issue
Block a user