#AUTOLASE - Somewhat nicer report display

This commit is contained in:
Applevangelist
2024-12-27 12:24:26 +01:00
parent 9300050573
commit 7b6df08268

View File

@@ -118,7 +118,7 @@ AUTOLASE = {
--- AUTOLASE class version. --- AUTOLASE class version.
-- @field #string version -- @field #string version
AUTOLASE.version = "0.1.25" AUTOLASE.version = "0.1.26"
------------------------------------------------------------------- -------------------------------------------------------------------
-- Begin Functional.Autolase.lua -- Begin Functional.Autolase.lua
@@ -757,9 +757,11 @@ function AUTOLASE:ShowStatus(Group,Unit)
end end
local code = self:GetLaserCode(unit:GetName()) local code = self:GetLaserCode(unit:GetName())
report:Add(string.format("Recce %s has code %d",name,code)) report:Add(string.format("Recce %s has code %d",name,code))
report:Add("---------------")
end end
end end
report:Add(string.format("Lasing min threat level %d",self.minthreatlevel)) report:Add(string.format("Lasing min threat level %d",self.minthreatlevel))
report:Add("---------------")
local lines = 0 local lines = 0
for _ind,_entry in pairs(self.CurrentLasing) do for _ind,_entry in pairs(self.CurrentLasing) do
local entry = _entry -- #AUTOLASE.LaserSpot local entry = _entry -- #AUTOLASE.LaserSpot
@@ -779,7 +781,7 @@ function AUTOLASE:ShowStatus(Group,Unit)
if playername then if playername then
local settings = _DATABASE:GetPlayerSettings(playername) local settings = _DATABASE:GetPlayerSettings(playername)
if settings then if settings then
self:I("Get Settings ok!") self:T("Get Settings ok!")
if settings:IsA2G_MGRS() then if settings:IsA2G_MGRS() then
locationstring = entry.coordinate:ToStringMGRS(settings) locationstring = entry.coordinate:ToStringMGRS(settings)
elseif settings:IsA2G_LL_DMS() then elseif settings:IsA2G_LL_DMS() then
@@ -789,12 +791,14 @@ function AUTOLASE:ShowStatus(Group,Unit)
end end
end end
end end
local text = string.format("%s lasing %s code %d\nat %s",reccename,typename,code,locationstring) local text = string.format("+ %s lasing %s code %d\nat %s",reccename,typename,code,locationstring)
report:Add(text) report:Add(text)
report:Add("---------------")
lines = lines + 1 lines = lines + 1
end end
if lines == 0 then if lines == 0 then
report:Add("No targets!") report:Add("No targets!")
report:Add("---------------")
end end
local reporttime = self.reporttimelong local reporttime = self.reporttimelong
if lines == 0 then reporttime = self.reporttimeshort end if lines == 0 then reporttime = self.reporttimeshort end