]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Adding PAI Slot to PDA (#21086)
authorVMSolidus <evilexecutive@gmail.com>
Thu, 4 Jan 2024 12:56:14 +0000 (07:56 -0500)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 12:56:14 +0000 (05:56 -0700)
* 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
Content.Client/PDA/PdaMenu.xaml
Content.Client/PDA/PdaMenu.xaml.cs
Content.Server/PDA/PdaSystem.cs
Content.Shared/PDA/PdaComponent.cs
Content.Shared/PDA/PdaUpdateState.cs
Content.Shared/PDA/SharedPdaSystem.cs
Resources/Prototypes/Entities/Objects/Devices/pda.yml
Resources/Textures/Interface/pai.png [new file with mode: 0644]

index 059d3c0aef9d9099bb05a92ebc48741433800649..ef9d6e8b9beb37652f2dccbcb08fa754408fcee8 100644 (file)
@@ -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());
index 9f9dad6640433755a0e27e36e8ce1ca3daa1a986..7ba72ea7f17f8b5e25deefafb746bec5db3f610f 100644 (file)
@@ -20,6 +20,7 @@
         <pda:PdaNavigationButton Name="FlashLightToggleButton" Access="Public" ToggleMode="True" ActiveFgColor="#EAEFBB" SetWidth="32"/>
         <pda:PdaNavigationButton Name="EjectPenButton" Access="Public" SetWidth="32"/>
         <pda:PdaNavigationButton Name="EjectIdButton" Access="Public" SetWidth="32"/>
+        <pda:PdaNavigationButton Name="EjectPaiButton" Access="Public" SetWidth="32"/>
     </BoxContainer>
     <BoxContainer Name="ViewContainer" HorizontalExpand="True" VerticalExpand="True" Access="Public">
         <BoxContainer Orientation="Vertical"
index e19c6710a2cdd2a893204fe91b20f7c3dbf3f3fb..1ab0e2c31802c849148b69a833549de7434d1b7a 100644 (file)
@@ -1,4 +1,4 @@
-using Content.Client.GameTicking.Managers;
+using Content.Client.GameTicking.Managers;
 using Content.Shared.PDA;
 using Robust.Shared.Utility;
 using Content.Shared.CartridgeLoader;
@@ -41,6 +41,7 @@ namespace Content.Client.PDA
             FlashLightToggleButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/light.png"));
             EjectPenButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/pencil.png"));
             EjectIdButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/eject.png"));
+            EjectPaiButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/PAI.png"));
             ProgramCloseButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/Nano/cross.svg.png"));
 
 
@@ -137,6 +138,7 @@ namespace Content.Client.PDA
 
             EjectIdButton.IsActive = state.PdaOwnerInfo.IdOwner != null || state.PdaOwnerInfo.JobTitle != null;
             EjectPenButton.IsActive = state.HasPen;
+            EjectPaiButton.IsActive = state.HasPai;
             ActivateMusicButton.Visible = state.CanPlayMusic;
             ShowUplinkButton.Visible = state.HasUplink;
             LockUplinkButton.Visible = state.HasUplink;
index 44e26598412a7e4dab2648759bee77f4b9093f18..4418f248847d50af4dcd2de4951be3ec5d3c8b78 100644 (file)
@@ -64,7 +64,7 @@ namespace Content.Server.PDA
 
         protected override void OnItemRemoved(EntityUid uid, PdaComponent pda, EntRemovedFromContainerMessage args)
         {
-            if (args.Container.ID != pda.IdSlot.ID && args.Container.ID != pda.PenSlot.ID)
+            if (args.Container.ID != pda.IdSlot.ID && args.Container.ID != pda.PenSlot.ID && args.Container.ID != pda.PaiSlot.ID)
                 return;
 
             // TODO: This is super cursed just use compstates please.
@@ -137,6 +137,7 @@ namespace Content.Server.PDA
                 GetNetEntity(loader.ActiveProgram),
                 pda.FlashlightOn,
                 pda.PenSlot.HasItem,
+                pda.PaiSlot.HasItem,
                 new PdaIdInfoText
                 {
                     ActualOwnerName = pda.OwnerName,
index d81fa1532fa7d4b348a88e56d16761e9146b16a8..d4cfc4fc0d8ebca351437bb65116da37193e4f78 100644 (file)
@@ -11,6 +11,7 @@ namespace Content.Shared.PDA
     {
         public const string PdaIdSlotId = "PDA-id";
         public const string PdaPenSlotId = "PDA-pen";
+        public const string PdaPaiSlotId = "PDA-pai";
 
         /// <summary>
         /// 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
index c11b8e09f2c490b876947bf23e6c9b816a446393..cf217ed9b25e8d17feb03757c81c9aadfba2463e 100644 (file)
@@ -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;
index c9cb528f5330a4f285cfd964501c78894f34ee6a..bd291a3843eb49b7d23c6d9512efc4287fa3525f 100644 (file)
@@ -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)
index 54a2563c029919aa724da108b68256ea8836f9aa..45832d9b7495a7d8cd500dfc0acb14bf41c9f87d 100644 (file)
     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 (file)
index 0000000..aaa8c33
Binary files /dev/null and b/Resources/Textures/Interface/pai.png differ