From 201517755df663277d9f44e27f6b8404956b9e20 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Thu, 20 Jun 2024 16:59:53 +1000
Subject: [PATCH 01/23] revert 1218
---
.../Access/Components/PresetIdCardComponent.cs | 6 ------
.../Station/Systems/StationSpawningSystem.cs | 10 +++++++++-
.../Entities/Objects/Misc/identification_cards.yml | 8 --------
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/Content.Server/Access/Components/PresetIdCardComponent.cs b/Content.Server/Access/Components/PresetIdCardComponent.cs
index 8fd0e10d423..94aef2e6ca0 100644
--- a/Content.Server/Access/Components/PresetIdCardComponent.cs
+++ b/Content.Server/Access/Components/PresetIdCardComponent.cs
@@ -11,10 +11,4 @@ public sealed partial class PresetIdCardComponent : Component
[DataField("name")]
public string? IdName;
-
- ///
- /// DeltaV: Allow changing the job title, even if it'd be otherwise set by the JobPrototype
- ///
- [DataField("customJob")]
- public string? CustomJobName;
}
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index ce8177e1039..b917b9782c8 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -30,6 +30,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
+using Content.Server.Access.Components;
namespace Content.Server.Station.Systems;
@@ -258,7 +259,14 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobProto
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
- _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card);
+
+ // DeltaV - Allow changing the job title within the prototype
+ string jobName = jobPrototype.LocalizedName;
+ if (TryComp(cardId, out var presetId))
+ jobName = presetId.CustomJobName ?? jobName;
+
+ _cardSystem.TryChangeJobTitle(cardId, jobName, card);
+ // End of DeltaV code
if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
_cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index 2f232c566a3..9a3d558a034 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -822,8 +822,6 @@
layers:
- state: default
- state: idseniorengineer
- - type: PresetIdCard # DeltaV - Change senior job titles
- customJob: Senior Engineer
- type: entity
parent: ResearchIDCard
@@ -834,8 +832,6 @@
layers:
- state: default
- state: idseniorresearcher
- - type: PresetIdCard # DeltaV - Change senior job titles
- customJob: Senior Researcher
- type: entity
parent: MedicalIDCard
@@ -846,8 +842,6 @@
layers:
- state: default
- state: idseniorphysician
- - type: PresetIdCard # DeltaV - Change senior job titles
- customJob: Senior Physician
- type: entity
parent: SecurityIDCard
@@ -858,8 +852,6 @@
layers:
- state: default
- state: idseniorofficer
- - type: PresetIdCard # DeltaV - Change senior job titles
- customJob: Senior Officer
- type: entity
parent: IDCardStandard
From 6948cc98ea74ba93ff0a33a65e1de7f28c177d9a Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Thu, 20 Jun 2024 19:18:36 +1000
Subject: [PATCH 02/23] oops wrong file
---
.../Access/Systems/PresetIdCardSystem.cs | 26 +------------------
.../Station/Systems/StationSpawningSystem.cs | 10 +------
2 files changed, 2 insertions(+), 34 deletions(-)
diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs
index 7aed03b74a8..0983e501a4d 100644
--- a/Content.Server/Access/Systems/PresetIdCardSystem.cs
+++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs
@@ -2,10 +2,8 @@
using Content.Server.GameTicking;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
-using Content.Server.StationRecords.Systems;
using Content.Shared.Access.Systems;
using Content.Shared.Roles;
-using Content.Shared.StationRecords;
using Content.Shared.StatusIcon;
using Robust.Shared.Prototypes;
@@ -17,8 +15,7 @@ public sealed class PresetIdCardSystem : EntitySystem
[Dependency] private readonly IdCardSystem _cardSystem = default!;
[Dependency] private readonly SharedAccessSystem _accessSystem = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
- [Dependency] private readonly StationRecordsSystem _record = default!; // DeltaV - Allow changing the job title within the prototype
-
+
public override void Initialize()
{
SubscribeLocalEvent(OnMapInit);
@@ -41,7 +38,6 @@ private void PlayerJobsAssigned(RulePlayerJobsAssignedEvent ev)
SetupIdAccess(uid, card, true);
SetupIdName(uid, card);
- SetupIdJob(uid, card); // DeltaV - Allow changing the job title within the prototype
}
}
@@ -61,7 +57,6 @@ private void OnMapInit(EntityUid uid, PresetIdCardComponent id, MapInitEvent arg
SetupIdAccess(uid, id, extended);
SetupIdName(uid, id);
- SetupIdJob(uid, id); // DeltaV - Allow changing the job title within the prototype
}
private void SetupIdName(EntityUid uid, PresetIdCardComponent id)
@@ -71,25 +66,6 @@ private void SetupIdName(EntityUid uid, PresetIdCardComponent id)
_cardSystem.TryChangeFullName(uid, id.IdName);
}
- // DeltaV - Allow changing the job title within the prototype
- private void SetupIdJob(EntityUid uid, PresetIdCardComponent id)
- {
- if (id.CustomJobName == null)
- return;
- _cardSystem.TryChangeJobTitle(uid, id.CustomJobName);
-
- // The following code is taken from IdCardConsoleSystem
- if (!TryComp(uid, out var keyStorage)
- || keyStorage.Key is not { } key
- || !_record.TryGetRecord(key, out var record))
- {
- return;
- }
- record.JobTitle = id.CustomJobName;
- _record.Synchronize(key);
- }
- // End of DeltaV code
-
private void SetupIdAccess(EntityUid uid, PresetIdCardComponent id, bool extended)
{
if (id.JobName == null)
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index b917b9782c8..ce8177e1039 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -30,7 +30,6 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
-using Content.Server.Access.Components;
namespace Content.Server.Station.Systems;
@@ -259,14 +258,7 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobProto
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
-
- // DeltaV - Allow changing the job title within the prototype
- string jobName = jobPrototype.LocalizedName;
- if (TryComp(cardId, out var presetId))
- jobName = presetId.CustomJobName ?? jobName;
-
- _cardSystem.TryChangeJobTitle(cardId, jobName, card);
- // End of DeltaV code
+ _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card);
if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
_cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
From e2b192eeec3307135959004092fd7a37a2d8f96f Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Fri, 21 Jun 2024 03:56:12 +1000
Subject: [PATCH 03/23] commit changes
---
.../GameTicking/GameTicker.Spawning.cs | 96 ++++++++++++++++++-
.../Station/Systems/StationSpawningSystem.cs | 6 +-
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 2 +
Resources/Locale/en-US/job/job-names.ftl | 5 +
.../Objects/Misc/identification_cards.yml | 8 ++
.../Jobs/Engineering/station_engineer.yml | 22 +++++
.../Roles/Jobs/Medical/medical_doctor.yml | 20 ++++
.../Roles/Jobs/Science/scientist.yml | 18 ++++
.../Roles/Jobs/Security/security_officer.yml | 22 +++++
9 files changed, 195 insertions(+), 4 deletions(-)
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index 5f20feee754..bf0f7785054 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -11,8 +11,11 @@
using Content.Shared.Mind;
using Content.Shared.Players;
using Content.Shared.Preferences;
+using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
+using Content.Shared.Clothing;
+using Content.Shared.Access.Components;
using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
@@ -21,6 +24,11 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
+using Microsoft.CodeAnalysis;
+using Content.Shared.PDA;
+using FastAccessors;
+using Content.Server.Access.Components;
+using Content.Shared.Destructible;
namespace Content.Server.GameTicking
{
@@ -28,6 +36,7 @@ public sealed partial class GameTicker
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
+ [Dependency] private readonly IComponentFactory _componentFactory = default!;
[ValidatePrototypeId]
public const string ObserverPrototypeName = "MobObserver";
@@ -223,8 +232,36 @@ private void SpawnPlayer(ICommonSession player,
_mind.SetUserId(newMind, data.UserId);
var jobPrototype = _prototypeManager.Index(jobId);
+ // DeltaV - Senior ID cards
+ ProtoId? virtualJobId = null;
+ JobPrototype? virtualJobProto = null;
+ JobComponent? virtualJob = null;
+ do
+ {
+ var jobLoadout = LoadoutSystem.GetJobPrototype(jobPrototype.ID);
+
+ if (!_prototypeManager.TryIndex(jobLoadout, out RoleLoadoutPrototype? roleProto))
+ break;
+
+ RoleLoadout? loadout = null;
+ character.Loadouts.TryGetValue(jobLoadout, out loadout);
+
+ // Set to default if not present
+ if (loadout == null)
+ {
+ loadout = new RoleLoadout(jobLoadout);
+ loadout.SetDefault(_prototypeManager);
+ }
+
+ if (GetVirtualJobFromRoleLoadout(loadout, roleProto, character, out virtualJobId) && _prototypeManager.TryIndex(virtualJobId, out virtualJobProto))
+ {
+ virtualJob = new JobComponent {Prototype = virtualJobId};
+ }
+ }
+ while (false);
+ // End of DeltaV code
var job = new JobComponent {Prototype = jobId};
- _roles.MindAddRole(newMind, job, silent: silent);
+ _roles.MindAddRole(newMind, virtualJob ?? job, silent: silent);
var jobName = _jobs.MindTryGetJobName(newMind);
_playTimeTrackings.PlayerRolesChanged(player);
@@ -310,6 +347,63 @@ private void SpawnPlayer(ICommonSession player,
RaiseLocalEvent(mob, aev, true);
}
+ // DeltaV - Senior ID cards
+ private bool GetVirtualJobFromRoleLoadout(RoleLoadout loadout, RoleLoadoutPrototype roleProto, HumanoidCharacterProfile character, out ProtoId? virtualJob)
+ {
+ virtualJob = null;
+
+ // Use to read job loadout and find an ID card
+ foreach (var group in loadout.SelectedLoadouts.OrderBy(x => roleProto.Groups.FindIndex(e => e == x.Key)))
+ {
+ foreach (var items in group.Value)
+ {
+ if (!_prototypeManager.TryIndex(items.Prototype, out var loadoutProto))
+ {
+ Log.Warning($"Unable to find loadout prototype for {items.Prototype}");
+ continue;
+ }
+ if (!_prototypeManager.TryIndex(loadoutProto.Equipment, out var startingGear))
+ {
+ Log.Warning($"Unable to find starting gear {loadoutProto.Equipment} for loadout {loadoutProto}");
+ continue;
+ }
+ var entProtoId = startingGear.GetGear("id");
+ if (!_prototypeManager.TryIndex(entProtoId, out var idProto))
+ {
+ Log.Warning($"Unable to find prototype for {startingGear} for starting gear {loadoutProto.Equipment} for loadout {loadoutProto}");
+ continue;
+ }
+ if (idProto.TryGetComponent(out var pdaComponent, _componentFactory) && pdaComponent.IdCard != null)
+ {
+ ProtoId idProtoId = pdaComponent.IdCard;
+ if (!_prototypeManager.TryIndex(idProtoId, out idProto))
+ {
+ Log.Warning($"Unable to find an idCard in {idProto}");
+ return false;
+ }
+ }
+
+ if (!idProto.TryGetComponent(out var idComponent, _componentFactory))
+ {
+ Log.Warning($"Unable to find presetIdCard for {idProto}");
+ continue;
+ }
+
+ ProtoId jobProtoId = idComponent.JobName ?? string.Empty;
+ if (jobProtoId == string.Empty)
+ {
+ Log.Warning($"Empty jobProtoId!");
+ return false;
+ }
+ virtualJob = jobProtoId;
+ Log.Debug($"Successfully outputted {virtualJob} from {idProto}");
+ return true;
+ }
+ }
+ Log.Warning($"All other options exhausted");
+ return false;
+ }
+
public void Respawn(ICommonSession player)
{
_mind.WipeMind(player);
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index ce8177e1039..6cff58338d1 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -258,10 +258,10 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobProto
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
- _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card);
+ //_cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card); // Delta V - Senior ID card, job names and icon should already be set via prototype
- if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
- _cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
+ //if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
+ // _cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
var extendedAccess = false;
if (station != null)
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index ce4428d9fea..3e229a5ac57 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -39,6 +39,8 @@ private void SetupTrackerLookup()
// This breaks if you have N trackers to 1 JobId but future concern.
foreach (var job in _protoManager.EnumeratePrototypes())
{
+ if (_inverseTrackerLookup.ContainsKey(job.PlayTimeTracker)) continue; // DeltaV - we have N trackers to 1 JobId... (senior job names)
+
_inverseTrackerLookup.Add(job.PlayTimeTracker, job.ID);
}
}
diff --git a/Resources/Locale/en-US/job/job-names.ftl b/Resources/Locale/en-US/job/job-names.ftl
index 4b7b5ccc421..f5a5f341e5c 100644
--- a/Resources/Locale/en-US/job/job-names.ftl
+++ b/Resources/Locale/en-US/job/job-names.ftl
@@ -47,6 +47,11 @@ job-name-ertjanitor = ERT Janitor
job-name-boxer = Boxer
job-name-zookeeper = Zookeeper
job-name-visitor = Visitor
+# DeltaV - Define senior job names for use in separate prototypes
+job-name-seniorengineer = Senior Engineer
+job-name-seniorphysician = Senior Physician
+job-name-seniorresearcher = Senior Researcher
+job-name-seniorofficer = Senior Officer
# Role timers - Make these alphabetical or I cut you
JobAtmosphericTechnician = Atmospheric Technician
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index 9a3d558a034..6c7d02ad53c 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -822,6 +822,8 @@
layers:
- state: default
- state: idseniorengineer
+ - type: PresetIdCard # DeltaV - Change senior job titles
+ job: SeniorEngineer
- type: entity
parent: ResearchIDCard
@@ -832,6 +834,8 @@
layers:
- state: default
- state: idseniorresearcher
+ - type: PresetIdCard # DeltaV - Change senior job titles
+ job: SeniorResearcher
- type: entity
parent: MedicalIDCard
@@ -842,6 +846,8 @@
layers:
- state: default
- state: idseniorphysician
+ - type: PresetIdCard # DeltaV - Change senior job titles
+ job: SeniorPhysician
- type: entity
parent: SecurityIDCard
@@ -852,6 +858,8 @@
layers:
- state: default
- state: idseniorofficer
+ - type: PresetIdCard # DeltaV - Change senior job titles
+ job: SeniorOfficer
- type: entity
parent: IDCardStandard
diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
index 15aabc4ab86..cb5cb06bd9f 100644
--- a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
@@ -24,3 +24,25 @@
eyes: ClothingEyesGlassesMeson
belt: ClothingBeltUtilityEngineering
ears: ClothingHeadsetEngineering
+
+# DeltaV - Define senior job names as separate prototypes
+- type: job
+ id: SeniorEngineer
+ #parent: StationEngineer # unfortunately parent-child relationships don't seem to work here :blunt:
+ name: job-name-seniorengineer
+ description: job-description-engineer
+ playTimeTracker: JobStationEngineer
+ antagAdvantage: 3
+ requirements:
+ - !type:DepartmentTimeRequirement
+ department: Engineering
+ time: 216000 # 60 hrs
+ startingGear: StationEngineerGear
+ icon: "JobIconSeniorEngineer"
+ supervisors: job-supervisors-ce
+ access:
+ - Maintenance
+ - Engineering
+ - External
+ extendedAccess:
+ - Atmospherics
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
index daed73984fe..0acd85638fc 100644
--- a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
+++ b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
@@ -22,3 +22,23 @@
equipment:
ears: ClothingHeadsetMedical
belt: ClothingBeltMedicalFilled
+
+- type: job
+ id: SeniorPhysician
+ #parent: MedicalDoctor
+ name: job-name-seniorphysician
+ description: job-description-doctor
+ playTimeTracker: JobMedicalDoctor
+ requirements:
+ - !type:DepartmentTimeRequirement
+ department: Medical
+ time: 216000 # 60 hrs
+ startingGear: DoctorGear
+ icon: "JobIconSeniorPhysician"
+ supervisors: job-supervisors-cmo
+ access:
+ - Medical
+ - Maintenance
+ extendedAccess:
+ - Chemistry
+ - Paramedic
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
index b005accc79f..2b44a2adfef 100644
--- a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
+++ b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
@@ -20,3 +20,21 @@
equipment:
ears: ClothingHeadsetScience
+
+- type: job
+ id: SeniorResearcher
+ #parent: Scientist
+ name: job-name-seniorresearcher
+ description: job-description-scientist
+ playTimeTracker: JobScientist
+ antagAdvantage: 2
+ requirements:
+ - !type:DepartmentTimeRequirement
+ department: Epistemics # DeltaV - Epistemics Department replacing Science
+ time: 216000 # 60 hrs
+ startingGear: ScientistGear
+ icon: "JobIconSeniorResearcher"
+ supervisors: job-supervisors-rd
+ access:
+ - Research
+ - Maintenance
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
index 6de806f7189..d204cf3bae3 100644
--- a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
@@ -28,3 +28,25 @@
eyes: ClothingEyesGlassesSecurity
ears: ClothingHeadsetSecurity
pocket1: WeaponPistolMk58Nonlethal
+
+- type: job
+ id: SeniorOfficer
+ #parent: SecurityOfficer
+ name: job-name-seniorofficer
+ description: job-description-security
+ playTimeTracker: JobSecurityOfficer
+ requirements:
+ - !type:DepartmentTimeRequirement
+ department: Security
+ time: 216000 # 60 hrs
+ startingGear: SecurityOfficerGear
+ icon: "JobIconSeniorOfficer"
+ supervisors: job-supervisors-hos
+ canBeAntag: false
+ access:
+ - Security
+ - Maintenance
+ - External
+ special:
+ - !type:AddImplantSpecial
+ implants: [ MindShieldImplant ]
\ No newline at end of file
From 1a8f2efd3e4e92e04cc0fb6ec0f65d93ac0ea3d2 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Fri, 21 Jun 2024 16:00:05 +1000
Subject: [PATCH 04/23] it works!!!
---
.../GameTicking/GameTicker.Spawning.cs | 19 ++++++-------
.../IdentityManagement/IdentitySystem.cs | 2 ++
.../Station/Systems/StationSpawningSystem.cs | 9 +++---
.../Systems/StationRecordsSystem.cs | 13 +++++++--
Content.Shared/Roles/Jobs/JobComponent.cs | 2 ++
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 28 +++++++++++++++----
.../Prototypes/Catalog/uplink_catalog.yml | 4 +--
.../Jobs/Engineering/station_engineer.yml | 2 +-
.../Prototypes/Roles/Jobs/departments.yml | 4 +++
9 files changed, 58 insertions(+), 25 deletions(-)
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index bf0f7785054..a7b5f3d16a1 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -232,10 +232,8 @@ private void SpawnPlayer(ICommonSession player,
_mind.SetUserId(newMind, data.UserId);
var jobPrototype = _prototypeManager.Index(jobId);
+ var job = new JobComponent {Prototype = jobId};
// DeltaV - Senior ID cards
- ProtoId? virtualJobId = null;
- JobPrototype? virtualJobProto = null;
- JobComponent? virtualJob = null;
do
{
var jobLoadout = LoadoutSystem.GetJobPrototype(jobPrototype.ID);
@@ -253,15 +251,14 @@ private void SpawnPlayer(ICommonSession player,
loadout.SetDefault(_prototypeManager);
}
- if (GetVirtualJobFromRoleLoadout(loadout, roleProto, character, out virtualJobId) && _prototypeManager.TryIndex(virtualJobId, out virtualJobProto))
+ if (GetVirtualJobFromRoleLoadout(loadout, roleProto, character, out var virtualJobId) && _prototypeManager.TryIndex(virtualJobId, out var virtualJobProto))
{
- virtualJob = new JobComponent {Prototype = virtualJobId};
+ job.VirtualJob = new JobComponent {Prototype = virtualJobProto};
}
}
while (false);
+ _roles.MindAddRole(newMind, job, silent: silent);
// End of DeltaV code
- var job = new JobComponent {Prototype = jobId};
- _roles.MindAddRole(newMind, virtualJob ?? job, silent: silent);
var jobName = _jobs.MindTryGetJobName(newMind);
_playTimeTrackings.PlayerRolesChanged(player);
@@ -339,7 +336,7 @@ private void SpawnPlayer(ICommonSession player,
PlayersJoinedRoundNormally++;
var aev = new PlayerSpawnCompleteEvent(mob,
player,
- jobId,
+ job,
lateJoin,
PlayersJoinedRoundNormally,
station,
@@ -594,7 +591,7 @@ public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
{
public EntityUid Mob { get; }
public ICommonSession Player { get; }
- public string? JobId { get; }
+ public JobComponent? Job { get; }
public bool LateJoin { get; }
public EntityUid Station { get; }
public HumanoidCharacterProfile Profile { get; }
@@ -604,7 +601,7 @@ public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
public PlayerSpawnCompleteEvent(EntityUid mob,
ICommonSession player,
- string? jobId,
+ JobComponent? job,
bool lateJoin,
int joinOrder,
EntityUid station,
@@ -612,7 +609,7 @@ public PlayerSpawnCompleteEvent(EntityUid mob,
{
Mob = mob;
Player = player;
- JobId = jobId;
+ Job = job;
LateJoin = lateJoin;
Station = station;
Profile = profile;
diff --git a/Content.Server/IdentityManagement/IdentitySystem.cs b/Content.Server/IdentityManagement/IdentitySystem.cs
index 4766b89172f..895bacdc92d 100644
--- a/Content.Server/IdentityManagement/IdentitySystem.cs
+++ b/Content.Server/IdentityManagement/IdentitySystem.cs
@@ -160,12 +160,14 @@ private IdentityRepresentation GetIdentityRepresentation(EntityUid target,
string? presumedJob = null;
string? presumedName = null;
+ string? presumedJobIcon = null;
// Get their name and job from their ID for their presumed name.
if (_idCard.TryFindIdCard(target, out var id))
{
presumedName = string.IsNullOrWhiteSpace(id.Comp.FullName) ? null : id.Comp.FullName;
presumedJob = id.Comp.JobTitle?.ToLowerInvariant();
+ presumedJobIcon = id.Comp.JobIcon;
}
// If it didn't find a job, that's fine.
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index 6cff58338d1..a376315e730 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -144,6 +144,7 @@ public EntityUid SpawnPlayerMob(
EntityUid? entity = null)
{
_prototypeManager.TryIndex(job?.Prototype ?? string.Empty, out var prototype);
+ _prototypeManager.TryIndex(job?.VirtualJob?.Prototype ?? string.Empty, out var virtualJobPrototype); // DeltaV - Senior ID cards
// If we're not spawning a humanoid, we're gonna exit early without doing all the humanoid stuff.
if (prototype?.JobEntity != null)
@@ -212,7 +213,7 @@ public EntityUid SpawnPlayerMob(
if (profile != null)
{
if (prototype != null)
- SetPdaAndIdCardData(entity.Value, profile.Name, prototype, station);
+ SetPdaAndIdCardData(entity.Value, profile.Name, virtualJobPrototype ?? prototype, station); //DeltaV - Senior ID cards
_humanoidSystem.LoadProfile(entity.Value, profile);
_metaSystem.SetEntityName(entity.Value, profile.Name);
@@ -258,10 +259,10 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobProto
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
- //_cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card); // Delta V - Senior ID card, job names and icon should already be set via prototype
+ _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card); // Delta V - Senior ID card, job names and icon should already be set via prototype
- //if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
- // _cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
+ if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
+ _cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
var extendedAccess = false;
if (station != null)
diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
index 8c8ba7132bb..9371cd78308 100644
--- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
+++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
@@ -1,3 +1,4 @@
+using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Content.Server.Forensics;
using Content.Server.GameTicking;
@@ -5,6 +6,7 @@
using Content.Shared.PDA;
using Content.Shared.Preferences;
using Content.Shared.Roles;
+using Content.Shared.Roles.Jobs;
using Content.Shared.StationRecords;
using Robust.Shared.Enums;
using Robust.Shared.Prototypes;
@@ -48,12 +50,18 @@ private void OnPlayerSpawn(PlayerSpawnCompleteEvent args)
if (!TryComp(args.Station, out var stationRecords))
return;
- CreateGeneralRecord(args.Station, args.Mob, args.Profile, args.JobId, stationRecords);
+ CreateGeneralRecord(args.Station, args.Mob, args.Profile, args.Job, stationRecords);
}
private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCharacterProfile profile,
- string? jobId, StationRecordsComponent records)
+ JobComponent? job, StationRecordsComponent records)
{
+ _prototypeManager.TryIndex(job?.VirtualJob?.Prototype, out var a);
+ if (!_prototypeManager.TryIndex(job?.Prototype, out var b))
+ return;
+
+ ProtoId jobId = a?.ID ?? b.ID;
+ Log.Debug(jobId);
// TODO make PlayerSpawnCompleteEvent.JobId a ProtoId
if (string.IsNullOrEmpty(jobId)
|| !_prototypeManager.HasIndex(jobId))
@@ -133,6 +141,7 @@ public void CreateGeneralRecord(
Fingerprint = mobFingerprint,
DNA = dna
};
+ Log.Debug($"Record: {record.JobTitle}, {record.JobIcon}, {record.JobPrototype}");
var key = AddRecordEntry(station, record);
if (!key.IsValid())
diff --git a/Content.Shared/Roles/Jobs/JobComponent.cs b/Content.Shared/Roles/Jobs/JobComponent.cs
index 7191e8b3971..d04d7208c0c 100644
--- a/Content.Shared/Roles/Jobs/JobComponent.cs
+++ b/Content.Shared/Roles/Jobs/JobComponent.cs
@@ -11,4 +11,6 @@ public sealed partial class JobComponent : Component
{
[DataField(required: true), AutoNetworkedField]
public ProtoId? Prototype;
+ [DataField]
+ public JobComponent? VirtualJob;
}
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index 3e229a5ac57..8b8f043a7cb 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -120,6 +120,19 @@ public bool MindTryGetJob(
_prototypes.TryIndex(comp.Prototype, out prototype);
}
+ public bool MindTryGetVirtualJob( // DeltaV - Senior ID cards
+ [NotNullWhen(true)] EntityUid? mindId,
+ [NotNullWhen(true)] out JobComponent? comp,
+ [NotNullWhen(true)] out JobPrototype? virtualJob)
+ {
+ comp = null;
+ virtualJob = null;
+
+ return TryComp(mindId, out comp) &&
+ comp.VirtualJob != null &&
+ _prototypes.TryIndex(comp.VirtualJob.Prototype, out virtualJob);
+ }
+
public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId? job)
{
if (!TryComp(mindId, out JobComponent? comp))
@@ -138,14 +151,19 @@ public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId
public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string name)
{
- if (MindTryGetJob(mindId, out _, out var prototype))
+ MindTryGetVirtualJob(mindId, out _, out var virtualJob);
+ if (!MindTryGetJob(mindId, out _, out var prototype))
{
- name = prototype.LocalizedName;
- return true;
+ name = Loc.GetString("generic-unknown-title");
+ return false;
}
- name = Loc.GetString("generic-unknown-title");
- return false;
+ name = virtualJob?.LocalizedName ?? string.Empty;
+ if (string.IsNullOrEmpty(name))
+ name = prototype.LocalizedName;
+
+ Log.Debug(name);
+ return true;
}
///
diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml
index 145321484b2..0cf4bef7d2a 100644
--- a/Resources/Prototypes/Catalog/uplink_catalog.yml
+++ b/Resources/Prototypes/Catalog/uplink_catalog.yml
@@ -1392,9 +1392,9 @@
description: uplink-syndicate-stamp-desc
productEntity: RubberStampSyndicate
cost:
- Telecrystal: 2
+ Telecrystal: 1 #DeltaV - Buff Syndicate Stamp cost to be inline with Cybersun Pen
categories:
- - UplinkPointless
+ - UplinkDeception #DeltaV - List Syndicate Stamp as a deception item, MRP
#- type: listing # DeltaV - Remove cat ears
# id: UplinkCatEars
diff --git a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
index b314bebe888..ba0cf1564f7 100644
--- a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
@@ -16,7 +16,7 @@
requirement:
!type:DepartmentTimeRequirement
department: Engineering
- time: 216000 # 60 hrs
+ time: 0 # 216000 # 60 hrs
# Head
diff --git a/Resources/Prototypes/Roles/Jobs/departments.yml b/Resources/Prototypes/Roles/Jobs/departments.yml
index 5512fb2b330..4393cf8af5c 100644
--- a/Resources/Prototypes/Roles/Jobs/departments.yml
+++ b/Resources/Prototypes/Roles/Jobs/departments.yml
@@ -63,6 +63,7 @@
- ChiefEngineer
- StationEngineer
- TechnicalAssistant
+ - SeniorEngineer # DeltaV - Senior ID cards
- type: department
id: Medical
@@ -76,6 +77,7 @@
- Psychologist
- Paramedic
- MedicalBorg # Delta V - Medical Borg, see Resources/Prototypes/DeltaV/Roles/Jobs/Medical/medicalborg.yml
+ - SeniorPhysician # DeltaV - Senior ID cards
- type: department
id: Security
@@ -90,6 +92,7 @@
- Warden
- PrisonGuard # Nyanotrasen - PrisonGuard, see Resources/Prototypes/Nyanotrasen/Roles/Jobs/Security/prisonguard.yml
- Brigmedic # DeltaV - Brigmedic, see Resources/Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml
+ - SeniorOfficer # DeltaV - Senior ID cards
- type: department
id: Epistemics # DeltaV - Epistemics Department replacing Science
@@ -101,6 +104,7 @@
- ResearchAssistant
- Chaplain # DeltaV - Move Chaplain into Epistemics
- ForensicMantis # Nyanotrasen - ForensicMantis, see Resources/Prototypes/Nyanotrasen/Roles/Jobs/Epistemics/forensicmantis.yml
+ - SeniorResearcher # DeltaV - Senior ID cards
- type: department
id: Specific
From 3a39ac86f4bc663cdf2ed10fceec251ef283ec46 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Fri, 21 Jun 2024 19:37:58 +1000
Subject: [PATCH 05/23] revert accidental changes
---
Content.Server/IdentityManagement/IdentitySystem.cs | 2 --
Resources/Prototypes/Catalog/uplink_catalog.yml | 4 ++--
.../Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/Content.Server/IdentityManagement/IdentitySystem.cs b/Content.Server/IdentityManagement/IdentitySystem.cs
index 895bacdc92d..4766b89172f 100644
--- a/Content.Server/IdentityManagement/IdentitySystem.cs
+++ b/Content.Server/IdentityManagement/IdentitySystem.cs
@@ -160,14 +160,12 @@ private IdentityRepresentation GetIdentityRepresentation(EntityUid target,
string? presumedJob = null;
string? presumedName = null;
- string? presumedJobIcon = null;
// Get their name and job from their ID for their presumed name.
if (_idCard.TryFindIdCard(target, out var id))
{
presumedName = string.IsNullOrWhiteSpace(id.Comp.FullName) ? null : id.Comp.FullName;
presumedJob = id.Comp.JobTitle?.ToLowerInvariant();
- presumedJobIcon = id.Comp.JobIcon;
}
// If it didn't find a job, that's fine.
diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml
index 0cf4bef7d2a..145321484b2 100644
--- a/Resources/Prototypes/Catalog/uplink_catalog.yml
+++ b/Resources/Prototypes/Catalog/uplink_catalog.yml
@@ -1392,9 +1392,9 @@
description: uplink-syndicate-stamp-desc
productEntity: RubberStampSyndicate
cost:
- Telecrystal: 1 #DeltaV - Buff Syndicate Stamp cost to be inline with Cybersun Pen
+ Telecrystal: 2
categories:
- - UplinkDeception #DeltaV - List Syndicate Stamp as a deception item, MRP
+ - UplinkPointless
#- type: listing # DeltaV - Remove cat ears
# id: UplinkCatEars
diff --git a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
index ba0cf1564f7..b314bebe888 100644
--- a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
@@ -16,7 +16,7 @@
requirement:
!type:DepartmentTimeRequirement
department: Engineering
- time: 0 # 216000 # 60 hrs
+ time: 216000 # 60 hrs
# Head
From 88ca963522d27fd7e6ebf6202a0ccab8847f3692 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Fri, 21 Jun 2024 21:30:54 +1000
Subject: [PATCH 06/23] hide senior virtual job prototypes from job select
---
Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs | 3 +++
Content.Shared/Roles/JobPrototype.cs | 3 +++
.../Prototypes/Roles/Jobs/Engineering/station_engineer.yml | 1 +
Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml | 1 +
Resources/Prototypes/Roles/Jobs/Science/scientist.yml | 1 +
Resources/Prototypes/Roles/Jobs/Security/security_officer.yml | 1 +
6 files changed, 10 insertions(+)
diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
index ec4701dbe31..d71dc552b4d 100644
--- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
+++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
@@ -851,6 +851,9 @@ public void RefreshJobs()
foreach (var job in jobs)
{
+ if (job.EditorHidden)
+ continue;
+
var jobContainer = new BoxContainer()
{
Orientation = LayoutOrientation.Horizontal,
diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs
index 71bd41c89fb..3d62e03e256 100644
--- a/Content.Shared/Roles/JobPrototype.cs
+++ b/Content.Shared/Roles/JobPrototype.cs
@@ -123,6 +123,9 @@ public sealed partial class JobPrototype : IPrototype
[DataField]
public bool Whitelisted;
+
+ [DataField]
+ public bool EditorHidden;
}
///
diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
index cb5cb06bd9f..306d5380147 100644
--- a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
@@ -29,6 +29,7 @@
- type: job
id: SeniorEngineer
#parent: StationEngineer # unfortunately parent-child relationships don't seem to work here :blunt:
+ editorHidden: true
name: job-name-seniorengineer
description: job-description-engineer
playTimeTracker: JobStationEngineer
diff --git a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
index 0acd85638fc..765bd00953e 100644
--- a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
+++ b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
@@ -26,6 +26,7 @@
- type: job
id: SeniorPhysician
#parent: MedicalDoctor
+ editorHidden: true
name: job-name-seniorphysician
description: job-description-doctor
playTimeTracker: JobMedicalDoctor
diff --git a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
index 2b44a2adfef..dba8ad58ce5 100644
--- a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
+++ b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
@@ -24,6 +24,7 @@
- type: job
id: SeniorResearcher
#parent: Scientist
+ editorHidden: true
name: job-name-seniorresearcher
description: job-description-scientist
playTimeTracker: JobScientist
diff --git a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
index d204cf3bae3..4904a07217b 100644
--- a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
@@ -32,6 +32,7 @@
- type: job
id: SeniorOfficer
#parent: SecurityOfficer
+ editorHidden: true
name: job-name-seniorofficer
description: job-description-security
playTimeTracker: JobSecurityOfficer
From 89cee692441255c2b234a629703a3f8ff0355b15 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Fri, 21 Jun 2024 21:33:48 +1000
Subject: [PATCH 07/23] remove whitespace diff
---
Content.Server/Access/Systems/PresetIdCardSystem.cs | 1 -
1 file changed, 1 deletion(-)
diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs
index 0983e501a4d..719d61b356a 100644
--- a/Content.Server/Access/Systems/PresetIdCardSystem.cs
+++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs
@@ -15,7 +15,6 @@ public sealed class PresetIdCardSystem : EntitySystem
[Dependency] private readonly IdCardSystem _cardSystem = default!;
[Dependency] private readonly SharedAccessSystem _accessSystem = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
-
public override void Initialize()
{
SubscribeLocalEvent(OnMapInit);
From bfb1187719f688dbc0134d02a625630149775131 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Fri, 21 Jun 2024 21:59:25 +1000
Subject: [PATCH 08/23] consolidate comments
---
.../Lobby/UI/HumanoidProfileEditor.xaml.cs | 1 +
.../GameTicking/GameTicker.Spawning.cs | 16 +++++++++-------
.../Station/Systems/StationSpawningSystem.cs | 6 +++---
.../Systems/StationRecordsSystem.cs | 10 +++++-----
Content.Shared/Roles/JobPrototype.cs | 1 +
Content.Shared/Roles/Jobs/JobComponent.cs | 2 ++
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 6 +++++-
Resources/Locale/en-US/job/job-names.ftl | 2 +-
.../Objects/Misc/identification_cards.yml | 16 ++++++++--------
.../Roles/Jobs/Engineering/station_engineer.yml | 4 ++--
.../Roles/Jobs/Medical/medical_doctor.yml | 3 ++-
.../Prototypes/Roles/Jobs/Science/scientist.yml | 4 ++--
.../Roles/Jobs/Security/security_officer.yml | 3 ++-
Resources/Prototypes/Roles/Jobs/departments.yml | 8 ++++----
14 files changed, 47 insertions(+), 35 deletions(-)
diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
index d71dc552b4d..5b6cbf46283 100644
--- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
+++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
@@ -851,6 +851,7 @@ public void RefreshJobs()
foreach (var job in jobs)
{
+ // DeltaV #1418 - Allow hiding jobs to hide senior virtual jobs
if (job.EditorHidden)
continue;
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index a7b5f3d16a1..c842db1c005 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -36,7 +36,7 @@ public sealed partial class GameTicker
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
- [Dependency] private readonly IComponentFactory _componentFactory = default!;
+ [Dependency] private readonly IComponentFactory _componentFactory = default!; // DeltaV #1418
[ValidatePrototypeId]
public const string ObserverPrototypeName = "MobObserver";
@@ -233,7 +233,8 @@ private void SpawnPlayer(ICommonSession player,
var jobPrototype = _prototypeManager.Index(jobId);
var job = new JobComponent {Prototype = jobId};
- // DeltaV - Senior ID cards
+ // DeltaV #1418 - Loadout stuff to get Senior ID
+ // We don't want to inherit everything, so we store the job component in a VirtualJob
do
{
var jobLoadout = LoadoutSystem.GetJobPrototype(jobPrototype.ID);
@@ -251,14 +252,15 @@ private void SpawnPlayer(ICommonSession player,
loadout.SetDefault(_prototypeManager);
}
+ // Get the ID
if (GetVirtualJobFromRoleLoadout(loadout, roleProto, character, out var virtualJobId) && _prototypeManager.TryIndex(virtualJobId, out var virtualJobProto))
{
job.VirtualJob = new JobComponent {Prototype = virtualJobProto};
}
}
while (false);
- _roles.MindAddRole(newMind, job, silent: silent);
// End of DeltaV code
+ _roles.MindAddRole(newMind, job, silent: silent);
var jobName = _jobs.MindTryGetJobName(newMind);
_playTimeTrackings.PlayerRolesChanged(player);
@@ -344,7 +346,7 @@ private void SpawnPlayer(ICommonSession player,
RaiseLocalEvent(mob, aev, true);
}
- // DeltaV - Senior ID cards
+ // DeltaV #1418 - Go through loadout items to find ID card and its attached job
private bool GetVirtualJobFromRoleLoadout(RoleLoadout loadout, RoleLoadoutPrototype roleProto, HumanoidCharacterProfile character, out ProtoId? virtualJob)
{
virtualJob = null;
@@ -591,7 +593,7 @@ public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
{
public EntityUid Mob { get; }
public ICommonSession Player { get; }
- public JobComponent? Job { get; }
+ public JobComponent? Job { get; } // DeltaV #1418 - Replace JobId with Job to parse VirtualJob
public bool LateJoin { get; }
public EntityUid Station { get; }
public HumanoidCharacterProfile Profile { get; }
@@ -601,7 +603,7 @@ public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
public PlayerSpawnCompleteEvent(EntityUid mob,
ICommonSession player,
- JobComponent? job,
+ JobComponent? job, // DeltaV #1418
bool lateJoin,
int joinOrder,
EntityUid station,
@@ -609,7 +611,7 @@ public PlayerSpawnCompleteEvent(EntityUid mob,
{
Mob = mob;
Player = player;
- Job = job;
+ Job = job; // DeltaV #1418
LateJoin = lateJoin;
Station = station;
Profile = profile;
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index a376315e730..0b9427e66f4 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -144,7 +144,7 @@ public EntityUid SpawnPlayerMob(
EntityUid? entity = null)
{
_prototypeManager.TryIndex(job?.Prototype ?? string.Empty, out var prototype);
- _prototypeManager.TryIndex(job?.VirtualJob?.Prototype ?? string.Empty, out var virtualJobPrototype); // DeltaV - Senior ID cards
+ _prototypeManager.TryIndex(job?.VirtualJob?.Prototype ?? string.Empty, out var virtualJobPrototype); // DeltaV #1418 - Get the VirtualJob too
// If we're not spawning a humanoid, we're gonna exit early without doing all the humanoid stuff.
if (prototype?.JobEntity != null)
@@ -213,7 +213,7 @@ public EntityUid SpawnPlayerMob(
if (profile != null)
{
if (prototype != null)
- SetPdaAndIdCardData(entity.Value, profile.Name, virtualJobPrototype ?? prototype, station); //DeltaV - Senior ID cards
+ SetPdaAndIdCardData(entity.Value, profile.Name, virtualJobPrototype ?? prototype, station); // DeltaV #1418 - Inherit job data from a VirtualJob if one exists
_humanoidSystem.LoadProfile(entity.Value, profile);
_metaSystem.SetEntityName(entity.Value, profile.Name);
@@ -259,7 +259,7 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobProto
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
- _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card); // Delta V - Senior ID card, job names and icon should already be set via prototype
+ _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card);
if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
_cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
index 9371cd78308..ffe97963e38 100644
--- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
+++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
@@ -50,19 +50,20 @@ private void OnPlayerSpawn(PlayerSpawnCompleteEvent args)
if (!TryComp(args.Station, out var stationRecords))
return;
- CreateGeneralRecord(args.Station, args.Mob, args.Profile, args.Job, stationRecords);
+ CreateGeneralRecord(args.Station, args.Mob, args.Profile, args.Job, stationRecords); // DeltaV #1418 - JobId replaced with Job to parse VirtualJob
}
private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCharacterProfile profile,
- JobComponent? job, StationRecordsComponent records)
+ JobComponent? job, StationRecordsComponent records) // DeltaV #1418
{
+ // DeltaV #1418 - Inherit from VirtualJob if possible
_prototypeManager.TryIndex(job?.VirtualJob?.Prototype, out var a);
if (!_prototypeManager.TryIndex(job?.Prototype, out var b))
return;
ProtoId jobId = a?.ID ?? b.ID;
- Log.Debug(jobId);
- // TODO make PlayerSpawnCompleteEvent.JobId a ProtoId
+ // TODO make PlayerSpawnCompleteEvent.JobId a ProtoId // DeltaV #1418 - :blunt:
+ // End of DeltaV code
if (string.IsNullOrEmpty(jobId)
|| !_prototypeManager.HasIndex(jobId))
return;
@@ -141,7 +142,6 @@ public void CreateGeneralRecord(
Fingerprint = mobFingerprint,
DNA = dna
};
- Log.Debug($"Record: {record.JobTitle}, {record.JobIcon}, {record.JobPrototype}");
var key = AddRecordEntry(station, record);
if (!key.IsValid())
diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs
index 3d62e03e256..eafc1c21c79 100644
--- a/Content.Shared/Roles/JobPrototype.cs
+++ b/Content.Shared/Roles/JobPrototype.cs
@@ -124,6 +124,7 @@ public sealed partial class JobPrototype : IPrototype
[DataField]
public bool Whitelisted;
+ // DeltaV #1418 - Allow hiding virtual jobs like the senior job prototypes
[DataField]
public bool EditorHidden;
}
diff --git a/Content.Shared/Roles/Jobs/JobComponent.cs b/Content.Shared/Roles/Jobs/JobComponent.cs
index d04d7208c0c..b7802f76813 100644
--- a/Content.Shared/Roles/Jobs/JobComponent.cs
+++ b/Content.Shared/Roles/Jobs/JobComponent.cs
@@ -11,6 +11,8 @@ public sealed partial class JobComponent : Component
{
[DataField(required: true), AutoNetworkedField]
public ProtoId? Prototype;
+
+ // DeltaV #1418 - Inherit job prototype information from a loadout-specified ID
[DataField]
public JobComponent? VirtualJob;
}
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index 8b8f043a7cb..d7235330986 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -39,7 +39,7 @@ private void SetupTrackerLookup()
// This breaks if you have N trackers to 1 JobId but future concern.
foreach (var job in _protoManager.EnumeratePrototypes())
{
- if (_inverseTrackerLookup.ContainsKey(job.PlayTimeTracker)) continue; // DeltaV - we have N trackers to 1 JobId... (senior job names)
+ if (_inverseTrackerLookup.ContainsKey(job.PlayTimeTracker)) continue; // DeltaV #1418 - we have N trackers to 1 JobId... (senior job prototypes)
_inverseTrackerLookup.Add(job.PlayTimeTracker, job.ID);
}
@@ -120,6 +120,7 @@ public bool MindTryGetJob(
_prototypes.TryIndex(comp.Prototype, out prototype);
}
+ // DeltaV #1418 - lazy copy paste, nothing ground-breaking
public bool MindTryGetVirtualJob( // DeltaV - Senior ID cards
[NotNullWhen(true)] EntityUid? mindId,
[NotNullWhen(true)] out JobComponent? comp,
@@ -132,6 +133,7 @@ public bool MindTryGetVirtualJob( // DeltaV - Senior ID cards
comp.VirtualJob != null &&
_prototypes.TryIndex(comp.VirtualJob.Prototype, out virtualJob);
}
+ // End of DeltaV code
public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId? job)
{
@@ -151,6 +153,7 @@ public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId
public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string name)
{
+ // DeltaV #1418 - Try to get the VirtualJob, and return if we don't have an actual job
MindTryGetVirtualJob(mindId, out _, out var virtualJob);
if (!MindTryGetJob(mindId, out _, out var prototype))
{
@@ -164,6 +167,7 @@ public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string
Log.Debug(name);
return true;
+ // End of DeltaV code
}
///
diff --git a/Resources/Locale/en-US/job/job-names.ftl b/Resources/Locale/en-US/job/job-names.ftl
index f5a5f341e5c..645a05578fb 100644
--- a/Resources/Locale/en-US/job/job-names.ftl
+++ b/Resources/Locale/en-US/job/job-names.ftl
@@ -47,7 +47,7 @@ job-name-ertjanitor = ERT Janitor
job-name-boxer = Boxer
job-name-zookeeper = Zookeeper
job-name-visitor = Visitor
-# DeltaV - Define senior job names for use in separate prototypes
+# DeltaV #1418 - Define senior job names for use in job prototypes
job-name-seniorengineer = Senior Engineer
job-name-seniorphysician = Senior Physician
job-name-seniorresearcher = Senior Researcher
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index 6c7d02ad53c..1b29c7dc7e1 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -822,8 +822,8 @@
layers:
- state: default
- state: idseniorengineer
- - type: PresetIdCard # DeltaV - Change senior job titles
- job: SeniorEngineer
+ - type: PresetIdCard
+ job: SeniorEngineer # DeltaV #1418 - Change senior job titles
- type: entity
parent: ResearchIDCard
@@ -834,8 +834,8 @@
layers:
- state: default
- state: idseniorresearcher
- - type: PresetIdCard # DeltaV - Change senior job titles
- job: SeniorResearcher
+ - type: PresetIdCard
+ job: SeniorResearcher # DeltaV #1418
- type: entity
parent: MedicalIDCard
@@ -846,8 +846,8 @@
layers:
- state: default
- state: idseniorphysician
- - type: PresetIdCard # DeltaV - Change senior job titles
- job: SeniorPhysician
+ - type: PresetIdCard
+ job: SeniorPhysician # DeltaV #1418
- type: entity
parent: SecurityIDCard
@@ -858,8 +858,8 @@
layers:
- state: default
- state: idseniorofficer
- - type: PresetIdCard # DeltaV - Change senior job titles
- job: SeniorOfficer
+ - type: PresetIdCard
+ job: SeniorOfficer # DeltaV #1418
- type: entity
parent: IDCardStandard
diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
index 306d5380147..8d7a4f85cc4 100644
--- a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
@@ -25,10 +25,10 @@
belt: ClothingBeltUtilityEngineering
ears: ClothingHeadsetEngineering
-# DeltaV - Define senior job names as separate prototypes
+# DeltaV #1418 - Define senior job names as separate prototypes
- type: job
id: SeniorEngineer
- #parent: StationEngineer # unfortunately parent-child relationships don't seem to work here :blunt:
+ #parent: StationEngineer # So sad parent-child relationships don't seem to work here
editorHidden: true
name: job-name-seniorengineer
description: job-description-engineer
diff --git a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
index 765bd00953e..f2b4d3ad90a 100644
--- a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
+++ b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
@@ -23,9 +23,10 @@
ears: ClothingHeadsetMedical
belt: ClothingBeltMedicalFilled
+# DeltaV #1418 - Define senior job names as separate prototypes
- type: job
id: SeniorPhysician
- #parent: MedicalDoctor
+ #parent: MedicalDoctor # So sad parent-child relationships don't seem to work here
editorHidden: true
name: job-name-seniorphysician
description: job-description-doctor
diff --git a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
index dba8ad58ce5..fc1ccf3e270 100644
--- a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
+++ b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
@@ -20,10 +20,10 @@
equipment:
ears: ClothingHeadsetScience
-
+# DeltaV #1418 - Define senior job names as separate prototypes
- type: job
id: SeniorResearcher
- #parent: Scientist
+ #parent: Scientist # So sad parent-child relationships don't seem to work here
editorHidden: true
name: job-name-seniorresearcher
description: job-description-scientist
diff --git a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
index 4904a07217b..d1c503f7120 100644
--- a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
@@ -29,9 +29,10 @@
ears: ClothingHeadsetSecurity
pocket1: WeaponPistolMk58Nonlethal
+# DeltaV #1418 - Define senior job names as separate prototypes
- type: job
id: SeniorOfficer
- #parent: SecurityOfficer
+ #parent: SecurityOfficer # So sad parent-child relationships don't seem to work here
editorHidden: true
name: job-name-seniorofficer
description: job-description-security
diff --git a/Resources/Prototypes/Roles/Jobs/departments.yml b/Resources/Prototypes/Roles/Jobs/departments.yml
index 4393cf8af5c..5b7f571f917 100644
--- a/Resources/Prototypes/Roles/Jobs/departments.yml
+++ b/Resources/Prototypes/Roles/Jobs/departments.yml
@@ -63,7 +63,7 @@
- ChiefEngineer
- StationEngineer
- TechnicalAssistant
- - SeniorEngineer # DeltaV - Senior ID cards
+ - SeniorEngineer # DeltaV #1418 - Senior ID cards
- type: department
id: Medical
@@ -77,7 +77,7 @@
- Psychologist
- Paramedic
- MedicalBorg # Delta V - Medical Borg, see Resources/Prototypes/DeltaV/Roles/Jobs/Medical/medicalborg.yml
- - SeniorPhysician # DeltaV - Senior ID cards
+ - SeniorPhysician # DeltaV #1418 - Senior ID cards
- type: department
id: Security
@@ -92,7 +92,7 @@
- Warden
- PrisonGuard # Nyanotrasen - PrisonGuard, see Resources/Prototypes/Nyanotrasen/Roles/Jobs/Security/prisonguard.yml
- Brigmedic # DeltaV - Brigmedic, see Resources/Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml
- - SeniorOfficer # DeltaV - Senior ID cards
+ - SeniorOfficer # DeltaV #1418 - Senior ID cards
- type: department
id: Epistemics # DeltaV - Epistemics Department replacing Science
@@ -104,7 +104,7 @@
- ResearchAssistant
- Chaplain # DeltaV - Move Chaplain into Epistemics
- ForensicMantis # Nyanotrasen - ForensicMantis, see Resources/Prototypes/Nyanotrasen/Roles/Jobs/Epistemics/forensicmantis.yml
- - SeniorResearcher # DeltaV - Senior ID cards
+ - SeniorResearcher # DeltaV #1418 - Senior ID cards
- type: department
id: Specific
From 4c05520edac88bf59ad467d4ac60097267075122 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:11:58 +1000
Subject: [PATCH 09/23] remove virtual job prototypes
---
.../Access/Systems/PresetIdCardSystem.cs | 5 +--
.../GameTicking/GameTicker.Spawning.cs | 32 ++++++-----------
.../Station/Systems/StationSpawningSystem.cs | 16 +++++----
.../Systems/StationRecordsSystem.cs | 22 ++++++------
Content.Shared/Roles/JobPrototype.cs | 4 ---
Content.Shared/Roles/Jobs/JobComponent.cs | 5 +--
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 35 +++----------------
Resources/Locale/en-US/job/job-names.ftl | 5 ---
.../Objects/Misc/identification_cards.yml | 12 ++++---
.../Jobs/Engineering/station_engineer.yml | 2 +-
.../Jobs/Engineering/station_engineer.yml | 25 +------------
.../Roles/Jobs/Medical/medical_doctor.yml | 24 +------------
.../Roles/Jobs/Science/scientist.yml | 22 +-----------
.../Roles/Jobs/Security/security_officer.yml | 26 +-------------
.../Prototypes/Roles/Jobs/departments.yml | 4 ---
15 files changed, 55 insertions(+), 184 deletions(-)
diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs
index 719d61b356a..345d59e106e 100644
--- a/Content.Server/Access/Systems/PresetIdCardSystem.cs
+++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs
@@ -78,10 +78,11 @@ private void SetupIdAccess(EntityUid uid, PresetIdCardComponent id, bool extende
_accessSystem.SetAccessToJob(uid, job, extended);
- _cardSystem.TryChangeJobTitle(uid, job.LocalizedName);
+ _cardSystem.TryChangeJobTitle(uid, id.VirtualJobName ?? job.LocalizedName);
_cardSystem.TryChangeJobDepartment(uid, job);
+ _prototypeManager.TryIndex(id.virtualJobIcon ?? string.Empty, out var virtualJobIcon);
if (_prototypeManager.TryIndex(job.Icon, out var jobIcon))
- _cardSystem.TryChangeJobIcon(uid, jobIcon);
+ _cardSystem.TryChangeJobIcon(uid, virtualJobIcon ?? jobIcon);
}
}
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index c842db1c005..f1543798899 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -235,13 +235,10 @@ private void SpawnPlayer(ICommonSession player,
var job = new JobComponent {Prototype = jobId};
// DeltaV #1418 - Loadout stuff to get Senior ID
// We don't want to inherit everything, so we store the job component in a VirtualJob
- do
- {
- var jobLoadout = LoadoutSystem.GetJobPrototype(jobPrototype.ID);
-
- if (!_prototypeManager.TryIndex(jobLoadout, out RoleLoadoutPrototype? roleProto))
- break;
+ var jobLoadout = LoadoutSystem.GetJobPrototype(jobPrototype.ID);
+ if (_prototypeManager.TryIndex(jobLoadout, out RoleLoadoutPrototype? roleProto))
+ {
RoleLoadout? loadout = null;
character.Loadouts.TryGetValue(jobLoadout, out loadout);
@@ -253,15 +250,15 @@ private void SpawnPlayer(ICommonSession player,
}
// Get the ID
- if (GetVirtualJobFromRoleLoadout(loadout, roleProto, character, out var virtualJobId) && _prototypeManager.TryIndex(virtualJobId, out var virtualJobProto))
+ if (GetPresetIdFromLoadout(loadout, roleProto, character, out var presetId))
{
- job.VirtualJob = new JobComponent {Prototype = virtualJobProto};
+ job.VirtualJobName = presetId?.VirtualJobName;
+ job.VirtualJobIcon = presetId?.virtualJobIcon;
}
}
- while (false);
// End of DeltaV code
_roles.MindAddRole(newMind, job, silent: silent);
- var jobName = _jobs.MindTryGetJobName(newMind);
+ var jobName = job.VirtualJobName ?? _jobs.MindTryGetJobName(newMind);
_playTimeTrackings.PlayerRolesChanged(player);
@@ -347,10 +344,9 @@ private void SpawnPlayer(ICommonSession player,
}
// DeltaV #1418 - Go through loadout items to find ID card and its attached job
- private bool GetVirtualJobFromRoleLoadout(RoleLoadout loadout, RoleLoadoutPrototype roleProto, HumanoidCharacterProfile character, out ProtoId? virtualJob)
+ private bool GetPresetIdFromLoadout(RoleLoadout loadout, RoleLoadoutPrototype roleProto, HumanoidCharacterProfile character, out PresetIdCardComponent? presetId)
{
- virtualJob = null;
-
+ presetId = null;
// Use to read job loadout and find an ID card
foreach (var group in loadout.SelectedLoadouts.OrderBy(x => roleProto.Groups.FindIndex(e => e == x.Key)))
{
@@ -388,14 +384,8 @@ private bool GetVirtualJobFromRoleLoadout(RoleLoadout loadout, RoleLoadoutProtot
continue;
}
- ProtoId jobProtoId = idComponent.JobName ?? string.Empty;
- if (jobProtoId == string.Empty)
- {
- Log.Warning($"Empty jobProtoId!");
- return false;
- }
- virtualJob = jobProtoId;
- Log.Debug($"Successfully outputted {virtualJob} from {idProto}");
+ presetId = idComponent;
+ Log.Debug($"Successfully outputted {presetId} from {idProto}");
return true;
}
}
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index 0b9427e66f4..773aeafa712 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -30,6 +30,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
+using Content.Server.Database;
namespace Content.Server.Station.Systems;
@@ -144,7 +145,6 @@ public EntityUid SpawnPlayerMob(
EntityUid? entity = null)
{
_prototypeManager.TryIndex(job?.Prototype ?? string.Empty, out var prototype);
- _prototypeManager.TryIndex(job?.VirtualJob?.Prototype ?? string.Empty, out var virtualJobPrototype); // DeltaV #1418 - Get the VirtualJob too
// If we're not spawning a humanoid, we're gonna exit early without doing all the humanoid stuff.
if (prototype?.JobEntity != null)
@@ -212,8 +212,8 @@ public EntityUid SpawnPlayerMob(
if (profile != null)
{
- if (prototype != null)
- SetPdaAndIdCardData(entity.Value, profile.Name, virtualJobPrototype ?? prototype, station); // DeltaV #1418 - Inherit job data from a VirtualJob if one exists
+ if (job != null)
+ SetPdaAndIdCardData(entity.Value, profile.Name, job, station); // DeltaV #1418 - Inherit job data from a VirtualJob if one exists
_humanoidSystem.LoadProfile(entity.Value, profile);
_metaSystem.SetEntityName(entity.Value, profile.Name);
@@ -246,8 +246,11 @@ private void DoJobSpecials(JobComponent? job, EntityUid entity)
/// Character name to use for the ID.
/// Job prototype to use for the PDA and ID.
/// The station this player is being spawned on.
- public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobPrototype jobPrototype, EntityUid? station)
+ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobComponent job, EntityUid? station)
{
+ if (!_prototypeManager.TryIndex(job.Prototype, out var jobPrototype))
+ return;
+
if (!InventorySystem.TryGetSlotEntity(entity, "id", out var idUid))
return;
@@ -259,10 +262,11 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobProto
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
- _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card);
+ _cardSystem.TryChangeJobTitle(cardId, job.VirtualJobName ?? jobPrototype.LocalizedName, card);
+ _prototypeManager.TryIndex(job.VirtualJobIcon ?? string.Empty, out var virtualJobIcon);
if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
- _cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
+ _cardSystem.TryChangeJobIcon(cardId, virtualJobIcon ?? jobIcon, card);
var extendedAccess = false;
if (station != null)
diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
index ffe97963e38..d0bb238e6bf 100644
--- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
+++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
@@ -57,15 +57,12 @@ private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCh
JobComponent? job, StationRecordsComponent records) // DeltaV #1418
{
// DeltaV #1418 - Inherit from VirtualJob if possible
- _prototypeManager.TryIndex(job?.VirtualJob?.Prototype, out var a);
- if (!_prototypeManager.TryIndex(job?.Prototype, out var b))
+ if (!_prototypeManager.TryIndex(job?.Prototype, out var jobProto))
return;
-
- ProtoId jobId = a?.ID ?? b.ID;
- // TODO make PlayerSpawnCompleteEvent.JobId a ProtoId // DeltaV #1418 - :blunt:
// End of DeltaV code
- if (string.IsNullOrEmpty(jobId)
- || !_prototypeManager.HasIndex(jobId))
+
+ if (string.IsNullOrEmpty(job?.Prototype)
+ || !_prototypeManager.HasIndex(jobProto))
return;
if (!_inventory.TryGetSlotEntity(player, "id", out var idUid))
@@ -74,7 +71,7 @@ private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCh
TryComp(player, out var fingerprintComponent);
TryComp(player, out var dnaComponent);
- CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, jobId, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records);
+ CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, job, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records);
}
@@ -112,13 +109,14 @@ public void CreateGeneralRecord(
int age,
string species,
Gender gender,
- string jobId,
+ JobComponent job,
string? mobFingerprint,
string? dna,
HumanoidCharacterProfile profile,
StationRecordsComponent records)
{
- if (!_prototypeManager.TryIndex(jobId, out var jobPrototype))
+ string? jobId = job.Prototype;
+ if (string.IsNullOrEmpty(jobId) || !_prototypeManager.TryIndex(job.Prototype, out var jobPrototype))
throw new ArgumentException($"Invalid job prototype ID: {jobId}");
// when adding a record that already exists use the old one
@@ -133,8 +131,8 @@ public void CreateGeneralRecord(
{
Name = name,
Age = age,
- JobTitle = jobPrototype.LocalizedName,
- JobIcon = jobPrototype.Icon,
+ JobTitle = job.VirtualJobName ?? jobPrototype.LocalizedName,
+ JobIcon = job.VirtualJobIcon ?? jobPrototype.Icon,
JobPrototype = jobId,
Species = species,
Gender = gender,
diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs
index eafc1c21c79..71bd41c89fb 100644
--- a/Content.Shared/Roles/JobPrototype.cs
+++ b/Content.Shared/Roles/JobPrototype.cs
@@ -123,10 +123,6 @@ public sealed partial class JobPrototype : IPrototype
[DataField]
public bool Whitelisted;
-
- // DeltaV #1418 - Allow hiding virtual jobs like the senior job prototypes
- [DataField]
- public bool EditorHidden;
}
///
diff --git a/Content.Shared/Roles/Jobs/JobComponent.cs b/Content.Shared/Roles/Jobs/JobComponent.cs
index b7802f76813..63a3bbec4a6 100644
--- a/Content.Shared/Roles/Jobs/JobComponent.cs
+++ b/Content.Shared/Roles/Jobs/JobComponent.cs
@@ -12,7 +12,8 @@ public sealed partial class JobComponent : Component
[DataField(required: true), AutoNetworkedField]
public ProtoId? Prototype;
- // DeltaV #1418 - Inherit job prototype information from a loadout-specified ID
[DataField]
- public JobComponent? VirtualJob;
+ public string? VirtualJobName;
+ [DataField]
+ public string? VirtualJobIcon;
}
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index d7235330986..325d84c5f3a 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -39,8 +39,6 @@ private void SetupTrackerLookup()
// This breaks if you have N trackers to 1 JobId but future concern.
foreach (var job in _protoManager.EnumeratePrototypes())
{
- if (_inverseTrackerLookup.ContainsKey(job.PlayTimeTracker)) continue; // DeltaV #1418 - we have N trackers to 1 JobId... (senior job prototypes)
-
_inverseTrackerLookup.Add(job.PlayTimeTracker, job.ID);
}
}
@@ -120,21 +118,6 @@ public bool MindTryGetJob(
_prototypes.TryIndex(comp.Prototype, out prototype);
}
- // DeltaV #1418 - lazy copy paste, nothing ground-breaking
- public bool MindTryGetVirtualJob( // DeltaV - Senior ID cards
- [NotNullWhen(true)] EntityUid? mindId,
- [NotNullWhen(true)] out JobComponent? comp,
- [NotNullWhen(true)] out JobPrototype? virtualJob)
- {
- comp = null;
- virtualJob = null;
-
- return TryComp(mindId, out comp) &&
- comp.VirtualJob != null &&
- _prototypes.TryIndex(comp.VirtualJob.Prototype, out virtualJob);
- }
- // End of DeltaV code
-
public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId? job)
{
if (!TryComp(mindId, out JobComponent? comp))
@@ -153,21 +136,13 @@ public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId
public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string name)
{
- // DeltaV #1418 - Try to get the VirtualJob, and return if we don't have an actual job
- MindTryGetVirtualJob(mindId, out _, out var virtualJob);
- if (!MindTryGetJob(mindId, out _, out var prototype))
+ if (MindTryGetJob(mindId, out _, out var prototype))
{
- name = Loc.GetString("generic-unknown-title");
- return false;
- }
-
- name = virtualJob?.LocalizedName ?? string.Empty;
- if (string.IsNullOrEmpty(name))
name = prototype.LocalizedName;
-
- Log.Debug(name);
- return true;
- // End of DeltaV code
+ return true;
+ }
+ name = Loc.GetString("generic-unknown-title");
+ return false;
}
///
diff --git a/Resources/Locale/en-US/job/job-names.ftl b/Resources/Locale/en-US/job/job-names.ftl
index 645a05578fb..4b7b5ccc421 100644
--- a/Resources/Locale/en-US/job/job-names.ftl
+++ b/Resources/Locale/en-US/job/job-names.ftl
@@ -47,11 +47,6 @@ job-name-ertjanitor = ERT Janitor
job-name-boxer = Boxer
job-name-zookeeper = Zookeeper
job-name-visitor = Visitor
-# DeltaV #1418 - Define senior job names for use in job prototypes
-job-name-seniorengineer = Senior Engineer
-job-name-seniorphysician = Senior Physician
-job-name-seniorresearcher = Senior Researcher
-job-name-seniorofficer = Senior Officer
# Role timers - Make these alphabetical or I cut you
JobAtmosphericTechnician = Atmospheric Technician
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index 1b29c7dc7e1..cf5c3fca5ae 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -823,7 +823,8 @@
- state: default
- state: idseniorengineer
- type: PresetIdCard
- job: SeniorEngineer # DeltaV #1418 - Change senior job titles
+ virtualJobName: "Senior Engineer"
+ virtualJobIcon: "JobIconSeniorEngineer"
- type: entity
parent: ResearchIDCard
@@ -835,7 +836,8 @@
- state: default
- state: idseniorresearcher
- type: PresetIdCard
- job: SeniorResearcher # DeltaV #1418
+ virtualJobName: "Senior Researcher"
+ virtualJobIcon: "JobIconSeniorResearcher"
- type: entity
parent: MedicalIDCard
@@ -847,7 +849,8 @@
- state: default
- state: idseniorphysician
- type: PresetIdCard
- job: SeniorPhysician # DeltaV #1418
+ virtualJobName: "Senior Physician"
+ virtualJobIcon: "JobIconSeniorPhysician"
- type: entity
parent: SecurityIDCard
@@ -859,7 +862,8 @@
- state: default
- state: idseniorofficer
- type: PresetIdCard
- job: SeniorOfficer # DeltaV #1418
+ virtualJobName: "Senior Officer"
+ virtualJobIcon: "JobIconSeniorOfficer"
- type: entity
parent: IDCardStandard
diff --git a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
index b314bebe888..298f63a3f89 100644
--- a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
@@ -16,7 +16,7 @@
requirement:
!type:DepartmentTimeRequirement
department: Engineering
- time: 216000 # 60 hrs
+ time: 0 #216000 # 60 hrs
# Head
diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
index 8d7a4f85cc4..992b7c7ad72 100644
--- a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
@@ -23,27 +23,4 @@
equipment:
eyes: ClothingEyesGlassesMeson
belt: ClothingBeltUtilityEngineering
- ears: ClothingHeadsetEngineering
-
-# DeltaV #1418 - Define senior job names as separate prototypes
-- type: job
- id: SeniorEngineer
- #parent: StationEngineer # So sad parent-child relationships don't seem to work here
- editorHidden: true
- name: job-name-seniorengineer
- description: job-description-engineer
- playTimeTracker: JobStationEngineer
- antagAdvantage: 3
- requirements:
- - !type:DepartmentTimeRequirement
- department: Engineering
- time: 216000 # 60 hrs
- startingGear: StationEngineerGear
- icon: "JobIconSeniorEngineer"
- supervisors: job-supervisors-ce
- access:
- - Maintenance
- - Engineering
- - External
- extendedAccess:
- - Atmospherics
\ No newline at end of file
+ ears: ClothingHeadsetEngineering
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
index f2b4d3ad90a..f4ed3c4ec0e 100644
--- a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
+++ b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
@@ -21,26 +21,4 @@
id: DoctorGear
equipment:
ears: ClothingHeadsetMedical
- belt: ClothingBeltMedicalFilled
-
-# DeltaV #1418 - Define senior job names as separate prototypes
-- type: job
- id: SeniorPhysician
- #parent: MedicalDoctor # So sad parent-child relationships don't seem to work here
- editorHidden: true
- name: job-name-seniorphysician
- description: job-description-doctor
- playTimeTracker: JobMedicalDoctor
- requirements:
- - !type:DepartmentTimeRequirement
- department: Medical
- time: 216000 # 60 hrs
- startingGear: DoctorGear
- icon: "JobIconSeniorPhysician"
- supervisors: job-supervisors-cmo
- access:
- - Medical
- - Maintenance
- extendedAccess:
- - Chemistry
- - Paramedic
\ No newline at end of file
+ belt: ClothingBeltMedicalFilled
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
index fc1ccf3e270..f27c4d580ab 100644
--- a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
+++ b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
@@ -18,24 +18,4 @@
- type: startingGear
id: ScientistGear
equipment:
- ears: ClothingHeadsetScience
-
-# DeltaV #1418 - Define senior job names as separate prototypes
-- type: job
- id: SeniorResearcher
- #parent: Scientist # So sad parent-child relationships don't seem to work here
- editorHidden: true
- name: job-name-seniorresearcher
- description: job-description-scientist
- playTimeTracker: JobScientist
- antagAdvantage: 2
- requirements:
- - !type:DepartmentTimeRequirement
- department: Epistemics # DeltaV - Epistemics Department replacing Science
- time: 216000 # 60 hrs
- startingGear: ScientistGear
- icon: "JobIconSeniorResearcher"
- supervisors: job-supervisors-rd
- access:
- - Research
- - Maintenance
\ No newline at end of file
+ ears: ClothingHeadsetScience
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
index d1c503f7120..5a37fe77b24 100644
--- a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
@@ -27,28 +27,4 @@
equipment:
eyes: ClothingEyesGlassesSecurity
ears: ClothingHeadsetSecurity
- pocket1: WeaponPistolMk58Nonlethal
-
-# DeltaV #1418 - Define senior job names as separate prototypes
-- type: job
- id: SeniorOfficer
- #parent: SecurityOfficer # So sad parent-child relationships don't seem to work here
- editorHidden: true
- name: job-name-seniorofficer
- description: job-description-security
- playTimeTracker: JobSecurityOfficer
- requirements:
- - !type:DepartmentTimeRequirement
- department: Security
- time: 216000 # 60 hrs
- startingGear: SecurityOfficerGear
- icon: "JobIconSeniorOfficer"
- supervisors: job-supervisors-hos
- canBeAntag: false
- access:
- - Security
- - Maintenance
- - External
- special:
- - !type:AddImplantSpecial
- implants: [ MindShieldImplant ]
\ No newline at end of file
+ pocket1: WeaponPistolMk58Nonlethal
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/departments.yml b/Resources/Prototypes/Roles/Jobs/departments.yml
index 5b7f571f917..5512fb2b330 100644
--- a/Resources/Prototypes/Roles/Jobs/departments.yml
+++ b/Resources/Prototypes/Roles/Jobs/departments.yml
@@ -63,7 +63,6 @@
- ChiefEngineer
- StationEngineer
- TechnicalAssistant
- - SeniorEngineer # DeltaV #1418 - Senior ID cards
- type: department
id: Medical
@@ -77,7 +76,6 @@
- Psychologist
- Paramedic
- MedicalBorg # Delta V - Medical Borg, see Resources/Prototypes/DeltaV/Roles/Jobs/Medical/medicalborg.yml
- - SeniorPhysician # DeltaV #1418 - Senior ID cards
- type: department
id: Security
@@ -92,7 +90,6 @@
- Warden
- PrisonGuard # Nyanotrasen - PrisonGuard, see Resources/Prototypes/Nyanotrasen/Roles/Jobs/Security/prisonguard.yml
- Brigmedic # DeltaV - Brigmedic, see Resources/Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml
- - SeniorOfficer # DeltaV #1418 - Senior ID cards
- type: department
id: Epistemics # DeltaV - Epistemics Department replacing Science
@@ -104,7 +101,6 @@
- ResearchAssistant
- Chaplain # DeltaV - Move Chaplain into Epistemics
- ForensicMantis # Nyanotrasen - ForensicMantis, see Resources/Prototypes/Nyanotrasen/Roles/Jobs/Epistemics/forensicmantis.yml
- - SeniorResearcher # DeltaV #1418 - Senior ID cards
- type: department
id: Specific
From 39ba454813d3b5196f05b7f92a7153c7f6434d80 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:12:17 +1000
Subject: [PATCH 10/23] these changes were not staged
---
.../Lobby/UI/HumanoidProfileEditor.xaml.cs | 4 ----
.../Access/Components/PresetIdCardComponent.cs | 12 ++++++++++++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
index 5b6cbf46283..ec4701dbe31 100644
--- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
+++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
@@ -851,10 +851,6 @@ public void RefreshJobs()
foreach (var job in jobs)
{
- // DeltaV #1418 - Allow hiding jobs to hide senior virtual jobs
- if (job.EditorHidden)
- continue;
-
var jobContainer = new BoxContainer()
{
Orientation = LayoutOrientation.Horizontal,
diff --git a/Content.Server/Access/Components/PresetIdCardComponent.cs b/Content.Server/Access/Components/PresetIdCardComponent.cs
index 94aef2e6ca0..5ce42c08aab 100644
--- a/Content.Server/Access/Components/PresetIdCardComponent.cs
+++ b/Content.Server/Access/Components/PresetIdCardComponent.cs
@@ -11,4 +11,16 @@ public sealed partial class PresetIdCardComponent : Component
[DataField("name")]
public string? IdName;
+
+ ///
+ /// DeltaV: Allow changing the job title, even if it'd be otherwise set by the JobPrototype
+ ///
+ [DataField("virtualJobName")]
+ public string? VirtualJobName;
+
+ ///
+ /// DeltaV: Allow changing the job icon, even if it'd be otherwise set by the JobPrototype
+ ///
+ [DataField("virtualJobIcon")]
+ public string? virtualJobIcon;
}
From afd4fed2b22a9594adf0e54954f644d8b98586b7 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:16:48 +1000
Subject: [PATCH 11/23] remove whitespace diff
---
.../Prototypes/Roles/Jobs/Engineering/station_engineer.yml | 3 ++-
Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml | 2 +-
Resources/Prototypes/Roles/Jobs/Science/scientist.yml | 2 +-
Resources/Prototypes/Roles/Jobs/Security/security_officer.yml | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
index 992b7c7ad72..0f201744a79 100644
--- a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
@@ -23,4 +23,5 @@
equipment:
eyes: ClothingEyesGlassesMeson
belt: ClothingBeltUtilityEngineering
- ears: ClothingHeadsetEngineering
\ No newline at end of file
+ ears: ClothingHeadsetEngineering
+
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
index f4ed3c4ec0e..daed73984fe 100644
--- a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
+++ b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml
@@ -21,4 +21,4 @@
id: DoctorGear
equipment:
ears: ClothingHeadsetMedical
- belt: ClothingBeltMedicalFilled
\ No newline at end of file
+ belt: ClothingBeltMedicalFilled
diff --git a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
index f27c4d580ab..93ef0019689 100644
--- a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
+++ b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
@@ -18,4 +18,4 @@
- type: startingGear
id: ScientistGear
equipment:
- ears: ClothingHeadsetScience
\ No newline at end of file
+ ears: ClothingHeadsetScience
diff --git a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
index 5a37fe77b24..6de806f7189 100644
--- a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml
@@ -27,4 +27,4 @@
equipment:
eyes: ClothingEyesGlassesSecurity
ears: ClothingHeadsetSecurity
- pocket1: WeaponPistolMk58Nonlethal
\ No newline at end of file
+ pocket1: WeaponPistolMk58Nonlethal
From c288781b05ec776d163f9431ea7a18338adfb3e5 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:20:50 +1000
Subject: [PATCH 12/23] remove whitespace diff again and revert test change
---
.../Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml | 2 +-
.../Prototypes/Roles/Jobs/Engineering/station_engineer.yml | 3 +--
Resources/Prototypes/Roles/Jobs/Science/scientist.yml | 1 +
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
index 298f63a3f89..b314bebe888 100644
--- a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml
@@ -16,7 +16,7 @@
requirement:
!type:DepartmentTimeRequirement
department: Engineering
- time: 0 #216000 # 60 hrs
+ time: 216000 # 60 hrs
# Head
diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
index 0f201744a79..992b7c7ad72 100644
--- a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
@@ -23,5 +23,4 @@
equipment:
eyes: ClothingEyesGlassesMeson
belt: ClothingBeltUtilityEngineering
- ears: ClothingHeadsetEngineering
-
\ No newline at end of file
+ ears: ClothingHeadsetEngineering
\ No newline at end of file
diff --git a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
index 93ef0019689..b005accc79f 100644
--- a/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
+++ b/Resources/Prototypes/Roles/Jobs/Science/scientist.yml
@@ -19,3 +19,4 @@
id: ScientistGear
equipment:
ears: ClothingHeadsetScience
+
From 2b5c54baaa86f46c0f82fc4888ad9179c5f47741 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:22:02 +1000
Subject: [PATCH 13/23] Update station_engineer.yml
Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
---
.../Prototypes/Roles/Jobs/Engineering/station_engineer.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
index 992b7c7ad72..15aabc4ab86 100644
--- a/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
+++ b/Resources/Prototypes/Roles/Jobs/Engineering/station_engineer.yml
@@ -23,4 +23,4 @@
equipment:
eyes: ClothingEyesGlassesMeson
belt: ClothingBeltUtilityEngineering
- ears: ClothingHeadsetEngineering
\ No newline at end of file
+ ears: ClothingHeadsetEngineering
From 81b07fd8bbedbe0cf5443c7d19e47405f3baa5e3 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:22:52 +1000
Subject: [PATCH 14/23] Update SharedJobSystem.cs
Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
---
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index 325d84c5f3a..ce4428d9fea 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -141,6 +141,7 @@ public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string
name = prototype.LocalizedName;
return true;
}
+
name = Loc.GetString("generic-unknown-title");
return false;
}
From e07f6480fb279ae0e100e41101f5b5d34a8dc35c Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:27:07 +1000
Subject: [PATCH 15/23] fix capitalisation typo
---
Content.Server/Access/Components/PresetIdCardComponent.cs | 2 +-
Content.Server/Access/Systems/PresetIdCardSystem.cs | 2 +-
Content.Server/GameTicking/GameTicker.Spawning.cs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Content.Server/Access/Components/PresetIdCardComponent.cs b/Content.Server/Access/Components/PresetIdCardComponent.cs
index 5ce42c08aab..181757c6c02 100644
--- a/Content.Server/Access/Components/PresetIdCardComponent.cs
+++ b/Content.Server/Access/Components/PresetIdCardComponent.cs
@@ -22,5 +22,5 @@ public sealed partial class PresetIdCardComponent : Component
/// DeltaV: Allow changing the job icon, even if it'd be otherwise set by the JobPrototype
///
[DataField("virtualJobIcon")]
- public string? virtualJobIcon;
+ public string? VirtualJobIcon;
}
diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs
index 345d59e106e..d8ca0ec4642 100644
--- a/Content.Server/Access/Systems/PresetIdCardSystem.cs
+++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs
@@ -81,7 +81,7 @@ private void SetupIdAccess(EntityUid uid, PresetIdCardComponent id, bool extende
_cardSystem.TryChangeJobTitle(uid, id.VirtualJobName ?? job.LocalizedName);
_cardSystem.TryChangeJobDepartment(uid, job);
- _prototypeManager.TryIndex(id.virtualJobIcon ?? string.Empty, out var virtualJobIcon);
+ _prototypeManager.TryIndex(id.VirtualJobIcon ?? string.Empty, out var virtualJobIcon);
if (_prototypeManager.TryIndex(job.Icon, out var jobIcon))
_cardSystem.TryChangeJobIcon(uid, virtualJobIcon ?? jobIcon);
}
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index f1543798899..84129d3e61e 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -253,7 +253,7 @@ private void SpawnPlayer(ICommonSession player,
if (GetPresetIdFromLoadout(loadout, roleProto, character, out var presetId))
{
job.VirtualJobName = presetId?.VirtualJobName;
- job.VirtualJobIcon = presetId?.virtualJobIcon;
+ job.VirtualJobIcon = presetId?.VirtualJobIcon;
}
}
// End of DeltaV code
From ef87325d8cffdbba5b5b20fdc5e8cd2436b2e246 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 14:53:25 +1000
Subject: [PATCH 16/23] consolidate comments and dependencies, also change Mind
to use VirtualJobName
---
.../Components/PresetIdCardComponent.cs | 2 +-
.../Access/Systems/PresetIdCardSystem.cs | 4 +++-
.../GameTicking/GameTicker.Spawning.cs | 23 ++++++++-----------
.../Station/Systems/StationSpawningSystem.cs | 11 ++++-----
.../Systems/StationRecordsSystem.cs | 15 ++++++------
Content.Shared/Roles/Jobs/JobComponent.cs | 2 ++
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 4 ++--
.../Objects/Misc/identification_cards.yml | 8 +++----
8 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/Content.Server/Access/Components/PresetIdCardComponent.cs b/Content.Server/Access/Components/PresetIdCardComponent.cs
index 181757c6c02..18b022b6220 100644
--- a/Content.Server/Access/Components/PresetIdCardComponent.cs
+++ b/Content.Server/Access/Components/PresetIdCardComponent.cs
@@ -11,7 +11,7 @@ public sealed partial class PresetIdCardComponent : Component
[DataField("name")]
public string? IdName;
-
+
///
/// DeltaV: Allow changing the job title, even if it'd be otherwise set by the JobPrototype
///
diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs
index d8ca0ec4642..feb1d0f96a3 100644
--- a/Content.Server/Access/Systems/PresetIdCardSystem.cs
+++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs
@@ -78,11 +78,13 @@ private void SetupIdAccess(EntityUid uid, PresetIdCardComponent id, bool extende
_accessSystem.SetAccessToJob(uid, job, extended);
- _cardSystem.TryChangeJobTitle(uid, id.VirtualJobName ?? job.LocalizedName);
+ _cardSystem.TryChangeJobTitle(uid, id.VirtualJobName ?? job.LocalizedName); // DeltaV #1425 - Attempt to use virtual job information before using job information
_cardSystem.TryChangeJobDepartment(uid, job);
+ // DeltaV #1425 - Attempt to use virtual job information before using job information
_prototypeManager.TryIndex(id.VirtualJobIcon ?? string.Empty, out var virtualJobIcon);
if (_prototypeManager.TryIndex(job.Icon, out var jobIcon))
_cardSystem.TryChangeJobIcon(uid, virtualJobIcon ?? jobIcon);
+ // End of DeltaV code
}
}
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index 84129d3e61e..514a8ffa99f 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -7,6 +7,7 @@
using Content.Server.Spawners.Components;
using Content.Server.Speech.Components;
using Content.Server.Station.Components;
+using Content.Server.Access.Components;
using Content.Shared.Database;
using Content.Shared.Mind;
using Content.Shared.Players;
@@ -15,7 +16,7 @@
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Content.Shared.Clothing;
-using Content.Shared.Access.Components;
+using Content.Shared.PDA;
using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
@@ -24,12 +25,6 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
-using Microsoft.CodeAnalysis;
-using Content.Shared.PDA;
-using FastAccessors;
-using Content.Server.Access.Components;
-using Content.Shared.Destructible;
-
namespace Content.Server.GameTicking
{
public sealed partial class GameTicker
@@ -233,8 +228,8 @@ private void SpawnPlayer(ICommonSession player,
var jobPrototype = _prototypeManager.Index(jobId);
var job = new JobComponent {Prototype = jobId};
- // DeltaV #1418 - Loadout stuff to get Senior ID
- // We don't want to inherit everything, so we store the job component in a VirtualJob
+ // DeltaV #1425 - Loadout stuff to get Senior ID
+ // Get the PresetIdCardComponent and its VirtualJobName/Icon vars;
var jobLoadout = LoadoutSystem.GetJobPrototype(jobPrototype.ID);
if (_prototypeManager.TryIndex(jobLoadout, out RoleLoadoutPrototype? roleProto))
@@ -258,7 +253,7 @@ private void SpawnPlayer(ICommonSession player,
}
// End of DeltaV code
_roles.MindAddRole(newMind, job, silent: silent);
- var jobName = job.VirtualJobName ?? _jobs.MindTryGetJobName(newMind);
+ var jobName = _jobs.MindTryGetJobName(newMind);
_playTimeTrackings.PlayerRolesChanged(player);
@@ -335,7 +330,7 @@ private void SpawnPlayer(ICommonSession player,
PlayersJoinedRoundNormally++;
var aev = new PlayerSpawnCompleteEvent(mob,
player,
- job,
+ job, // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobName/Icon.
lateJoin,
PlayersJoinedRoundNormally,
station,
@@ -343,7 +338,7 @@ private void SpawnPlayer(ICommonSession player,
RaiseLocalEvent(mob, aev, true);
}
- // DeltaV #1418 - Go through loadout items to find ID card and its attached job
+ // DeltaV #1425 - Go through loadout items to find ID card and its attached job
private bool GetPresetIdFromLoadout(RoleLoadout loadout, RoleLoadoutPrototype roleProto, HumanoidCharacterProfile character, out PresetIdCardComponent? presetId)
{
presetId = null;
@@ -583,7 +578,7 @@ public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
{
public EntityUid Mob { get; }
public ICommonSession Player { get; }
- public JobComponent? Job { get; } // DeltaV #1418 - Replace JobId with Job to parse VirtualJob
+ public JobComponent? Job { get; } // DeltaV #1425 - Replace JobId with Job to parse VirtualJob
public bool LateJoin { get; }
public EntityUid Station { get; }
public HumanoidCharacterProfile Profile { get; }
@@ -593,7 +588,7 @@ public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
public PlayerSpawnCompleteEvent(EntityUid mob,
ICommonSession player,
- JobComponent? job, // DeltaV #1418
+ JobComponent? job, // DeltaV #1425
bool lateJoin,
int joinOrder,
EntityUid station,
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index 773aeafa712..13581c49f1b 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -30,7 +30,6 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
-using Content.Server.Database;
namespace Content.Server.Station.Systems;
@@ -213,7 +212,7 @@ public EntityUid SpawnPlayerMob(
if (profile != null)
{
if (job != null)
- SetPdaAndIdCardData(entity.Value, profile.Name, job, station); // DeltaV #1418 - Inherit job data from a VirtualJob if one exists
+ SetPdaAndIdCardData(entity.Value, profile.Name, job, station); // DeltaV #1425 - Inherit job data from a VirtualJob if one exists
_humanoidSystem.LoadProfile(entity.Value, profile);
_metaSystem.SetEntityName(entity.Value, profile.Name);
@@ -246,9 +245,9 @@ private void DoJobSpecials(JobComponent? job, EntityUid entity)
/// Character name to use for the ID.
/// Job prototype to use for the PDA and ID.
/// The station this player is being spawned on.
- public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobComponent job, EntityUid? station)
+ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobComponent job, EntityUid? station) // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobName/Icon
{
- if (!_prototypeManager.TryIndex(job.Prototype, out var jobPrototype))
+ if (!_prototypeManager.TryIndex(job.Prototype, out var jobPrototype)) // DeltaV #1425 - Get jobPrototype separately as a result
return;
if (!InventorySystem.TryGetSlotEntity(entity, "id", out var idUid))
@@ -262,11 +261,11 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobCompo
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
- _cardSystem.TryChangeJobTitle(cardId, job.VirtualJobName ?? jobPrototype.LocalizedName, card);
+ _cardSystem.TryChangeJobTitle(cardId, job.VirtualJobName ?? jobPrototype.LocalizedName, card); // DeltaV #1425 - Use VirtualJobName if possible
_prototypeManager.TryIndex(job.VirtualJobIcon ?? string.Empty, out var virtualJobIcon);
if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
- _cardSystem.TryChangeJobIcon(cardId, virtualJobIcon ?? jobIcon, card);
+ _cardSystem.TryChangeJobIcon(cardId, virtualJobIcon ?? jobIcon, card); // DeltaV #1425 - Use VirtualJobIcon if possible
var extendedAccess = false;
if (station != null)
diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
index d0bb238e6bf..7cb32c5584c 100644
--- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
+++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
@@ -1,4 +1,3 @@
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Content.Server.Forensics;
using Content.Server.GameTicking;
@@ -50,13 +49,13 @@ private void OnPlayerSpawn(PlayerSpawnCompleteEvent args)
if (!TryComp(args.Station, out var stationRecords))
return;
- CreateGeneralRecord(args.Station, args.Mob, args.Profile, args.Job, stationRecords); // DeltaV #1418 - JobId replaced with Job to parse VirtualJob
+ CreateGeneralRecord(args.Station, args.Mob, args.Profile, args.Job, stationRecords); // DeltaV #1425 - JobId replaced with Job to parse VirtualJob
}
private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCharacterProfile profile,
- JobComponent? job, StationRecordsComponent records) // DeltaV #1418
+ JobComponent? job, StationRecordsComponent records) // DeltaV #1425
{
- // DeltaV #1418 - Inherit from VirtualJob if possible
+ // DeltaV #1425 - Inherit from VirtualJob if possible
if (!_prototypeManager.TryIndex(job?.Prototype, out var jobProto))
return;
// End of DeltaV code
@@ -109,15 +108,17 @@ public void CreateGeneralRecord(
int age,
string species,
Gender gender,
- JobComponent job,
+ JobComponent job, // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobName/Icon
string? mobFingerprint,
string? dna,
HumanoidCharacterProfile profile,
StationRecordsComponent records)
{
+ // DeltaV #1425 - Get jobId separately as a result
string? jobId = job.Prototype;
if (string.IsNullOrEmpty(jobId) || !_prototypeManager.TryIndex(job.Prototype, out var jobPrototype))
throw new ArgumentException($"Invalid job prototype ID: {jobId}");
+ // End of DeltaV code
// when adding a record that already exists use the old one
// this happens when respawning as the same character
@@ -131,8 +132,8 @@ public void CreateGeneralRecord(
{
Name = name,
Age = age,
- JobTitle = job.VirtualJobName ?? jobPrototype.LocalizedName,
- JobIcon = job.VirtualJobIcon ?? jobPrototype.Icon,
+ JobTitle = job.VirtualJobName ?? jobPrototype.LocalizedName,// DeltaV #1425 - Use VirtualJobName if possible
+ JobIcon = job.VirtualJobIcon ?? jobPrototype.Icon, // DeltaV #1425 - Use VirtualJobIcon if possible
JobPrototype = jobId,
Species = species,
Gender = gender,
diff --git a/Content.Shared/Roles/Jobs/JobComponent.cs b/Content.Shared/Roles/Jobs/JobComponent.cs
index 63a3bbec4a6..55c8ee6cc17 100644
--- a/Content.Shared/Roles/Jobs/JobComponent.cs
+++ b/Content.Shared/Roles/Jobs/JobComponent.cs
@@ -12,8 +12,10 @@ public sealed partial class JobComponent : Component
[DataField(required: true), AutoNetworkedField]
public ProtoId? Prototype;
+ // DeltaV #1425 - Pass VirtualJobName/Icon with the JobComponent to override job information
[DataField]
public string? VirtualJobName;
[DataField]
public string? VirtualJobIcon;
+ // End of DeltaV code
}
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index ce4428d9fea..6c14cca8519 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -136,9 +136,9 @@ public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId
public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string name)
{
- if (MindTryGetJob(mindId, out _, out var prototype))
+ if (MindTryGetJob(mindId, out var comp, out var prototype))
{
- name = prototype.LocalizedName;
+ name = comp.VirtualJobName ?? prototype.LocalizedName;
return true;
}
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index cf5c3fca5ae..a0ecde7fdbc 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -822,7 +822,7 @@
layers:
- state: default
- state: idseniorengineer
- - type: PresetIdCard
+ - type: PresetIdCard # DeltaV - Change senior job titles
virtualJobName: "Senior Engineer"
virtualJobIcon: "JobIconSeniorEngineer"
@@ -835,7 +835,7 @@
layers:
- state: default
- state: idseniorresearcher
- - type: PresetIdCard
+ - type: PresetIdCard # DeltaV - Change senior job titles
virtualJobName: "Senior Researcher"
virtualJobIcon: "JobIconSeniorResearcher"
@@ -848,7 +848,7 @@
layers:
- state: default
- state: idseniorphysician
- - type: PresetIdCard
+ - type: PresetIdCard # DeltaV - Change senior job titles
virtualJobName: "Senior Physician"
virtualJobIcon: "JobIconSeniorPhysician"
@@ -861,7 +861,7 @@
layers:
- state: default
- state: idseniorofficer
- - type: PresetIdCard
+ - type: PresetIdCard # DeltaV - Change senior job titles
virtualJobName: "Senior Officer"
virtualJobIcon: "JobIconSeniorOfficer"
From 4df978b3565a8aa7416ce65da9ab01a11f8ef886 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sat, 22 Jun 2024 15:01:49 +1000
Subject: [PATCH 17/23] comment correction
---
Content.Server/GameTicking/GameTicker.Spawning.cs | 5 +++--
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index 514a8ffa99f..befa41a19f1 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -31,7 +31,7 @@ public sealed partial class GameTicker
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
- [Dependency] private readonly IComponentFactory _componentFactory = default!; // DeltaV #1418
+ [Dependency] private readonly IComponentFactory _componentFactory = default!; // DeltaV #1425
[ValidatePrototypeId]
public const string ObserverPrototypeName = "MobObserver";
@@ -387,6 +387,7 @@ private bool GetPresetIdFromLoadout(RoleLoadout loadout, RoleLoadoutPrototype ro
Log.Warning($"All other options exhausted");
return false;
}
+ // End of DeltaV code
public void Respawn(ICommonSession player)
{
@@ -596,7 +597,7 @@ public PlayerSpawnCompleteEvent(EntityUid mob,
{
Mob = mob;
Player = player;
- Job = job; // DeltaV #1418
+ Job = job; // DeltaV #1425
LateJoin = lateJoin;
Station = station;
Profile = profile;
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index 6c14cca8519..bb11a7c28ba 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -136,9 +136,9 @@ public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId
public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string name)
{
- if (MindTryGetJob(mindId, out var comp, out var prototype))
+ if (MindTryGetJob(mindId, out var comp, out var prototype)) // DeltaV #1425 - Override with the VirtualJobName if possible
{
- name = comp.VirtualJobName ?? prototype.LocalizedName;
+ name = comp.VirtualJobName ?? prototype.LocalizedName; // DeltaV #1425 - Override with the VirtualJobName if possible
return true;
}
From 709d57d08853873141864d3cef93f425183585d8 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Thu, 25 Jul 2024 09:07:53 +1000
Subject: [PATCH 18/23] localise senior job names
---
.../Access/Components/PresetIdCardComponent.cs | 10 ++++++----
Content.Server/Access/Systems/PresetIdCardSystem.cs | 3 ++-
Content.Server/GameTicking/GameTicker.Spawning.cs | 2 +-
.../Station/Systems/StationSpawningSystem.cs | 4 ++--
.../StationRecords/Systems/StationRecordsSystem.cs | 4 ++--
Content.Shared/Roles/Jobs/JobComponent.cs | 9 +++++++--
Content.Shared/Roles/Jobs/SharedJobSystem.cs | 4 ++--
Resources/Locale/en-US/job/job-names.ftl | 6 ++++++
.../Entities/Objects/Misc/identification_cards.yml | 8 ++++----
9 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/Content.Server/Access/Components/PresetIdCardComponent.cs b/Content.Server/Access/Components/PresetIdCardComponent.cs
index 18b022b6220..7f2201da5c3 100644
--- a/Content.Server/Access/Components/PresetIdCardComponent.cs
+++ b/Content.Server/Access/Components/PresetIdCardComponent.cs
@@ -6,21 +6,23 @@ namespace Content.Server.Access.Components;
[RegisterComponent]
public sealed partial class PresetIdCardComponent : Component
{
- [DataField("job")]
+ [DataField]
public ProtoId? JobName;
- [DataField("name")]
+ [DataField]
public string? IdName;
///
/// DeltaV: Allow changing the job title, even if it'd be otherwise set by the JobPrototype
///
- [DataField("virtualJobName")]
+ [DataField]
public string? VirtualJobName;
+ [ViewVariables(VVAccess.ReadOnly)]
+ public string? VirtualJobLocalizedName => (VirtualJobName != null) ? Loc.GetString(VirtualJobName) : null;
///
/// DeltaV: Allow changing the job icon, even if it'd be otherwise set by the JobPrototype
///
- [DataField("virtualJobIcon")]
+ [DataField]
public string? VirtualJobIcon;
}
diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs
index feb1d0f96a3..aa1e6155dc1 100644
--- a/Content.Server/Access/Systems/PresetIdCardSystem.cs
+++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs
@@ -78,7 +78,8 @@ private void SetupIdAccess(EntityUid uid, PresetIdCardComponent id, bool extende
_accessSystem.SetAccessToJob(uid, job, extended);
- _cardSystem.TryChangeJobTitle(uid, id.VirtualJobName ?? job.LocalizedName); // DeltaV #1425 - Attempt to use virtual job information before using job information
+ //flag
+ _cardSystem.TryChangeJobTitle(uid, id.VirtualJobLocalizedName ?? job.LocalizedName); // DeltaV #1425 - Attempt to use virtual job information before using job information
_cardSystem.TryChangeJobDepartment(uid, job);
// DeltaV #1425 - Attempt to use virtual job information before using job information
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index befa41a19f1..78ec43dd21d 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -330,7 +330,7 @@ private void SpawnPlayer(ICommonSession player,
PlayersJoinedRoundNormally++;
var aev = new PlayerSpawnCompleteEvent(mob,
player,
- job, // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobName/Icon.
+ job, // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobLocalizedName/Icon.
lateJoin,
PlayersJoinedRoundNormally,
station,
diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs
index 13581c49f1b..560b5cd343d 100644
--- a/Content.Server/Station/Systems/StationSpawningSystem.cs
+++ b/Content.Server/Station/Systems/StationSpawningSystem.cs
@@ -245,7 +245,7 @@ private void DoJobSpecials(JobComponent? job, EntityUid entity)
/// Character name to use for the ID.
/// Job prototype to use for the PDA and ID.
/// The station this player is being spawned on.
- public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobComponent job, EntityUid? station) // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobName/Icon
+ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobComponent job, EntityUid? station) // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobLocalizedName/Icon
{
if (!_prototypeManager.TryIndex(job.Prototype, out var jobPrototype)) // DeltaV #1425 - Get jobPrototype separately as a result
return;
@@ -261,7 +261,7 @@ public void SetPdaAndIdCardData(EntityUid entity, string characterName, JobCompo
return;
_cardSystem.TryChangeFullName(cardId, characterName, card);
- _cardSystem.TryChangeJobTitle(cardId, job.VirtualJobName ?? jobPrototype.LocalizedName, card); // DeltaV #1425 - Use VirtualJobName if possible
+ _cardSystem.TryChangeJobTitle(cardId, job.VirtualJobLocalizedName ?? jobPrototype.LocalizedName, card); // DeltaV #1425 - Use VirtualJobLocalizedName if possible
_prototypeManager.TryIndex(job.VirtualJobIcon ?? string.Empty, out var virtualJobIcon);
if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
index 7cb32c5584c..fa89b26946b 100644
--- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
+++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs
@@ -108,7 +108,7 @@ public void CreateGeneralRecord(
int age,
string species,
Gender gender,
- JobComponent job, // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobName/Icon
+ JobComponent job, // DeltaV #1425 - Use Job instead of JobId to pass VirtualJobLocalizedName/Icon
string? mobFingerprint,
string? dna,
HumanoidCharacterProfile profile,
@@ -132,7 +132,7 @@ public void CreateGeneralRecord(
{
Name = name,
Age = age,
- JobTitle = job.VirtualJobName ?? jobPrototype.LocalizedName,// DeltaV #1425 - Use VirtualJobName if possible
+ JobTitle = job.VirtualJobLocalizedName ?? jobPrototype.LocalizedName,// DeltaV #1425 - Use VirtualJobLocalizedName if possible
JobIcon = job.VirtualJobIcon ?? jobPrototype.Icon, // DeltaV #1425 - Use VirtualJobIcon if possible
JobPrototype = jobId,
Species = species,
diff --git a/Content.Shared/Roles/Jobs/JobComponent.cs b/Content.Shared/Roles/Jobs/JobComponent.cs
index 55c8ee6cc17..11caf31c20d 100644
--- a/Content.Shared/Roles/Jobs/JobComponent.cs
+++ b/Content.Shared/Roles/Jobs/JobComponent.cs
@@ -1,4 +1,5 @@
-using Robust.Shared.GameStates;
+using Content.Shared.Chat.V2.Repository;
+using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Roles.Jobs;
@@ -12,9 +13,13 @@ public sealed partial class JobComponent : Component
[DataField(required: true), AutoNetworkedField]
public ProtoId? Prototype;
- // DeltaV #1425 - Pass VirtualJobName/Icon with the JobComponent to override job information
+ // DeltaV #1425 - Pass VirtualJobLocalizedName/Icon with the JobComponent to override job information
[DataField]
public string? VirtualJobName;
+
+ [ViewVariables(VVAccess.ReadOnly)]
+ public string? VirtualJobLocalizedName => (VirtualJobName != null) ? Loc.GetString(VirtualJobName) : null;
+
[DataField]
public string? VirtualJobIcon;
// End of DeltaV code
diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
index bb11a7c28ba..f5d60bd97e7 100644
--- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs
+++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs
@@ -136,9 +136,9 @@ public bool MindTryGetJobId([NotNullWhen(true)] EntityUid? mindId, out ProtoId
public bool MindTryGetJobName([NotNullWhen(true)] EntityUid? mindId, out string name)
{
- if (MindTryGetJob(mindId, out var comp, out var prototype)) // DeltaV #1425 - Override with the VirtualJobName if possible
+ if (MindTryGetJob(mindId, out var comp, out var prototype)) // DeltaV #1425 - Override with the VirtualJobLocalizedName if possible
{
- name = comp.VirtualJobName ?? prototype.LocalizedName; // DeltaV #1425 - Override with the VirtualJobName if possible
+ name = comp.VirtualJobLocalizedName ?? prototype.LocalizedName; // DeltaV #1425 - Override with the VirtualJobLocalizedName if possible
return true;
}
diff --git a/Resources/Locale/en-US/job/job-names.ftl b/Resources/Locale/en-US/job/job-names.ftl
index 4b7b5ccc421..c3c1a86937d 100644
--- a/Resources/Locale/en-US/job/job-names.ftl
+++ b/Resources/Locale/en-US/job/job-names.ftl
@@ -48,6 +48,12 @@ job-name-boxer = Boxer
job-name-zookeeper = Zookeeper
job-name-visitor = Visitor
+# DeltaV #1418 - Define senior job names for use in virtual jobs
+job-name-seniorengineer = Senior Engineer
+job-name-seniorphysician = Senior Physician
+job-name-seniorresearcher = Senior Researcher
+job-name-seniorofficer = Senior Officer
+
# Role timers - Make these alphabetical or I cut you
JobAtmosphericTechnician = Atmospheric Technician
JobBartender = Bartender
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index a0ecde7fdbc..a53fe99b742 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -823,7 +823,7 @@
- state: default
- state: idseniorengineer
- type: PresetIdCard # DeltaV - Change senior job titles
- virtualJobName: "Senior Engineer"
+ virtualJobName: "job-name-seniorengineer"
virtualJobIcon: "JobIconSeniorEngineer"
- type: entity
@@ -836,7 +836,7 @@
- state: default
- state: idseniorresearcher
- type: PresetIdCard # DeltaV - Change senior job titles
- virtualJobName: "Senior Researcher"
+ virtualJobName: "job-name-seniorresearcher"
virtualJobIcon: "JobIconSeniorResearcher"
- type: entity
@@ -849,7 +849,7 @@
- state: default
- state: idseniorphysician
- type: PresetIdCard # DeltaV - Change senior job titles
- virtualJobName: "Senior Physician"
+ virtualJobName: "job-name-seniorphysician"
virtualJobIcon: "JobIconSeniorPhysician"
- type: entity
@@ -862,7 +862,7 @@
- state: default
- state: idseniorofficer
- type: PresetIdCard # DeltaV - Change senior job titles
- virtualJobName: "Senior Officer"
+ virtualJobName: "job-name-seniorofficer"
virtualJobIcon: "JobIconSeniorOfficer"
- type: entity
From faee701771538a6134904105f611af912f84d5d5 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Sun, 4 Aug 2024 21:05:23 +1000
Subject: [PATCH 19/23] fix build error
---
Content.Server/GameTicking/GameTicker.Spawning.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index 78ec43dd21d..ef53ab4266a 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -241,7 +241,7 @@ private void SpawnPlayer(ICommonSession player,
if (loadout == null)
{
loadout = new RoleLoadout(jobLoadout);
- loadout.SetDefault(_prototypeManager);
+ loadout.SetDefault(character, player, _prototypeManager);
}
// Get the ID
From e57ef6d52b94ca0365ceb3dec46d05167df5740e Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Mon, 5 Aug 2024 06:46:22 +1000
Subject: [PATCH 20/23] fix spawned cards being broken
---
.../Access/Systems/PresetIdCardSystem.cs | 2 +-
.../Objects/Misc/identification_cards.yml | 82 +++++++++----------
2 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs
index aa1e6155dc1..bfbbbbd257a 100644
--- a/Content.Server/Access/Systems/PresetIdCardSystem.cs
+++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs
@@ -79,7 +79,7 @@ private void SetupIdAccess(EntityUid uid, PresetIdCardComponent id, bool extende
_accessSystem.SetAccessToJob(uid, job, extended);
//flag
- _cardSystem.TryChangeJobTitle(uid, id.VirtualJobLocalizedName ?? job.LocalizedName); // DeltaV #1425 - Attempt to use virtual job information before using job information
+ _cardSystem.TryChangeJobTitle(uid, !string.IsNullOrEmpty(id.VirtualJobLocalizedName) ? id.VirtualJobLocalizedName : job.LocalizedName); // DeltaV #1425 - Attempt to use virtual job information before using job information
_cardSystem.TryChangeJobDepartment(uid, job);
// DeltaV #1425 - Attempt to use virtual job information before using job information
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index a53fe99b742..b3b0bb2180e 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -37,7 +37,7 @@
- state: default
- state: idpassenger
- type: PresetIdCard
- job: Passenger
+ jobName: Passenger
- type: entity
parent: PassengerIDCard
@@ -45,7 +45,7 @@
name: technical assistant ID card
components:
- type: PresetIdCard
- job: TechnicalAssistant
+ jobName: TechnicalAssistant
- type: Sprite
layers:
- state: default
@@ -57,7 +57,7 @@
name: medical intern ID card
components:
- type: PresetIdCard
- job: MedicalIntern
+ jobName: MedicalIntern
- type: Sprite
layers:
- state: default
@@ -69,7 +69,7 @@
name: research assistant ID card
components:
- type: PresetIdCard
- job: ResearchAssistant
+ jobName: ResearchAssistant
- type: Sprite
layers:
- state: default
@@ -81,7 +81,7 @@
name: security cadet ID card
components:
- type: PresetIdCard
- job: SecurityCadet
+ jobName: SecurityCadet
- type: Sprite
layers:
- state: default
@@ -93,7 +93,7 @@
name: service worker ID card
components:
- type: PresetIdCard
- job: ServiceWorker
+ jobName: ServiceWorker
- type: Sprite
layers:
- state: default
@@ -111,7 +111,7 @@
- type: Item
heldPrefix: gold
- type: PresetIdCard
- job: Captain
+ jobName: Captain
- type: Tag
tags:
- DoorBumpOpener
@@ -130,7 +130,7 @@
- state: default
- state: idsecurityofficer
- type: PresetIdCard
- job: SecurityOfficer
+ jobName: SecurityOfficer
- type: entity
parent: IDCardStandard
@@ -142,7 +142,7 @@
- state: default
- state: idwarden
- type: PresetIdCard
- job: Warden
+ jobName: Warden
- type: entity
parent: IDCardStandard
@@ -154,7 +154,7 @@
- state: default
- state: idstationengineer
- type: PresetIdCard
- job: StationEngineer
+ jobName: StationEngineer
- type: entity
parent: IDCardStandard
@@ -166,7 +166,7 @@
- state: default
- state: idmedicaldoctor
- type: PresetIdCard
- job: MedicalDoctor
+ jobName: MedicalDoctor
- type: entity
parent: IDCardStandard
@@ -178,7 +178,7 @@
- state: default
- state: idparamedic
- type: PresetIdCard
- job: Paramedic
+ jobName: Paramedic
- type: entity
parent: IDCardStandard
@@ -190,7 +190,7 @@
- state: default
- state: idchemist
- type: PresetIdCard
- job: Chemist
+ jobName: Chemist
- type: entity
parent: IDCardStandard
@@ -202,7 +202,7 @@
- state: default
- state: idcargotechnician
- type: PresetIdCard
- job: CargoTechnician
+ jobName: CargoTechnician
- type: entity
parent: IDCardStandard
@@ -214,7 +214,7 @@
- state: default
- state: idshaftminer
- type: PresetIdCard
- job: SalvageSpecialist
+ jobName: SalvageSpecialist
- type: entity
parent: IDCardStandard
@@ -228,7 +228,7 @@
- type: Item
heldPrefix: silver
- type: PresetIdCard
- job: Quartermaster
+ jobName: Quartermaster
- type: entity
parent: IDCardStandard
@@ -240,7 +240,7 @@
- state: default
- state: idscientist
- type: PresetIdCard
- job: Scientist
+ jobName: Scientist
- type: entity
parent: IDCardStandard
@@ -252,7 +252,7 @@
- state: default
- state: idclown
- type: PresetIdCard
- job: Clown
+ jobName: Clown
- type: entity
parent: IDCardStandard
@@ -264,7 +264,7 @@
- state: default
- state: idmime
- type: PresetIdCard
- job: Mime
+ jobName: Mime
- type: entity
parent: IDCardStandard
@@ -277,7 +277,7 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi # DeltaV - Give Chaplain ID Epistemics colors
state: idchaplain
- type: PresetIdCard
- job: Chaplain
+ jobName: Chaplain
- type: entity
parent: IDCardStandard
@@ -289,7 +289,7 @@
- state: default
- state: idjanitor
- type: PresetIdCard
- job: Janitor
+ jobName: Janitor
- type: entity
parent: IDCardStandard
@@ -301,7 +301,7 @@
- state: default
- state: idbartender
- type: PresetIdCard
- job: Bartender
+ jobName: Bartender
- type: entity
parent: IDCardStandard
@@ -313,7 +313,7 @@
- state: default
- state: idbartender
- type: PresetIdCard
- job: Bartender
+ jobName: Bartender
name: Pun Pun
- type: entity
@@ -326,7 +326,7 @@
- state: default
- state: idcook
- type: PresetIdCard
- job: Chef
+ jobName: Chef
- type: entity
parent: IDCardStandard
@@ -338,7 +338,7 @@
- state: default
- state: idbotanist
- type: PresetIdCard
- job: Botanist
+ jobName: Botanist
- type: entity
parent: IDCardStandard
@@ -350,7 +350,7 @@
- state: default
- state: idcurator
- type: PresetIdCard
- job: Librarian
+ jobName: Librarian
- type: entity
parent: IDCardStandard
@@ -363,7 +363,7 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi # DeltaV - Give Lawyer ID Justice colors
state: idlawyer
- type: PresetIdCard
- job: Lawyer
+ jobName: Lawyer
- type: entity
parent: IDCardStandard
@@ -377,7 +377,7 @@
- type: Item
heldPrefix: silver
- type: PresetIdCard
- job: HeadOfPersonnel
+ jobName: HeadOfPersonnel
- type: entity
parent: IDCardStandard
@@ -391,7 +391,7 @@
- type: Item
heldPrefix: silver
- type: PresetIdCard
- job: ChiefEngineer
+ jobName: ChiefEngineer
- type: entity
parent: IDCardStandard
@@ -405,7 +405,7 @@
- type: Item
heldPrefix: silver
- type: PresetIdCard
- job: ChiefMedicalOfficer
+ jobName: ChiefMedicalOfficer
- type: entity
parent: IDCardStandard
@@ -419,7 +419,7 @@
- type: Item
heldPrefix: silver
- type: PresetIdCard
- job: ResearchDirector
+ jobName: ResearchDirector
- type: entity
parent: IDCardStandard
@@ -433,7 +433,7 @@
- type: Item
heldPrefix: silver
- type: PresetIdCard
- job: HeadOfSecurity
+ jobName: HeadOfSecurity
- type: entity
parent: IDCardStandard
@@ -445,7 +445,7 @@
- state: default
- state: idbrigmedic
- type: PresetIdCard # Delta V - Brigmedic, see Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml
- job: Brigmedic
+ jobName: Brigmedic
- type: entity
parent: IDCardStandard
@@ -571,7 +571,7 @@
- state: default
- state: idmusician
- type: PresetIdCard
- job: Musician
+ jobName: Musician
- type: entity
parent: CentcomIDCard
@@ -593,7 +593,7 @@
suffix: Agent
components:
- type: PresetIdCard
- job: Passenger
+ jobName: Passenger
- type: Access
tags:
- Maintenance
@@ -697,7 +697,7 @@
- state: orange
- state: idatmospherictechnician
- type: PresetIdCard
- job: AtmosphericTechnician
+ jobName: AtmosphericTechnician
- type: entity
parent: IDCardStandard
@@ -735,7 +735,7 @@
- state: default
- state: idpsychologist
- type: PresetIdCard
- job: Psychologist
+ jobName: Psychologist
- type: entity
parent: IDCardStandard
@@ -747,7 +747,7 @@
- state: default
- state: idreporter
- type: PresetIdCard
- job: Reporter
+ jobName: Reporter
- type: entity
parent: IDCardStandard
@@ -759,7 +759,7 @@
- state: default
- state: idboxer
- type: PresetIdCard
- job: Boxer
+ jobName: Boxer
- type: entity
parent: IDCardStandard
@@ -771,7 +771,7 @@
- state: default
- state: idzookeeper
- type: PresetIdCard
- job: Zookeeper
+ jobName: Zookeeper
- type: entity
parent: IDCardStandard
@@ -783,7 +783,7 @@
- state: default
- state: iddetective
- type: PresetIdCard
- job: Detective
+ jobName: Detective
- type: entity
parent: CentcomIDCard
From 9f07350a189e6f85c8d685317a8cf4c44bb0e6b5 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Mon, 5 Aug 2024 06:52:46 +1000
Subject: [PATCH 21/23] reduced logging for finding PresetIdCard
---
Content.Server/GameTicking/GameTicker.Spawning.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index ef53ab4266a..5122fe7fd8e 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -349,18 +349,18 @@ private bool GetPresetIdFromLoadout(RoleLoadout loadout, RoleLoadoutPrototype ro
{
if (!_prototypeManager.TryIndex(items.Prototype, out var loadoutProto))
{
- Log.Warning($"Unable to find loadout prototype for {items.Prototype}");
+ Log.Debug($"Unable to find loadout prototype for {items.Prototype}");
continue;
}
if (!_prototypeManager.TryIndex(loadoutProto.Equipment, out var startingGear))
{
- Log.Warning($"Unable to find starting gear {loadoutProto.Equipment} for loadout {loadoutProto}");
+ Log.Debug($"Unable to find starting gear {loadoutProto.Equipment} for loadout {loadoutProto}");
continue;
}
var entProtoId = startingGear.GetGear("id");
if (!_prototypeManager.TryIndex(entProtoId, out var idProto))
{
- Log.Warning($"Unable to find prototype for {startingGear} for starting gear {loadoutProto.Equipment} for loadout {loadoutProto}");
+ Log.Debug($"Unable to find prototype for {startingGear} for starting gear {loadoutProto.Equipment} for loadout {loadoutProto}");
continue;
}
if (idProto.TryGetComponent(out var pdaComponent, _componentFactory) && pdaComponent.IdCard != null)
@@ -375,7 +375,7 @@ private bool GetPresetIdFromLoadout(RoleLoadout loadout, RoleLoadoutPrototype ro
if (!idProto.TryGetComponent(out var idComponent, _componentFactory))
{
- Log.Warning($"Unable to find presetIdCard for {idProto}");
+ Log.Debug($"Unable to find presetIdCard for {idProto}");
continue;
}
From a8db1a83802fd4b06d3c82c72ebb29adf9c45b43 Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Mon, 5 Aug 2024 07:00:53 +1000
Subject: [PATCH 22/23] more fixes
---
.../DeltaV/Entities/Objects/Misc/identification_cards.yml | 8 ++++----
.../Entities/Objects/Misc/identification_cards.yml | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Misc/identification_cards.yml
index 1d1f1bad178..4992a9e180c 100644
--- a/Resources/Prototypes/DeltaV/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/DeltaV/Entities/Objects/Misc/identification_cards.yml
@@ -4,7 +4,7 @@
name: chief justice ID card
components:
- type: PresetIdCard
- job: ChiefJustice
+ jobName: ChiefJustice
- type: Sprite
layers:
- state: default
@@ -17,7 +17,7 @@
name: clerk ID card
components:
- type: PresetIdCard
- job: Clerk
+ jobName: Clerk
- type: Sprite
layers:
- state: default
@@ -30,7 +30,7 @@
name: presecutor ID card
components:
- type: PresetIdCard
- job: Prosecutor
+ jobName: Prosecutor
- type: Sprite
layers:
- state: default
@@ -48,4 +48,4 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi
state: nyanomailcarrier
- type: PresetIdCard
- job: Courier
+ jobName: Courier
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index b3b0bb2180e..00c49ba934c 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -314,7 +314,7 @@
- state: idbartender
- type: PresetIdCard
jobName: Bartender
- name: Pun Pun
+ idName: Pun Pun
- type: entity
parent: IDCardStandard
From 48018f752b383a586640ae1265ff9050bcd032ed Mon Sep 17 00:00:00 2001
From: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Date: Mon, 5 Aug 2024 07:08:48 +1000
Subject: [PATCH 23/23] fix
---
.../Objects/Devices/Misc/identification_cards.yml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Misc/identification_cards.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Misc/identification_cards.yml
index 0c0db8febc5..c0107881687 100644
--- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Misc/identification_cards.yml
@@ -9,7 +9,7 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi
state: nyanoprisoner
- type: PresetIdCard
- job: Prisoner
+ jobName: Prisoner
- type: entity
parent: IDCardStandard
@@ -22,7 +22,7 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi
state: nyanogladiator
- type: PresetIdCard
- job: Gladiator
+ jobName: Gladiator
- type: entity
parent: IDCardStandard
@@ -35,7 +35,7 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi
state: nyanoprisonguard
- type: PresetIdCard
- job: PrisonGuard
+ jobName: PrisonGuard
- type: entity
parent: IDCardStandard
@@ -48,7 +48,7 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi
state: nyanomailcarrier
- type: PresetIdCard
- job: MailCarrier
+ jobName: MailCarrier
- type: entity
parent: IDCardStandard
@@ -61,7 +61,7 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi
state: nyanomartialartist
- type: PresetIdCard
- job: MartialArtist
+ jobName: MartialArtist
- type: entity
parent: IDCardStandard
@@ -74,4 +74,4 @@
- sprite: DeltaV/Objects/Misc/id_cards.rsi
state: nyanomantis
- type: PresetIdCard
- job: ForensicMantis
+ jobName: ForensicMantis