mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 08:37:26 +00:00
* 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>
78 lines
2.3 KiB
C#
78 lines
2.3 KiB
C#
using Content.Shared._DV.CartridgeLoader.Cartridges;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Shared._DV.NanoChat;
|
|
|
|
[RegisterComponent, NetworkedComponent, Access(typeof(SharedNanoChatSystem))]
|
|
[AutoGenerateComponentPause, AutoGenerateComponentState]
|
|
public sealed partial class NanoChatCardComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The number assigned to this card.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public uint? Number;
|
|
|
|
/// <summary>
|
|
/// Whether a PDA has this card's UI closed.
|
|
/// Used for notifications.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool IsClosed;
|
|
|
|
/// <summary>
|
|
/// All chat recipients stored on this card.
|
|
/// </summary>
|
|
[DataField]
|
|
public Dictionary<uint, NanoChatRecipient> Recipients = [];
|
|
|
|
/// <summary>
|
|
/// All messages stored on this card, keyed by recipient number.
|
|
/// </summary>
|
|
[DataField]
|
|
public Dictionary<uint, List<NanoChatMessage>> Messages = [];
|
|
|
|
/// <summary>
|
|
/// The NanoChat numbers that should not give a notification, even when notifications are enabled.
|
|
/// </summary>
|
|
[DataField]
|
|
public HashSet<uint> MutedChats = [];
|
|
|
|
/// <summary>
|
|
/// The currently selected chat recipient number.
|
|
/// </summary>
|
|
[DataField]
|
|
public uint? CurrentChat;
|
|
|
|
/// <summary>
|
|
/// The maximum amount of recipients this card supports.
|
|
/// </summary>
|
|
[DataField]
|
|
public int MaxRecipients = 50;
|
|
|
|
/// <summary>
|
|
/// Last time a message was sent, for rate limiting.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
|
|
public TimeSpan LastMessageTime; // TODO: actually use this, compare against actor and not the card
|
|
|
|
/// <summary>
|
|
/// Whether to send notifications.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool NotificationsMuted;
|
|
|
|
/// <summary>
|
|
/// Whether the card's number should be listed in NanoChat's lookup
|
|
/// </summary>
|
|
[DataField]
|
|
public bool ListNumber = true;
|
|
|
|
/// <summary>
|
|
/// The PDA that this card is currently inserted to.
|
|
/// </summary>
|
|
[DataField]
|
|
public EntityUid? PdaUid = null;
|
|
}
|