mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 22:18:52 +03:00
<!-- This is a semi-strict format, you can add/remove sections as needed but the order/format should be kept the same Remove these comments before submitting --> # Description <!-- Explain this PR in as much detail as applicable Some example prompts to consider: How might this affect the game? The codebase? What might be some alternatives to this? How/Who does this benefit/hurt [the game/codebase]? --> Port nanochat lookup from Delta-v. Pr: https://github.com/DeltaV-Station/Delta-v/pull/2794 --- # TODO <!-- A list of everything you have to do before this PR is "complete" You probably won't have to complete everything before merging but it's good to leave future references --> - [x] Task - [x] Completed Task --- <!-- This is default collapsed, readers click to expand it and see all your media The PR media section can get very large at times, so this is a good way to keep it clean The title is written using HTML tags The title must be within the <summary> tags or you won't see it --> <details><summary><h1>Media</h1></summary> <p>     </p> </details> --- # Changelog <!-- You can add an author after the `🆑` to change the name that appears in the changelog (ex: `🆑 Death`) Leaving it blank will default to your GitHub display name This includes all available types for the changelog --> 🆑 Toby222 and Will-Oliver-Br add: Add Number lookup to NanoChat --------- Co-authored-by: Tobias Berger <toby@tobot.dev> (cherry picked from commit c3b6aeda090719cf82b132dcadebbe035a0da45a)
63 lines
1.9 KiB
C#
63 lines
1.9 KiB
C#
using Content.Shared.DeltaV.CartridgeLoader.Cartridges;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Shared.DeltaV.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>
|
|
/// All chat recipients stored on this card.
|
|
/// </summary>
|
|
[DataField]
|
|
public Dictionary<uint, NanoChatRecipient> Recipients = new();
|
|
|
|
/// <summary>
|
|
/// All messages stored on this card, keyed by recipient number.
|
|
/// </summary>
|
|
[DataField]
|
|
public Dictionary<uint, List<NanoChatMessage>> Messages = new();
|
|
|
|
/// <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>
|
|
/// The PDA that this card is currently inserted to.
|
|
/// </summary>
|
|
[DataField]
|
|
public EntityUid? PdaUid = null;
|
|
/// Whether the card's number should be listed in NanoChat's lookup
|
|
/// </summary>
|
|
[DataField]
|
|
public bool ListNumber = true;
|
|
}
|