From 7743456d7d7821f4079147563bbb10b1a0511a28 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 25 Aug 2022 12:10:20 +0200 Subject: [PATCH] #PLAYERTASK * Short playername usage for broadcast --- Moose Development/Moose/Ops/PlayerTask.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 28e38c8f2..d75d9c2cb 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -1105,7 +1105,7 @@ PLAYERTASKCONTROLLER.Messages = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASKCONTROLLER.version="0.1.22" +PLAYERTASKCONTROLLER.version="0.1.23" --- Constructor -- @param #PLAYERTASKCONTROLLER self @@ -1359,8 +1359,14 @@ function PLAYERTASKCONTROLLER:_EventHandler(EventData) if type(modulation) == "table" then modulation = modulation[1] end modulation = UTILS.GetModulationName(modulation) local switchtext = self.gettext:GetEntry("BROADCAST",self.locale) + + local playername = EventData.IniPlayerName + if string.find(playername,"|") then + -- personalized flight name in player naming + playername = string.match(playername,"| ([%a]+)") + end --local text = string.format("%s, %s, switch to %s for task assignment!",EventData.IniPlayerName,self.MenuName or self.Name,freqtext) - local text = string.format(switchtext,self.MenuName or self.Name,EventData.IniPlayerName,freqtext) + local text = string.format(switchtext,self.MenuName or self.Name,playername,freqtext) self.SRSQueue:NewTransmission(text,nil,self.SRS,timer.getAbsTime()+60,2,{EventData.IniGroup},text,30,self.BCFrequency,self.BCModulation) end end