From 3cea1cc78c66635421734d1921c19371e13b6b9a Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 2 Jan 2025 16:20:47 +0100 Subject: [PATCH] #PLAYERRECCE - allow to display add'l location in report as per user settings for laser and visual targets. --- Moose Development/Moose/Ops/PlayerRecce.lua | 26 ++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/PlayerRecce.lua b/Moose Development/Moose/Ops/PlayerRecce.lua index f6a90c9a9..0f3c1f556 100644 --- a/Moose Development/Moose/Ops/PlayerRecce.lua +++ b/Moose Development/Moose/Ops/PlayerRecce.lua @@ -80,6 +80,7 @@ -- @field #boolean smokeownposition -- @field #table SmokeOwn -- @field #boolean smokeaveragetargetpos +-- @field #boolean reporttostringbullsonly -- @extends Core.Fsm#FSM --- @@ -133,7 +134,8 @@ PLAYERRECCE = { TargetCache = nil, smokeownposition = false, SmokeOwn = {}, - smokeaveragetargetpos = false, + smokeaveragetargetpos = true, + reporttostringbullsonly = true, } --- @@ -236,6 +238,8 @@ function PLAYERRECCE:New(Name, Coalition, PlayerSet) self.minthreatlevel = 0 + self.reporttostringbullsonly = true + self.TForget = 600 self.TargetCache = FIFO:New() @@ -929,6 +933,7 @@ function PLAYERRECCE:_LaseTarget(client,targetset) if (not oldtarget) or targetset:IsNotInSet(oldtarget) or target:IsDead() or target:IsDestroyed() then -- lost LOS or dead laser:LaseOff() + self:T(self.lid.."Target Life Points: "..target:GetLife() or "none") if target:IsDead() or target:IsDestroyed() or target:GetLife() < 2 then self:__Shack(-1,client,oldtarget) --self.LaserTarget[playername] = nil @@ -1274,6 +1279,9 @@ self:T(self.lid.."_ReportLaserTargets") report:Add("Threat Level: "..ThreatGraph.." ("..ThreatLevelText..")") if not self.ReferencePoint then report:Add("Location: "..client:GetCoordinate():ToStringBULLS(self.Coalition,Settings)) + if self.reporttostringbullsonly ~= true then + report:Add("Location: "..client:GetCoordinate():ToStringA2G(nil,Settings)) + end else report:Add("Location: "..client:GetCoordinate():ToStringFromRPShort(self.ReferencePoint,self.RPName,client,Settings)) end @@ -1317,8 +1325,14 @@ function PLAYERRECCE:_ReportVisualTargets(client,group,playername) report:Add("Threat Level: "..ThreatGraph.." ("..ThreatLevelText..")") if not self.ReferencePoint then report:Add("Location: "..client:GetCoordinate():ToStringBULLS(self.Coalition,Settings)) + if self.reporttostringbullsonly ~= true then + report:Add("Location: "..client:GetCoordinate():ToStringA2G(nil,Settings)) + end else report:Add("Location: "..client:GetCoordinate():ToStringFromRPShort(self.ReferencePoint,self.RPName,client,Settings)) + if self.reporttostringbullsonly ~= true then + report:Add("Location: "..client:GetCoordinate():ToStringA2G(nil,Settings)) + end end report:Add(string.rep("-",15)) local text = report:Text() @@ -1552,6 +1566,16 @@ function PLAYERRECCE:SetMenuName(Name) return self end +--- [User] Set reporting to be BULLS only or BULLS plus playersettings based coordinate. +-- @param #PLAYERRECCE self +-- @param #boolean OnOff +-- @return #PLAYERRECCE self +function PLAYERRECCE:SetReportBullsOnly(OnOff) + self:T(self.lid.."SetReportBullsOnly: "..tostring(OnOff)) + self.reporttostringbullsonly = OnOff + return self +end + --- [User] Enable smoking of own position -- @param #PLAYERRECCE self -- @return #PLAYERRECCE self