You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
docbrownd
changed the title
InitCallSign : First caract need to me in upper case
InitCallSign : First caract need to be in upper case
May 4, 2024
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
The text was updated successfully, but these errors were encountered: