- fix: Show true name in station records. (#34)
This commit is contained in:
@@ -141,8 +141,6 @@ public sealed class CriminalRecordsConsoleSystem : EntitySystem
|
||||
criminalData = EnsureComp<CriminalStatusDataComponent>(entity);
|
||||
}
|
||||
criminalData.Statuses[rec.Name] = msg.Status;
|
||||
criminalData.Statuses[rec.ClownName] = msg.Status;
|
||||
criminalData.Statuses[rec.MimeName] = msg.Status;
|
||||
Dirty(entity, criminalData);
|
||||
}
|
||||
// WD EDIT END
|
||||
|
||||
@@ -65,7 +65,7 @@ public sealed class StationRecordsSystem : SharedStationRecordsSystem
|
||||
TryComp<FingerprintComponent>(player, out var fingerprintComponent);
|
||||
TryComp<DnaComponent>(player, out var dnaComponent);
|
||||
|
||||
CreateGeneralRecord(station, idUid.Value, profile.Name, profile.ClownName, profile.MimeName, profile.BorgName, profile.Age, profile.Species, profile.Gender, jobId, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records);
|
||||
CreateGeneralRecord(station, idUid.Value, Name(player), profile.Age, profile.Species, profile.Gender, jobId, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,9 +100,6 @@ public sealed class StationRecordsSystem : SharedStationRecordsSystem
|
||||
EntityUid station,
|
||||
EntityUid? idUid,
|
||||
string name,
|
||||
string clownName,
|
||||
string mimeName,
|
||||
string borgName,
|
||||
int age,
|
||||
string species,
|
||||
Gender gender,
|
||||
@@ -126,9 +123,6 @@ public sealed class StationRecordsSystem : SharedStationRecordsSystem
|
||||
var record = new GeneralStationRecord()
|
||||
{
|
||||
Name = name,
|
||||
ClownName = clownName,
|
||||
MimeName = mimeName,
|
||||
BorgName = borgName,
|
||||
Age = age,
|
||||
JobTitle = jobPrototype.LocalizedName,
|
||||
JobIcon = jobPrototype.Icon,
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server._White.AspectsSystem.Aspects.Components;
|
||||
using Content.Server._White.AspectsSystem.Base;
|
||||
using Content.Server._White.Other.RandomHumanSystem;
|
||||
using Content.Server.StationRecords.Systems;
|
||||
using Content.Shared.Humanoid;
|
||||
|
||||
namespace Content.Server._White.AspectsSystem.Aspects;
|
||||
@@ -12,7 +13,7 @@ public sealed class RandomAppearanceAspect : AspectSystem<RandomAppearanceAspect
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(HandleLateJoin);
|
||||
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(HandleLateJoin, after: new [] {typeof(StationRecordsSystem)});
|
||||
}
|
||||
|
||||
protected override void Started(EntityUid uid, RandomAppearanceAspectComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Server.Humanoid;
|
||||
using Content.Server.IdentityManagement;
|
||||
using Content.Server.PDA;
|
||||
using Content.Server.Roles;
|
||||
using Content.Server.StationRecords.Systems;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Inventory;
|
||||
@@ -10,6 +11,7 @@ using Content.Shared.Mind.Components;
|
||||
using Content.Shared.NukeOps;
|
||||
using Content.Shared.PDA;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.StationRecords;
|
||||
|
||||
namespace Content.Server._White.Other.RandomHumanSystem;
|
||||
|
||||
@@ -21,7 +23,7 @@ public sealed class RandomHumanSystem : EntitySystem
|
||||
[Dependency] private readonly IdCardSystem _card = default!;
|
||||
[Dependency] private readonly PdaSystem _pda = default!;
|
||||
[Dependency] private readonly IdentitySystem _identity = default!;
|
||||
[Dependency] private readonly RoleSystem _roles = default!;
|
||||
[Dependency] private readonly StationRecordsSystem _records = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -58,6 +60,21 @@ public sealed class RandomHumanSystem : EntitySystem
|
||||
_card.TryChangeFullName(cardId, newProfile.Name, card);
|
||||
_pda.SetOwner(idUid.Value, pdaComponent, newProfile.Name);
|
||||
|
||||
if (EntityManager.TryGetComponent(cardId, out StationRecordKeyStorageComponent? keyStorage)
|
||||
&& keyStorage.Key is { } key)
|
||||
{
|
||||
if (_records.TryGetRecord<GeneralStationRecord>(key, out var generalRecord))
|
||||
{
|
||||
generalRecord.Name = newProfile.Name;
|
||||
generalRecord.Age = newProfile.Age;
|
||||
generalRecord.Gender = newProfile.Gender;
|
||||
generalRecord.Species = newProfile.Species;
|
||||
generalRecord.Profile = newProfile;
|
||||
}
|
||||
|
||||
_records.Synchronize(key);
|
||||
}
|
||||
|
||||
_identity.QueueIdentityUpdate(uid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,6 @@ public sealed record GeneralStationRecord
|
||||
[DataField]
|
||||
public string Name = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
public string ClownName = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
public string MimeName = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
public string BorgName = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Age of the person that this station record represents.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user