Skip to content

Commit

Permalink
Fix #5
Browse files Browse the repository at this point in the history
  • Loading branch information
CatBackGround authored Feb 12, 2025
1 parent 1dbbbd8 commit 1048fd7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Content.Shared.Access.Components;
using Content.Shared.Audio;
using Content.Shared.CartridgeLoader;
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.Popups;
Expand All @@ -7,20 +9,21 @@

namespace Content.Server.CartridgeLoader.Cartridges;

public sealed class LogProbeCartridgeSystem : EntitySystem
public sealed partial class LogProbeCartridgeSystem : EntitySystem // Corvax-Next-PDAChat - Made partial
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly CartridgeLoaderSystem? _cartridgeLoaderSystem = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;

public override void Initialize()
{
base.Initialize();
InitializeNanoChat(); // Corvax-Next-PDAChat
SubscribeLocalEvent<LogProbeCartridgeComponent, CartridgeUiReadyEvent>(OnUiReady);
SubscribeLocalEvent<LogProbeCartridgeComponent, CartridgeAfterInteractEvent>(AfterInteract);
}

/// <summary>
/// The <see cref="CartridgeAfterInteractEvent" /> gets relayed to this system if the cartridge loader is running
/// the LogProbe program and someone clicks on something with it. <br/>
Expand Down Expand Up @@ -57,10 +60,13 @@ private void AfterInteract(Entity<LogProbeCartridgeComponent> ent, ref Cartridge
accessRecord.AccessTime,
accessRecord.Accessor
);

ent.Comp.PulledAccessLogs.Add(log);
}

UpdateUiState(ent, args.Loader);
}

/// <summary>
/// This gets called when the ui fragment needs to be updated for the first time after activating
/// </summary>
Expand All @@ -71,7 +77,6 @@ private void OnUiReady(Entity<LogProbeCartridgeComponent> ent, ref CartridgeUiRe

private void UpdateUiState(Entity<LogProbeCartridgeComponent> ent, EntityUid loaderUid)
{
var state = new LogProbeUiState(ent.Comp.PulledAccessLogs);
var state = new LogProbeUiState(ent.Comp.PulledAccessLogs, ent.Comp.ScannedNanoChatData); // Corvax-Next-PDAChat - NanoChat support
_cartridgeLoaderSystem?.UpdateCartridgeUiState(loaderUid, state);
}
Expand Down

0 comments on commit 1048fd7

Please sign in to comment.