FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
292 stars 94 forks source link

InitCallSign : First caract need to be in upper case #2124

Closed docbrownd closed 2 months ago

docbrownd commented 2 months ago

Hi, when using SPAWN:InitCallSign, callsign in F10 view is in full lower case. But if you use editor, first caract is in uppser case -> enfield1-1 versus Enfield-1-1 Possible to change this line code : self.SpawnInitCallSignName=string.lower(Name)or"enfield" by self.SpawnInitCallSignName=string.lower(Name):gsub("^%l", string.upper) or "Enfield"

Btw, if Name is null, string.lower return an exception, not null value. so may be it's better to have a local var like : local Name = Name or 'Enfield'

Finally InitCallSign became :

function SPAWN:InitCallSign(ID,Name,Minor,Major) local Name = Name or "Enfield" self.SpawnInitCallSign=true self.SpawnInitCallSignID=ID or 1 self.SpawnInitCallSignMinor=Minor or 1 self.SpawnInitCallSignMajor=Major or 1 self.SpawnInitCallSignName=string.lower(Name):gsub("^%l", string.upper) return self end

Thanks

Applevangelist commented 2 months ago

Sure. https://github.com/FlightControl-Master/MOOSE/commit/044fb66ca064687a743791e5a4a5d02c109ca9c1

docbrownd commented 2 months ago

Sure. 044fb66

thanks you, best