- fix: Show true name in station records. (#34)

This commit is contained in:
Aviu00
2024-02-08 18:44:19 +09:00
committed by GitHub
parent 74941f06bb
commit 9c91a9c3c3
5 changed files with 21 additions and 20 deletions

View File

@@ -141,8 +141,6 @@ public sealed class CriminalRecordsConsoleSystem : EntitySystem
criminalData = EnsureComp<CriminalStatusDataComponent>(entity); criminalData = EnsureComp<CriminalStatusDataComponent>(entity);
} }
criminalData.Statuses[rec.Name] = msg.Status; criminalData.Statuses[rec.Name] = msg.Status;
criminalData.Statuses[rec.ClownName] = msg.Status;
criminalData.Statuses[rec.MimeName] = msg.Status;
Dirty(entity, criminalData); Dirty(entity, criminalData);
} }
// WD EDIT END // WD EDIT END

View File

@@ -65,7 +65,7 @@ public sealed class StationRecordsSystem : SharedStationRecordsSystem
TryComp<FingerprintComponent>(player, out var fingerprintComponent); TryComp<FingerprintComponent>(player, out var fingerprintComponent);
TryComp<DnaComponent>(player, out var dnaComponent); 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 station,
EntityUid? idUid, EntityUid? idUid,
string name, string name,
string clownName,
string mimeName,
string borgName,
int age, int age,
string species, string species,
Gender gender, Gender gender,
@@ -126,9 +123,6 @@ public sealed class StationRecordsSystem : SharedStationRecordsSystem
var record = new GeneralStationRecord() var record = new GeneralStationRecord()
{ {
Name = name, Name = name,
ClownName = clownName,
MimeName = mimeName,
BorgName = borgName,
Age = age, Age = age,
JobTitle = jobPrototype.LocalizedName, JobTitle = jobPrototype.LocalizedName,
JobIcon = jobPrototype.Icon, JobIcon = jobPrototype.Icon,

View File

@@ -3,6 +3,7 @@ using Content.Server.GameTicking.Rules.Components;
using Content.Server._White.AspectsSystem.Aspects.Components; using Content.Server._White.AspectsSystem.Aspects.Components;
using Content.Server._White.AspectsSystem.Base; using Content.Server._White.AspectsSystem.Base;
using Content.Server._White.Other.RandomHumanSystem; using Content.Server._White.Other.RandomHumanSystem;
using Content.Server.StationRecords.Systems;
using Content.Shared.Humanoid; using Content.Shared.Humanoid;
namespace Content.Server._White.AspectsSystem.Aspects; namespace Content.Server._White.AspectsSystem.Aspects;
@@ -12,7 +13,7 @@ public sealed class RandomAppearanceAspect : AspectSystem<RandomAppearanceAspect
public override void Initialize() public override void Initialize()
{ {
base.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) protected override void Started(EntityUid uid, RandomAppearanceAspectComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)

View File

@@ -3,6 +3,7 @@ using Content.Server.Humanoid;
using Content.Server.IdentityManagement; using Content.Server.IdentityManagement;
using Content.Server.PDA; using Content.Server.PDA;
using Content.Server.Roles; using Content.Server.Roles;
using Content.Server.StationRecords.Systems;
using Content.Shared.Access.Components; using Content.Shared.Access.Components;
using Content.Shared.Humanoid; using Content.Shared.Humanoid;
using Content.Shared.Inventory; using Content.Shared.Inventory;
@@ -10,6 +11,7 @@ using Content.Shared.Mind.Components;
using Content.Shared.NukeOps; using Content.Shared.NukeOps;
using Content.Shared.PDA; using Content.Shared.PDA;
using Content.Shared.Preferences; using Content.Shared.Preferences;
using Content.Shared.StationRecords;
namespace Content.Server._White.Other.RandomHumanSystem; namespace Content.Server._White.Other.RandomHumanSystem;
@@ -21,7 +23,7 @@ public sealed class RandomHumanSystem : EntitySystem
[Dependency] private readonly IdCardSystem _card = default!; [Dependency] private readonly IdCardSystem _card = default!;
[Dependency] private readonly PdaSystem _pda = default!; [Dependency] private readonly PdaSystem _pda = default!;
[Dependency] private readonly IdentitySystem _identity = default!; [Dependency] private readonly IdentitySystem _identity = default!;
[Dependency] private readonly RoleSystem _roles = default!; [Dependency] private readonly StationRecordsSystem _records = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -58,6 +60,21 @@ public sealed class RandomHumanSystem : EntitySystem
_card.TryChangeFullName(cardId, newProfile.Name, card); _card.TryChangeFullName(cardId, newProfile.Name, card);
_pda.SetOwner(idUid.Value, pdaComponent, newProfile.Name); _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); _identity.QueueIdentityUpdate(uid);
} }
} }

View File

@@ -16,15 +16,6 @@ public sealed record GeneralStationRecord
[DataField] [DataField]
public string Name = string.Empty; public string Name = string.Empty;
[ViewVariables]
public string ClownName = string.Empty;
[ViewVariables]
public string MimeName = string.Empty;
[ViewVariables]
public string BorgName = string.Empty;
/// <summary> /// <summary>
/// Age of the person that this station record represents. /// Age of the person that this station record represents.
/// </summary> /// </summary>