From 228ed0288c25337697e12d3e25c57e7103037083 Mon Sep 17 00:00:00 2001 From: lzk <124214523+lzk228@users.noreply.github.com> Date: Sat, 11 Oct 2025 02:36:58 +0200 Subject: [PATCH] make nobody supervisor a locale key and cleanup JobPrototype (#39102) * make nobody supervisor locale key and cleanup JobPrototype * Update Content.Shared/Roles/JobPrototype.cs --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- Content.Shared/Roles/JobPrototype.cs | 34 +++++++++---------- .../Locale/en-US/job/job-supervisors.ftl | 3 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs index 54e5c1d525..6b58c42428 100644 --- a/Content.Shared/Roles/JobPrototype.cs +++ b/Content.Shared/Roles/JobPrototype.cs @@ -17,19 +17,19 @@ namespace Content.Shared.Roles [IdDataField] public string ID { get; private set; } = default!; - [DataField("playTimeTracker", required: true, customTypeSerializer: typeof(PrototypeIdSerializer))] + [DataField(required: true, customTypeSerializer: typeof(PrototypeIdSerializer))] public string PlayTimeTracker { get; private set; } = string.Empty; /// /// Who is the supervisor for this job. /// - [DataField("supervisors")] - public string Supervisors { get; private set; } = "nobody"; + [DataField] + public LocId Supervisors = "job-supervisors-nobody"; /// /// The name of this job as displayed to players. /// - [DataField("name")] + [DataField] public string Name { get; private set; } = string.Empty; [ViewVariables(VVAccess.ReadOnly)] @@ -38,7 +38,7 @@ namespace Content.Shared.Roles /// /// The name of this job as displayed to players. /// - [DataField("description")] + [DataField] public string? Description { get; private set; } [ViewVariables(VVAccess.ReadOnly)] @@ -53,19 +53,19 @@ namespace Content.Shared.Roles /// /// When true - the station will have anouncement about arrival of this player. /// - [DataField("joinNotifyCrew")] + [DataField] public bool JoinNotifyCrew { get; private set; } = false; /// /// When true - the player will recieve a message about importancy of their job. /// - [DataField("requireAdminNotify")] + [DataField] public bool RequireAdminNotify { get; private set; } = false; /// /// Should this job appear in preferences menu? /// - [DataField("setPreference")] + [DataField] public bool SetPreference { get; private set; } = true; /// @@ -81,14 +81,14 @@ namespace Content.Shared.Roles [DataField] public bool? OverrideConsoleVisibility { get; private set; } = null; - [DataField("canBeAntag")] + [DataField] public bool CanBeAntag { get; private set; } = true; /// /// The "weight" or importance of this job. If this number is large, the job system will assign this job /// before assigning other jobs. /// - [DataField("weight")] + [DataField] public int Weight { get; private set; } /// @@ -105,7 +105,7 @@ namespace Content.Shared.Roles /// A numerical score for how much easier this job is for antagonists. /// For traitors, reduces starting TC by this amount. Other gamemodes can use it for whatever they find fitting. /// - [DataField("antagAdvantage")] + [DataField] public int AntagAdvantage = 0; [DataField] @@ -116,7 +116,7 @@ namespace Content.Shared.Roles /// Starting gear will be ignored. /// If you want to just add special attributes to a humanoid, use AddComponentSpecial instead. /// - [DataField("jobEntity", customTypeSerializer: typeof(PrototypeIdSerializer))] + [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] public string? JobEntity = null; /// @@ -129,19 +129,19 @@ namespace Content.Shared.Roles [DataField] public ProtoId Icon { get; private set; } = "JobIconUnknown"; - [DataField("special", serverOnly: true)] + [DataField(serverOnly: true)] public JobSpecial[] Special { get; private set; } = Array.Empty(); - [DataField("access")] + [DataField] public IReadOnlyCollection> Access { get; private set; } = Array.Empty>(); - [DataField("accessGroups")] + [DataField] public IReadOnlyCollection> AccessGroups { get; private set; } = Array.Empty>(); - [DataField("extendedAccess")] + [DataField] public IReadOnlyCollection> ExtendedAccess { get; private set; } = Array.Empty>(); - [DataField("extendedAccessGroups")] + [DataField] public IReadOnlyCollection> ExtendedAccessGroups { get; private set; } = Array.Empty>(); [DataField] diff --git a/Resources/Locale/en-US/job/job-supervisors.ftl b/Resources/Locale/en-US/job/job-supervisors.ftl index b7615903ee..5e2cf153fc 100644 --- a/Resources/Locale/en-US/job/job-supervisors.ftl +++ b/Resources/Locale/en-US/job/job-supervisors.ftl @@ -12,4 +12,5 @@ job-supervisors-medicine = Medical Doctors, Paramedics, Chemists, and the Chief job-supervisors-security = Security Officers, the Warden, and the Head of Security job-supervisors-science = Scientists and the Research Director job-supervisors-hire = whoever hires you -job-supervisors-everyone = absolutely everyone \ No newline at end of file +job-supervisors-everyone = absolutely everyone +job-supervisors-nobody = nobody