Add coord message when activate targets.

This commit is contained in:
2025-01-03 20:24:46 +08:00
parent 20ef08e16c
commit 9d55f7e017
3 changed files with 29 additions and 0 deletions
+25
View File
@@ -495,6 +495,7 @@ do
local Controller = targetGroup:getController()
if not Controller then return end
local targetPointReport = Localizations:translate('Your targets are spawned at: ','cn')
--Set Moving
if Move then
local startPoint = {}
@@ -547,11 +548,35 @@ do
},
}
local lat, lon, alt = coord.LOtoLL({x=startPoint.x,y=land.getHeight(startPoint),z=startPoint.y})
local grid = coord.LLtoMGRS(lat,lon)
local LLText = Utils.tostringLL(lat,lon,3)
local MGRSText = grid.UTMZone .. ' ' .. grid.MGRSDigraph .. ' ' .. grid.Easting .. ' ' .. grid.Northing
targetPointReport = targetPointReport.. '\nLLDM: '..LLText..' \nMGRS: '..MGRSText
targetPointReport = targetPointReport ..'\n'.. Localizations:translate('and moving to: ','cn')
lat, lon, alt = coord.LOtoLL({x=finPoint.x,y=land.getHeight(finPoint),z=finPoint.y})
grid = coord.LLtoMGRS(lat,lon)
LLText = Utils.tostringLL(lat,lon,3,true)
MGRSText = grid.UTMZone .. ' ' .. grid.MGRSDigraph .. ' ' .. grid.Easting .. ' ' .. grid.Northing
targetPointReport = targetPointReport.. '\nLLDM: '..LLText..' \nMGRS: '..MGRSText
timer.scheduleFunction(function (Mission)
Controller:setTask(Mission)
end,Mission,timer.getTime()+5)
end
if not Move then
local lat, lon, alt = coord.LOtoLL({x=centerPoint.x,y=land.getHeight(centerPoint),z=centerPoint.y})
local grid = coord.LLtoMGRS(lat,lon)
local LLText = Utils.tostringLL(lat,lon,3)
local MGRSText = grid.UTMZone .. ' ' .. grid.MGRSDigraph .. ' ' .. grid.Easting .. ' ' .. grid.Northing
targetPointReport = targetPointReport.. '\nLLDM: '..LLText..' \nMGRS: '..MGRSText
end
trigger.action.outTextForGroup(self.playerList[playerName].groupID,targetPointReport,60)
--Set fight back
if self.playerList[playerName].isTargerRedAlert then
timer.scheduleFunction(function (targetGroup)