#PLAYERTASK

* Even nicer MGRS readouts
This commit is contained in:
Applevangelist 2023-01-10 17:09:17 +01:00
parent 0d8b94c7fd
commit 5898bc7f07

View File

@ -3062,10 +3062,12 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Group, Client, Task)
text=string.gsub(text,"°M|","° magnetic; ") text=string.gsub(text,"°M|","° magnetic; ")
end end
if string.find(CoordText,"MGRS") then if string.find(CoordText,"MGRS") then
local Text = string.gsub(CoordText,"%d","%1;") -- "0 5 1 " local Text = string.gsub(CoordText,"MGRS ","")
Text = string.gsub(Text," $","") -- "0 5 1" Text = string.gsub(Text,"%s+","")
CoordText = string.gsub(Text,"0","zero") Text = string.gsub(Text,"([%a%d])","%1;") -- "0 5 1 "
CoordText = string.gsub(Text,"MGRS","MGRS;") Text = string.gsub(Text,"0","zero")
Text = string.gsub(Text,"9","niner")
CoordText = "MGRS;"..Text
if self.PathToGoogleKey then if self.PathToGoogleKey then
CoordText = string.format("<say-as interpret-as='characters'>%s</say-as>",CoordText) CoordText = string.format("<say-as interpret-as='characters'>%s</say-as>",CoordText)
end end