if (!TryComp<IdCardComponent>(uid, out var idCard))
return;
- var state = new AgentIDCardBoundUserInterfaceState(idCard.FullName ?? "", idCard.JobTitle ?? "", idCard.JobIcon);
+ var state = new AgentIDCardBoundUserInterfaceState(idCard.FullName ?? "", idCard.LocalizedJobTitle ?? "", idCard.JobIcon);
_uiSystem.SetUiState(uid, AgentIDCardUiKey.Key, state);
}
PrivilegedIdIsAuthorized(uid, component),
true,
targetIdComponent.FullName,
- targetIdComponent.JobTitle,
+ targetIdComponent.LocalizedJobTitle,
targetAccessComponent.Tags.ToList(),
possibleAccess,
jobProto,
if (_idCard.TryFindIdCard(target, out var id))
{
presumedName = string.IsNullOrWhiteSpace(id.Comp.FullName) ? null : id.Comp.FullName;
- presumedJob = id.Comp.JobTitle?.ToLowerInvariant();
+ presumedJob = id.Comp.LocalizedJobTitle?.ToLowerInvariant();
}
// If it didn't find a job, that's fine.
{
if (card.Comp.FullName != null)
userName = card.Comp.FullName;
- if (card.Comp.JobTitle != null)
- userJob = card.Comp.JobTitle;
+ if (card.Comp.LocalizedJobTitle != null)
+ userJob = card.Comp.LocalizedJobTitle;
userJobIcon = card.Comp.JobIcon;
foreach (var department in card.Comp.JobDepartments)
{
ActualOwnerName = pda.OwnerName,
IdOwner = id?.FullName,
- JobTitle = id?.JobTitle,
+ JobTitle = id?.LocalizedJobTitle,
StationAlertLevel = pda.StationAlertLevel,
StationAlertColor = pda.StationAlertColor
},
[DataField]
[AutoNetworkedField]
[Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)]
- public string? JobTitle;
+ public LocId? JobTitle;
+
+ private string? _jobTitle;
+
+ [Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWriteExecute)]
+ public string? LocalizedJobTitle { set => _jobTitle = value; get => _jobTitle ?? Loc.GetString(JobTitle ?? string.Empty); }
/// <summary>
/// The state of the job icon rsi.
private string GetNameAndJob(IdCardComponent id)
{
- var jobSuffix = string.IsNullOrWhiteSpace(id.JobTitle) ? string.Empty : $" ({id.JobTitle})";
+ var jobSuffix = string.IsNullOrWhiteSpace(id.LocalizedJobTitle) ? string.Empty : $" ({id.LocalizedJobTitle})";
var val = string.IsNullOrWhiteSpace(id.FullName)
? Loc.GetString(id.NameLocId,
/// </summary>
/// <remarks>
/// If provided with a player's EntityUid to the player parameter, adds the change to the admin logs.
+ /// Actually works with the LocalizedJobTitle DataField and not with JobTitle.
/// </remarks>
public bool TryChangeJobTitle(EntityUid uid, string? jobTitle, IdCardComponent? id = null, EntityUid? player = null)
{
jobTitle = null;
}
- if (id.JobTitle == jobTitle)
+ if (id.LocalizedJobTitle == jobTitle)
return true;
- id.JobTitle = jobTitle;
+ id.LocalizedJobTitle = jobTitle;
Dirty(uid, id);
UpdateEntityName(uid, id);
if (!Resolve(uid, ref id))
return;
- var jobSuffix = string.IsNullOrWhiteSpace(id.JobTitle) ? string.Empty : $" ({id.JobTitle})";
+ var jobSuffix = string.IsNullOrWhiteSpace(id.LocalizedJobTitle) ? string.Empty : $" ({id.LocalizedJobTitle})";
var val = string.IsNullOrWhiteSpace(id.FullName)
? Loc.GetString(id.NameLocId,
private static string ExtractFullTitle(IdCardComponent idCardComponent)
{
- return $"{idCardComponent.FullName} ({CultureInfo.CurrentCulture.TextInfo.ToTitleCase(idCardComponent.JobTitle ?? string.Empty)})"
+ return $"{idCardComponent.FullName} ({CultureInfo.CurrentCulture.TextInfo.ToTitleCase(idCardComponent.LocalizedJobTitle ?? string.Empty)})"
.Trim();
}
}
job-name-virologist = Virologist
job-name-zombie = Zombie
+# Job titles
+job-title-visitor = Visitor
+job-title-cluwne = Cluwne
+job-title-universal = Universal
+
# Role timers - Make these alphabetical or I cut you
JobAtmosphericTechnician = Atmospheric Technician
JobBartender = Bartender
- state: default
- state: idvisitor
- type: IdCard
- jobTitle: Visitor
+ jobTitle: job-title-visitor
jobIcon: JobIconVisitor
- type: PresetIdCard
job: Visitor
- state: default
- state: idcluwne
- type: IdCard
- jobTitle: Cluwne
+ jobTitle: job-title-cluwne
- type: Unremoveable
- type: entity
- type: Item
heldPrefix: green
- type: IdCard
- jobTitle: Universal
+ jobTitle: job-title-universal
jobIcon: JobIconAdmin
- type: Access
groups: