mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
* POINT/PLAYERTASK
* Added option to get BR/BRA with add'l magnetic heading
This commit is contained in:
@@ -922,6 +922,7 @@ do
|
|||||||
-- @field Ops.PlayerRecce#PLAYERRECCE PlayerRecce
|
-- @field Ops.PlayerRecce#PLAYERRECCE PlayerRecce
|
||||||
-- @field #number Coalition
|
-- @field #number Coalition
|
||||||
-- @field Core.Menu#MENU_MISSION MenuParent
|
-- @field Core.Menu#MENU_MISSION MenuParent
|
||||||
|
-- @field #boolean ShowMagnetic Also show magnetic angles
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -1234,6 +1235,7 @@ PLAYERTASKCONTROLLER = {
|
|||||||
PlayerRecce = nil,
|
PlayerRecce = nil,
|
||||||
Coalition = nil,
|
Coalition = nil,
|
||||||
MenuParent = nil,
|
MenuParent = nil,
|
||||||
|
ShowMagnetic = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -1400,7 +1402,7 @@ PLAYERTASKCONTROLLER.Messages = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASKCONTROLLER.version="0.1.45"
|
PLAYERTASKCONTROLLER.version="0.1.46"
|
||||||
|
|
||||||
--- Create and run a new TASKCONTROLLER instance.
|
--- Create and run a new TASKCONTROLLER instance.
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
@@ -1456,6 +1458,8 @@ function PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter)
|
|||||||
self.CallsignTranslations = nil
|
self.CallsignTranslations = nil
|
||||||
|
|
||||||
self.noflaresmokemenu = false
|
self.noflaresmokemenu = false
|
||||||
|
|
||||||
|
self.ShowMagnetic = true
|
||||||
|
|
||||||
if ClientFilter then
|
if ClientFilter then
|
||||||
self.ClientSet = SET_CLIENT:New():FilterCoalitions(string.lower(self.CoalitionName)):FilterActive(true):FilterPrefixes(ClientFilter):FilterStart()
|
self.ClientSet = SET_CLIENT:New():FilterCoalitions(string.lower(self.CoalitionName)):FilterActive(true):FilterPrefixes(ClientFilter):FilterStart()
|
||||||
@@ -2016,6 +2020,20 @@ function PLAYERTASKCONTROLLER:SwitchUseGroupNames(OnOff)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Switch showing additional magnetic angles
|
||||||
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
|
-- @param #boolean OnOff If true, set to on (default), if nil or false, set to off
|
||||||
|
-- @return #PLAYERTASKCONTROLLER self
|
||||||
|
function PLAYERTASKCONTROLLER:SwitchMagenticAngles(OnOff)
|
||||||
|
self:T(self.lid.."SwitchMagenticAngles")
|
||||||
|
if OnOff then
|
||||||
|
self.ShowMagnetic = true
|
||||||
|
else
|
||||||
|
self.ShowMagnetic = false
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] Get task types for the menu
|
--- [Internal] Get task types for the menu
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @return #table TaskTypes
|
-- @return #table TaskTypes
|
||||||
@@ -2681,9 +2699,9 @@ function PLAYERTASKCONTROLLER:_FlashInfo()
|
|||||||
local Coordinate = task.Target:GetCoordinate()
|
local Coordinate = task.Target:GetCoordinate()
|
||||||
local CoordText = ""
|
local CoordText = ""
|
||||||
if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A then
|
if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A then
|
||||||
CoordText = Coordinate:ToStringA2G(_client)
|
CoordText = Coordinate:ToStringA2G(_client, nil, self.ShowMagnetic)
|
||||||
else
|
else
|
||||||
CoordText = Coordinate:ToStringA2A(_client)
|
CoordText = Coordinate:ToStringA2A(_client, nil, self.ShowMagnetic)
|
||||||
end
|
end
|
||||||
local targettxt = self.gettext:GetEntry("TARGET",self.locale)
|
local targettxt = self.gettext:GetEntry("TARGET",self.locale)
|
||||||
local text = "Target: "..CoordText
|
local text = "Target: "..CoordText
|
||||||
@@ -2716,9 +2734,9 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Group, Client, Task)
|
|||||||
local Coordinate = task.Target:GetCoordinate()
|
local Coordinate = task.Target:GetCoordinate()
|
||||||
local CoordText = ""
|
local CoordText = ""
|
||||||
if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A then
|
if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A then
|
||||||
CoordText = Coordinate:ToStringA2G(Client)
|
CoordText = Coordinate:ToStringA2G(Client,nil,self.ShowMagnetic)
|
||||||
else
|
else
|
||||||
CoordText = Coordinate:ToStringA2A(Client)
|
CoordText = Coordinate:ToStringA2A(Client,nil,self.ShowMagnetic)
|
||||||
end
|
end
|
||||||
-- Threat Level
|
-- Threat Level
|
||||||
local ThreatLevel = task.Target:GetThreatLevelMax()
|
local ThreatLevel = task.Target:GetThreatLevelMax()
|
||||||
@@ -2822,6 +2840,9 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Group, Client, Task)
|
|||||||
if string.find(CoordText," BR, ") then
|
if string.find(CoordText," BR, ") then
|
||||||
CoordText = string.gsub(CoordText," BR, "," Bee, Arr, ")
|
CoordText = string.gsub(CoordText," BR, "," Bee, Arr, ")
|
||||||
end
|
end
|
||||||
|
if self.ShowMagnetic then
|
||||||
|
text=string.gsub(text,"°M|","° magnetic, ")
|
||||||
|
end
|
||||||
local ThreatLocaleTextTTS = self.gettext:GetEntry("THREATTEXTTTS",self.locale)
|
local ThreatLocaleTextTTS = self.gettext:GetEntry("THREATTEXTTTS",self.locale)
|
||||||
local ttstext = string.format(ThreatLocaleTextTTS,self.MenuName or self.Name,ttsplayername,ttstaskname,ThreatLevelText, targets, CoordText)
|
local ttstext = string.format(ThreatLocaleTextTTS,self.MenuName or self.Name,ttsplayername,ttstaskname,ThreatLevelText, targets, CoordText)
|
||||||
-- POINTERTARGETLASINGTTS = ". Pointer over target and lasing."
|
-- POINTERTARGETLASINGTTS = ". Pointer over target and lasing."
|
||||||
|
|||||||
Reference in New Issue
Block a user