mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 00:27:59 +00:00
Various Improvements to NanoChat (#2922)
* Port improvements to NanoChat from Einstein-Engines and Goob-Station * fix duplicate translation key * add missing space * Properly mark DeltaV changes * Allow muting individual NanoChat users, NanoChat UI to put per-chat buttons next to the message box * remove leftover from testing stuff * cycle through inputs with tab, confirm with enter; for new and edit chat * Add channel switching with (Shift+)Alt+Up/Down; Discord-Style * better null check * another better null check * Implement changes from ImpStation PR * Rename ContactControl -> ContactContainer * Requested changes * Move Loc to _DV, don't register system as manager * I'm so smart :) --------- Co-authored-by: Alex C <alex91905@yahoo.com>
This commit is contained in:
@@ -7,6 +7,8 @@ using Content.Shared._DV.CartridgeLoader.Cartridges;
|
||||
using Content.Shared._DV.NanoChat;
|
||||
using Content.Shared.Kitchen.Components;
|
||||
using Content.Shared.NameIdentifier;
|
||||
using Content.Shared.PDA;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -26,10 +28,32 @@ public sealed class NanoChatSystem : SharedNanoChatSystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<NanoChatCardComponent, EntGotInsertedIntoContainerMessage>(OnInserted);
|
||||
SubscribeLocalEvent<NanoChatCardComponent, EntGotRemovedFromContainerMessage>(OnRemoved);
|
||||
|
||||
SubscribeLocalEvent<NanoChatCardComponent, MapInitEvent>(OnCardInit);
|
||||
SubscribeLocalEvent<NanoChatCardComponent, BeingMicrowavedEvent>(OnMicrowaved, after: [typeof(IdCardSystem)]);
|
||||
}
|
||||
|
||||
private void OnInserted(Entity<NanoChatCardComponent> ent, ref EntGotInsertedIntoContainerMessage args)
|
||||
{
|
||||
if (args.Container.ID != PdaComponent.PdaIdSlotId)
|
||||
return;
|
||||
|
||||
ent.Comp.PdaUid = args.Container.Owner;
|
||||
Dirty(ent);
|
||||
}
|
||||
|
||||
private void OnRemoved(Entity<NanoChatCardComponent> ent, ref EntGotRemovedFromContainerMessage args)
|
||||
{
|
||||
if (args.Container.ID != PdaComponent.PdaIdSlotId)
|
||||
return;
|
||||
|
||||
ent.Comp.PdaUid = null;
|
||||
Dirty(ent);
|
||||
}
|
||||
|
||||
private void OnMicrowaved(Entity<NanoChatCardComponent> ent, ref BeingMicrowavedEvent args)
|
||||
{
|
||||
// Skip if the entity was deleted (e.g., by ID card system burning it)
|
||||
|
||||
Reference in New Issue
Block a user