From 84a23568319772bd2f5640be54bc75e9f51cf30e Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Thu, 4 Jan 2024 07:56:14 -0500 Subject: [PATCH] Adding PAI Slot to PDA (#21086) * Adding PAI Slot to PDA * Update PdaComponent.cs * Update pda.yml * Update tags.yml Sorting it alphabetically * Adding PDA UI Elements. * Addressing reviews * Update PdaComponent.cs * Update Content.Shared/PDA/SharedPdaSystem.cs Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> * Update Content.Shared/PDA/SharedPdaSystem.cs Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> * Update Resources/Prototypes/Entities/Objects/Devices/pda.yml Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> * Update PdaComponent.cs * Update PdaComponent.cs --------- Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> --- Content.Client/PDA/PdaBoundUserInterface.cs | 5 +++++ Content.Client/PDA/PdaMenu.xaml | 1 + Content.Client/PDA/PdaMenu.xaml.cs | 4 +++- Content.Server/PDA/PdaSystem.cs | 3 ++- Content.Shared/PDA/PdaComponent.cs | 3 +++ Content.Shared/PDA/PdaUpdateState.cs | 3 +++ Content.Shared/PDA/SharedPdaSystem.cs | 2 ++ .../Prototypes/Entities/Objects/Devices/pda.yml | 6 ++++++ Resources/Textures/Interface/pai.png | Bin 0 -> 287 bytes 9 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 Resources/Textures/Interface/pai.png diff --git a/Content.Client/PDA/PdaBoundUserInterface.cs b/Content.Client/PDA/PdaBoundUserInterface.cs index 059d3c0aef..ef9d6e8b9b 100644 --- a/Content.Client/PDA/PdaBoundUserInterface.cs +++ b/Content.Client/PDA/PdaBoundUserInterface.cs @@ -40,6 +40,11 @@ namespace Content.Client.PDA SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPenSlotId)); }; + _menu.EjectPaiButton.OnPressed += _ => + { + SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPaiSlotId)); + }; + _menu.ActivateMusicButton.OnPressed += _ => { SendMessage(new PdaShowMusicMessage()); diff --git a/Content.Client/PDA/PdaMenu.xaml b/Content.Client/PDA/PdaMenu.xaml index 9f9dad6640..7ba72ea7f1 100644 --- a/Content.Client/PDA/PdaMenu.xaml +++ b/Content.Client/PDA/PdaMenu.xaml @@ -20,6 +20,7 @@ + /// The base PDA sprite state, eg. "pda", "pda-clown" @@ -23,6 +24,8 @@ namespace Content.Shared.PDA [DataField("penSlot")] public ItemSlot PenSlot = new(); + [DataField("paiSlot")] + public ItemSlot PaiSlot = new(); // Really this should just be using ItemSlot.StartingItem. However, seeing as we have so many different starting // PDA's and no nice way to inherit the other fields from the ItemSlot data definition, this makes the yaml much diff --git a/Content.Shared/PDA/PdaUpdateState.cs b/Content.Shared/PDA/PdaUpdateState.cs index c11b8e09f2..cf217ed9b2 100644 --- a/Content.Shared/PDA/PdaUpdateState.cs +++ b/Content.Shared/PDA/PdaUpdateState.cs @@ -10,6 +10,7 @@ namespace Content.Shared.PDA { public bool FlashlightEnabled; public bool HasPen; + public bool HasPai; public PdaIdInfoText PdaOwnerInfo; public string? StationName; public bool HasUplink; @@ -21,6 +22,7 @@ namespace Content.Shared.PDA NetEntity? activeUI, bool flashlightEnabled, bool hasPen, + bool hasPai, PdaIdInfoText pdaOwnerInfo, string? stationName, bool hasUplink = false, @@ -30,6 +32,7 @@ namespace Content.Shared.PDA { FlashlightEnabled = flashlightEnabled; HasPen = hasPen; + HasPai = hasPai; PdaOwnerInfo = pdaOwnerInfo; HasUplink = hasUplink; CanPlayMusic = canPlayMusic; diff --git a/Content.Shared/PDA/SharedPdaSystem.cs b/Content.Shared/PDA/SharedPdaSystem.cs index c9cb528f53..bd291a3843 100644 --- a/Content.Shared/PDA/SharedPdaSystem.cs +++ b/Content.Shared/PDA/SharedPdaSystem.cs @@ -28,6 +28,7 @@ namespace Content.Shared.PDA ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaIdSlotId, pda.IdSlot); ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaPenSlotId, pda.PenSlot); + ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaPaiSlotId, pda.PaiSlot); UpdatePdaAppearance(uid, pda); } @@ -36,6 +37,7 @@ namespace Content.Shared.PDA { ItemSlotsSystem.RemoveItemSlot(uid, pda.IdSlot); ItemSlotsSystem.RemoveItemSlot(uid, pda.PenSlot); + ItemSlotsSystem.RemoveItemSlot(uid, pda.PaiSlot); } protected virtual void OnItemInserted(EntityUid uid, PdaComponent pda, EntInsertedIntoContainerMessage args) diff --git a/Resources/Prototypes/Entities/Objects/Devices/pda.yml b/Resources/Prototypes/Entities/Objects/Devices/pda.yml index 54a2563c02..45832d9b74 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/pda.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/pda.yml @@ -23,6 +23,11 @@ state: pda - type: Pda state: pda + paiSlot: + priority: -2 + whitelist: + components: + - PAI penSlot: startingItem: Pen priority: -1 @@ -42,6 +47,7 @@ containers: PDA-id: !type:ContainerSlot {} PDA-pen: !type:ContainerSlot {} + PDA-pai: !type:ContainerSlot {} Cartridge-Slot: !type:ContainerSlot {} program-container: !type:Container - type: ItemSlots diff --git a/Resources/Textures/Interface/pai.png b/Resources/Textures/Interface/pai.png new file mode 100644 index 0000000000000000000000000000000000000000..aaa8c33243eae8451f601700fea7ef22d78a04b6 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij?1AIbU|NsBLYSpS~)21Cfc<}b^+f$}Y0m}3!I_>~c>?J{d!9WE-z#!$# z>;@F#EbxddW?