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>
This commit is contained in:
VMSolidus
2024-01-04 07:56:14 -05:00
committed by GitHub
parent b06d9cb64a
commit 84a2356831
9 changed files with 25 additions and 2 deletions

View File

@@ -40,6 +40,11 @@ namespace Content.Client.PDA
SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPenSlotId)); SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPenSlotId));
}; };
_menu.EjectPaiButton.OnPressed += _ =>
{
SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPaiSlotId));
};
_menu.ActivateMusicButton.OnPressed += _ => _menu.ActivateMusicButton.OnPressed += _ =>
{ {
SendMessage(new PdaShowMusicMessage()); SendMessage(new PdaShowMusicMessage());

View File

@@ -20,6 +20,7 @@
<pda:PdaNavigationButton Name="FlashLightToggleButton" Access="Public" ToggleMode="True" ActiveFgColor="#EAEFBB" SetWidth="32"/> <pda:PdaNavigationButton Name="FlashLightToggleButton" Access="Public" ToggleMode="True" ActiveFgColor="#EAEFBB" SetWidth="32"/>
<pda:PdaNavigationButton Name="EjectPenButton" Access="Public" SetWidth="32"/> <pda:PdaNavigationButton Name="EjectPenButton" Access="Public" SetWidth="32"/>
<pda:PdaNavigationButton Name="EjectIdButton" Access="Public" SetWidth="32"/> <pda:PdaNavigationButton Name="EjectIdButton" Access="Public" SetWidth="32"/>
<pda:PdaNavigationButton Name="EjectPaiButton" Access="Public" SetWidth="32"/>
</BoxContainer> </BoxContainer>
<BoxContainer Name="ViewContainer" HorizontalExpand="True" VerticalExpand="True" Access="Public"> <BoxContainer Name="ViewContainer" HorizontalExpand="True" VerticalExpand="True" Access="Public">
<BoxContainer Orientation="Vertical" <BoxContainer Orientation="Vertical"

View File

@@ -1,4 +1,4 @@
using Content.Client.GameTicking.Managers; using Content.Client.GameTicking.Managers;
using Content.Shared.PDA; using Content.Shared.PDA;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Content.Shared.CartridgeLoader; using Content.Shared.CartridgeLoader;
@@ -41,6 +41,7 @@ namespace Content.Client.PDA
FlashLightToggleButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/light.png")); FlashLightToggleButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/light.png"));
EjectPenButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/pencil.png")); EjectPenButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/pencil.png"));
EjectIdButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/eject.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")); 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; EjectIdButton.IsActive = state.PdaOwnerInfo.IdOwner != null || state.PdaOwnerInfo.JobTitle != null;
EjectPenButton.IsActive = state.HasPen; EjectPenButton.IsActive = state.HasPen;
EjectPaiButton.IsActive = state.HasPai;
ActivateMusicButton.Visible = state.CanPlayMusic; ActivateMusicButton.Visible = state.CanPlayMusic;
ShowUplinkButton.Visible = state.HasUplink; ShowUplinkButton.Visible = state.HasUplink;
LockUplinkButton.Visible = state.HasUplink; LockUplinkButton.Visible = state.HasUplink;

View File

@@ -64,7 +64,7 @@ namespace Content.Server.PDA
protected override void OnItemRemoved(EntityUid uid, PdaComponent pda, EntRemovedFromContainerMessage args) 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; return;
// TODO: This is super cursed just use compstates please. // TODO: This is super cursed just use compstates please.
@@ -137,6 +137,7 @@ namespace Content.Server.PDA
GetNetEntity(loader.ActiveProgram), GetNetEntity(loader.ActiveProgram),
pda.FlashlightOn, pda.FlashlightOn,
pda.PenSlot.HasItem, pda.PenSlot.HasItem,
pda.PaiSlot.HasItem,
new PdaIdInfoText new PdaIdInfoText
{ {
ActualOwnerName = pda.OwnerName, ActualOwnerName = pda.OwnerName,

View File

@@ -11,6 +11,7 @@ namespace Content.Shared.PDA
{ {
public const string PdaIdSlotId = "PDA-id"; public const string PdaIdSlotId = "PDA-id";
public const string PdaPenSlotId = "PDA-pen"; public const string PdaPenSlotId = "PDA-pen";
public const string PdaPaiSlotId = "PDA-pai";
/// <summary> /// <summary>
/// The base PDA sprite state, eg. "pda", "pda-clown" /// The base PDA sprite state, eg. "pda", "pda-clown"
@@ -23,6 +24,8 @@ namespace Content.Shared.PDA
[DataField("penSlot")] [DataField("penSlot")]
public ItemSlot PenSlot = new(); 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 // 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 // PDA's and no nice way to inherit the other fields from the ItemSlot data definition, this makes the yaml much

View File

@@ -10,6 +10,7 @@ namespace Content.Shared.PDA
{ {
public bool FlashlightEnabled; public bool FlashlightEnabled;
public bool HasPen; public bool HasPen;
public bool HasPai;
public PdaIdInfoText PdaOwnerInfo; public PdaIdInfoText PdaOwnerInfo;
public string? StationName; public string? StationName;
public bool HasUplink; public bool HasUplink;
@@ -21,6 +22,7 @@ namespace Content.Shared.PDA
NetEntity? activeUI, NetEntity? activeUI,
bool flashlightEnabled, bool flashlightEnabled,
bool hasPen, bool hasPen,
bool hasPai,
PdaIdInfoText pdaOwnerInfo, PdaIdInfoText pdaOwnerInfo,
string? stationName, string? stationName,
bool hasUplink = false, bool hasUplink = false,
@@ -30,6 +32,7 @@ namespace Content.Shared.PDA
{ {
FlashlightEnabled = flashlightEnabled; FlashlightEnabled = flashlightEnabled;
HasPen = hasPen; HasPen = hasPen;
HasPai = hasPai;
PdaOwnerInfo = pdaOwnerInfo; PdaOwnerInfo = pdaOwnerInfo;
HasUplink = hasUplink; HasUplink = hasUplink;
CanPlayMusic = canPlayMusic; CanPlayMusic = canPlayMusic;

View File

@@ -28,6 +28,7 @@ namespace Content.Shared.PDA
ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaIdSlotId, pda.IdSlot); ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaIdSlotId, pda.IdSlot);
ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaPenSlotId, pda.PenSlot); ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaPenSlotId, pda.PenSlot);
ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaPaiSlotId, pda.PaiSlot);
UpdatePdaAppearance(uid, pda); UpdatePdaAppearance(uid, pda);
} }
@@ -36,6 +37,7 @@ namespace Content.Shared.PDA
{ {
ItemSlotsSystem.RemoveItemSlot(uid, pda.IdSlot); ItemSlotsSystem.RemoveItemSlot(uid, pda.IdSlot);
ItemSlotsSystem.RemoveItemSlot(uid, pda.PenSlot); ItemSlotsSystem.RemoveItemSlot(uid, pda.PenSlot);
ItemSlotsSystem.RemoveItemSlot(uid, pda.PaiSlot);
} }
protected virtual void OnItemInserted(EntityUid uid, PdaComponent pda, EntInsertedIntoContainerMessage args) protected virtual void OnItemInserted(EntityUid uid, PdaComponent pda, EntInsertedIntoContainerMessage args)

View File

@@ -23,6 +23,11 @@
state: pda state: pda
- type: Pda - type: Pda
state: pda state: pda
paiSlot:
priority: -2
whitelist:
components:
- PAI
penSlot: penSlot:
startingItem: Pen startingItem: Pen
priority: -1 priority: -1
@@ -42,6 +47,7 @@
containers: containers:
PDA-id: !type:ContainerSlot {} PDA-id: !type:ContainerSlot {}
PDA-pen: !type:ContainerSlot {} PDA-pen: !type:ContainerSlot {}
PDA-pai: !type:ContainerSlot {}
Cartridge-Slot: !type:ContainerSlot {} Cartridge-Slot: !type:ContainerSlot {}
program-container: !type:Container program-container: !type:Container
- type: ItemSlots - type: ItemSlots

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B