Fix PDA capitalization to be PascalCase (#17335)
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.PDA;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAToggleFlashlightMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDAToggleFlashlightMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAShowRingtoneMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDAShowRingtoneMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAShowUplinkMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDAShowUplinkMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDALockUplinkMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDALockUplinkMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAShowMusicMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDAShowMusicMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDARequestUpdateInterfaceMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDARequestUpdateInterfaceMessage() { }
|
||||
}
|
||||
@@ -7,10 +7,10 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
|
||||
namespace Content.Shared.PDA
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class PDAComponent : Component
|
||||
public sealed class PdaComponent : Component
|
||||
{
|
||||
public const string PDAIdSlotId = "PDA-id";
|
||||
public const string PDAPenSlotId = "PDA-pen";
|
||||
public const string PdaIdSlotId = "PDA-id";
|
||||
public const string PdaPenSlotId = "PDA-pen";
|
||||
|
||||
/// <summary>
|
||||
/// The base PDA sprite state, eg. "pda", "pda-clown"
|
||||
@@ -30,7 +30,7 @@ namespace Content.Shared.PDA
|
||||
[DataField("id", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string? IdCard;
|
||||
|
||||
[ViewVariables] public IdCardComponent? ContainedID;
|
||||
[ViewVariables] public IdCardComponent? ContainedId;
|
||||
[ViewVariables] public bool FlashlightOn;
|
||||
|
||||
[ViewVariables] public string? OwnerName;
|
||||
39
Content.Shared/PDA/PdaMessagesUi.cs
Normal file
39
Content.Shared/PDA/PdaMessagesUi.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.PDA;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PdaToggleFlashlightMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PdaToggleFlashlightMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PdaShowRingtoneMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PdaShowRingtoneMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PdaShowUplinkMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PdaShowUplinkMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PdaLockUplinkMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PdaLockUplinkMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PdaShowMusicMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PdaShowMusicMessage() { }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PdaRequestUpdateInterfaceMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PdaRequestUpdateInterfaceMessage() { }
|
||||
}
|
||||
@@ -5,23 +5,23 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.PDA
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAUpdateState : CartridgeLoaderUiState
|
||||
public sealed class PdaUpdateState : CartridgeLoaderUiState
|
||||
{
|
||||
public bool FlashlightEnabled;
|
||||
public bool HasPen;
|
||||
public PDAIdInfoText PDAOwnerInfo;
|
||||
public PdaIdInfoText PdaOwnerInfo;
|
||||
public string? StationName;
|
||||
public bool HasUplink;
|
||||
public bool CanPlayMusic;
|
||||
public string? Address;
|
||||
|
||||
public PDAUpdateState(bool flashlightEnabled, bool hasPen, PDAIdInfoText pdaOwnerInfo,
|
||||
public PdaUpdateState(bool flashlightEnabled, bool hasPen, PdaIdInfoText pdaOwnerInfo,
|
||||
string? stationName, bool hasUplink = false,
|
||||
bool canPlayMusic = false, string? address = null)
|
||||
{
|
||||
FlashlightEnabled = flashlightEnabled;
|
||||
HasPen = hasPen;
|
||||
PDAOwnerInfo = pdaOwnerInfo;
|
||||
PdaOwnerInfo = pdaOwnerInfo;
|
||||
HasUplink = hasUplink;
|
||||
CanPlayMusic = canPlayMusic;
|
||||
StationName = stationName;
|
||||
@@ -30,7 +30,7 @@ namespace Content.Shared.PDA
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public struct PDAIdInfoText
|
||||
public struct PdaIdInfoText
|
||||
{
|
||||
public string? ActualOwnerName;
|
||||
public string? IdOwner;
|
||||
@@ -3,13 +3,13 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.PDA
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public enum PDAVisuals
|
||||
public enum PdaVisuals
|
||||
{
|
||||
IDCardInserted
|
||||
IdCardInserted
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum PDAUiKey
|
||||
public enum PdaUiKey
|
||||
{
|
||||
Key
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Shared.PDA
|
||||
{
|
||||
public abstract class SharedPDASystem : EntitySystem
|
||||
public abstract class SharedPdaSystem : EntitySystem
|
||||
{
|
||||
[Dependency] protected readonly ItemSlotsSystem ItemSlotsSystem = default!;
|
||||
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
||||
@@ -13,49 +13,49 @@ namespace Content.Shared.PDA
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<PDAComponent, ComponentInit>(OnComponentInit);
|
||||
SubscribeLocalEvent<PDAComponent, ComponentRemove>(OnComponentRemove);
|
||||
SubscribeLocalEvent<PdaComponent, ComponentInit>(OnComponentInit);
|
||||
SubscribeLocalEvent<PdaComponent, ComponentRemove>(OnComponentRemove);
|
||||
|
||||
SubscribeLocalEvent<PDAComponent, EntInsertedIntoContainerMessage>(OnItemInserted);
|
||||
SubscribeLocalEvent<PDAComponent, EntRemovedFromContainerMessage>(OnItemRemoved);
|
||||
SubscribeLocalEvent<PdaComponent, EntInsertedIntoContainerMessage>(OnItemInserted);
|
||||
SubscribeLocalEvent<PdaComponent, EntRemovedFromContainerMessage>(OnItemRemoved);
|
||||
}
|
||||
|
||||
protected virtual void OnComponentInit(EntityUid uid, PDAComponent pda, ComponentInit args)
|
||||
protected virtual void OnComponentInit(EntityUid uid, PdaComponent pda, ComponentInit args)
|
||||
{
|
||||
if (pda.IdCard != null)
|
||||
pda.IdSlot.StartingItem = pda.IdCard;
|
||||
|
||||
ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAIdSlotId, pda.IdSlot);
|
||||
ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAPenSlotId, pda.PenSlot);
|
||||
ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaIdSlotId, pda.IdSlot);
|
||||
ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaPenSlotId, pda.PenSlot);
|
||||
|
||||
UpdatePdaAppearance(uid, pda);
|
||||
}
|
||||
|
||||
private void OnComponentRemove(EntityUid uid, PDAComponent pda, ComponentRemove args)
|
||||
private void OnComponentRemove(EntityUid uid, PdaComponent pda, ComponentRemove args)
|
||||
{
|
||||
ItemSlotsSystem.RemoveItemSlot(uid, pda.IdSlot);
|
||||
ItemSlotsSystem.RemoveItemSlot(uid, pda.PenSlot);
|
||||
}
|
||||
|
||||
protected virtual void OnItemInserted(EntityUid uid, PDAComponent pda, EntInsertedIntoContainerMessage args)
|
||||
protected virtual void OnItemInserted(EntityUid uid, PdaComponent pda, EntInsertedIntoContainerMessage args)
|
||||
{
|
||||
if (args.Container.ID == PDAComponent.PDAIdSlotId)
|
||||
pda.ContainedID = CompOrNull<IdCardComponent>(args.Entity);
|
||||
if (args.Container.ID == PdaComponent.PdaIdSlotId)
|
||||
pda.ContainedId = CompOrNull<IdCardComponent>(args.Entity);
|
||||
|
||||
UpdatePdaAppearance(uid, pda);
|
||||
}
|
||||
|
||||
protected virtual void OnItemRemoved(EntityUid uid, PDAComponent pda, EntRemovedFromContainerMessage args)
|
||||
protected virtual void OnItemRemoved(EntityUid uid, PdaComponent pda, EntRemovedFromContainerMessage args)
|
||||
{
|
||||
if (args.Container.ID == pda.IdSlot.ID)
|
||||
pda.ContainedID = null;
|
||||
pda.ContainedId = null;
|
||||
|
||||
UpdatePdaAppearance(uid, pda);
|
||||
}
|
||||
|
||||
private void UpdatePdaAppearance(EntityUid uid, PDAComponent pda)
|
||||
private void UpdatePdaAppearance(EntityUid uid, PdaComponent pda)
|
||||
{
|
||||
Appearance.SetData(uid, PDAVisuals.IDCardInserted, pda.ContainedID != null);
|
||||
Appearance.SetData(uid, PdaVisuals.IdCardInserted, pda.ContainedId != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user