News UI overhaul and PDA notifications (#19610)
This commit is contained in:
@@ -10,6 +10,9 @@ namespace Content.Shared.CartridgeLoader;
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class CartridgeComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public EntityUid? LoaderUid;
|
||||
|
||||
[DataField(required: true)]
|
||||
public LocId ProgramName = "default-program-name";
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ public sealed partial class CartridgeLoaderComponent : Component
|
||||
{
|
||||
public const string CartridgeSlotId = "Cartridge-Slot";
|
||||
|
||||
[DataField("cartridgeSlot")]
|
||||
[DataField]
|
||||
public ItemSlot CartridgeSlot = new();
|
||||
|
||||
/// <summary>
|
||||
@@ -32,9 +32,16 @@ public sealed partial class CartridgeLoaderComponent : Component
|
||||
/// <summary>
|
||||
/// The maximum amount of programs that can be installed on the cartridge loader entity
|
||||
/// </summary>
|
||||
[DataField("diskSpace")]
|
||||
[DataField]
|
||||
public int DiskSpace = 5;
|
||||
|
||||
[DataField("uiKey", required: true)]
|
||||
/// <summary>
|
||||
/// Controls whether the cartridge loader will play notifications if it supports it at all
|
||||
/// TODO: Add an option for this to the PDA
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool NotificationsEnabled = true;
|
||||
|
||||
[DataField(required: true)]
|
||||
public Enum UiKey = default!;
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.CartridgeLoader.Cartridges;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class NewsReadUiMessageEvent : CartridgeMessageEvent
|
||||
{
|
||||
public readonly NewsReadUiAction Action;
|
||||
|
||||
public NewsReadUiMessageEvent(NewsReadUiAction action)
|
||||
{
|
||||
Action = action;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum NewsReadUiAction
|
||||
{
|
||||
Next,
|
||||
Prev,
|
||||
NotificationSwith
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.CartridgeLoader.Cartridges;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class NewsReaderUiMessageEvent : CartridgeMessageEvent
|
||||
{
|
||||
public readonly NewsReaderUiAction Action;
|
||||
|
||||
public NewsReaderUiMessageEvent(NewsReaderUiAction action)
|
||||
{
|
||||
Action = action;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum NewsReaderUiAction
|
||||
{
|
||||
Next,
|
||||
Prev,
|
||||
NotificationSwitch
|
||||
}
|
||||
@@ -4,14 +4,14 @@ using Content.Shared.MassMedia.Systems;
|
||||
namespace Content.Shared.CartridgeLoader.Cartridges;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class NewsReadBoundUserInterfaceState : BoundUserInterfaceState
|
||||
public sealed class NewsReaderBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public NewsArticle Article;
|
||||
public int TargetNum;
|
||||
public int TotalNum;
|
||||
public bool NotificationOn;
|
||||
|
||||
public NewsReadBoundUserInterfaceState(NewsArticle article, int targetNum, int totalNum, bool notificationOn)
|
||||
public NewsReaderBoundUserInterfaceState(NewsArticle article, int targetNum, int totalNum, bool notificationOn)
|
||||
{
|
||||
Article = article;
|
||||
TargetNum = targetNum;
|
||||
@@ -21,11 +21,11 @@ public sealed class NewsReadBoundUserInterfaceState : BoundUserInterfaceState
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class NewsReadEmptyBoundUserInterfaceState : BoundUserInterfaceState
|
||||
public sealed class NewsReaderEmptyBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public bool NotificationOn;
|
||||
|
||||
public NewsReadEmptyBoundUserInterfaceState(bool notificationOn)
|
||||
public NewsReaderEmptyBoundUserInterfaceState(bool notificationOn)
|
||||
{
|
||||
NotificationOn = notificationOn;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Network;
|
||||
|
||||
namespace Content.Shared.CartridgeLoader;
|
||||
|
||||
@@ -124,3 +123,11 @@ public sealed class CartridgeUiReadyEvent : EntityEventArgs
|
||||
Loader = loader;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets sent by the cartridge loader system to the cartridge loader entity so another system
|
||||
/// can handle displaying the notification
|
||||
/// </summary>
|
||||
/// <param name="Message">The message to be displayed</param>
|
||||
[ByRefEvent]
|
||||
public record struct CartridgeLoaderNotificationSentEvent(string Header, string Message);
|
||||
|
||||
Reference in New Issue
Block a user