[ADD] "Паспорт в ПДА" (#423)

* [ADD] "Паспорт в ПДА"

* Apply suggestions from code reviegfdw

gfd

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>

* Create pda-component.ftl

* Create pda-component.ftl

* Update pda-component.ftl

* Update pda-component.ftl

* Apply suggestions from code review

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>

* Update pda.yml

* фикс йопт

---------

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
This commit is contained in:
Kutosss
2025-04-07 21:34:56 +03:00
committed by GitHub
parent 01a020742a
commit d290f7a55e
10 changed files with 35 additions and 1 deletions

View File

@@ -50,6 +50,12 @@ namespace Content.Client.PDA
SendPredictedMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPaiSlotId));
};
// WD EDIT START
_menu.EjectPassportButton.OnPressed += _ =>
{
SendPredictedMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPassportSlotId));
};
// WD EDIT END
_menu.ActivateMusicButton.OnPressed += _ =>
{
SendMessage(new PdaShowMusicMessage());

View File

@@ -21,6 +21,7 @@
<pda:PdaNavigationButton Name="EjectPenButton" Access="Public" SetWidth="32"/>
<pda:PdaNavigationButton Name="EjectIdButton" Access="Public" SetWidth="32"/>
<pda:PdaNavigationButton Name="EjectPaiButton" Access="Public" SetWidth="32"/>
<pda:PdaNavigationButton Name="EjectPassportButton" Access="Public" SetWidth="32"/> <!-- WD EDIT -->
</BoxContainer>
<BoxContainer Name="ViewContainer" HorizontalExpand="True" VerticalExpand="True" Access="Public">
<BoxContainer Orientation="Vertical"

View File

@@ -52,6 +52,7 @@ namespace Content.Client.PDA
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"));
EjectPassportButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/eject.png")); // WD EDIT
ProgramCloseButton.IconTexture = new SpriteSpecifier.Texture(new("/Textures/Interface/Nano/cross.svg.png"));
@@ -188,6 +189,7 @@ namespace Content.Client.PDA
EjectIdButton.IsActive = state.PdaOwnerInfo.IdOwner != null || state.PdaOwnerInfo.JobTitle != null;
EjectPenButton.IsActive = state.HasPen;
EjectPaiButton.IsActive = state.HasPai;
EjectPassportButton.IsActive = state.HasPassport; // WD EDIT
ActivateMusicButton.Visible = state.CanPlayMusic;
ShowUplinkButton.Visible = state.HasUplink;
LockUplinkButton.Visible = state.HasUplink;

View File

@@ -77,7 +77,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 && args.Container.ID != pda.PaiSlot.ID)
if (args.Container.ID != pda.IdSlot.ID && args.Container.ID != pda.PenSlot.ID && args.Container.ID != pda.PaiSlot.ID && args.Container.ID != pda.PassportSlot.ID) // WD EDIT
return;
// TODO: This is super cursed just use compstates please.
@@ -173,6 +173,7 @@ namespace Content.Server.PDA
pda.FlashlightOn,
pda.PenSlot.HasItem,
pda.PaiSlot.HasItem,
pda.PassportSlot.HasItem, // WD EDIT
new PdaIdInfoText
{
ActualOwnerName = pda.OwnerName,

View File

@@ -12,6 +12,7 @@ namespace Content.Shared.PDA
public const string PdaIdSlotId = "PDA-id";
public const string PdaPenSlotId = "PDA-pen";
public const string PdaPaiSlotId = "PDA-pai";
public const string PdaPassportSlotId = "PDA-passport"; // WD EDIT
/// <summary>
/// The base PDA sprite state, eg. "pda", "pda-clown"
@@ -24,9 +25,15 @@ namespace Content.Shared.PDA
[DataField("penSlot")]
public ItemSlot PenSlot = new();
[DataField("paiSlot")]
public ItemSlot PaiSlot = new();
// WD EDIT START
[DataField("passportSlot")]
public ItemSlot PassportSlot = new();
// WD EDIT END
// 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
// nicer to read.

View File

@@ -11,6 +11,7 @@ namespace Content.Shared.PDA
public bool FlashlightEnabled;
public bool HasPen;
public bool HasPai;
public bool HasPassport; // WD EDIT
public PdaIdInfoText PdaOwnerInfo;
public string? StationName;
public bool HasUplink;
@@ -23,6 +24,7 @@ namespace Content.Shared.PDA
bool flashlightEnabled,
bool hasPen,
bool hasPai,
bool hasPassport, // WD EDIT
PdaIdInfoText pdaOwnerInfo,
string? stationName,
bool hasUplink = false,
@@ -33,6 +35,7 @@ namespace Content.Shared.PDA
FlashlightEnabled = flashlightEnabled;
HasPen = hasPen;
HasPai = hasPai;
HasPassport = hasPassport; // WD EDIT
PdaOwnerInfo = pdaOwnerInfo;
HasUplink = hasUplink;
CanPlayMusic = canPlayMusic;

View File

@@ -29,6 +29,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);
ItemSlotsSystem.AddItemSlot(uid, PdaComponent.PdaPassportSlotId, pda.PassportSlot); // WD EDIT
UpdatePdaAppearance(uid, pda);
}
@@ -38,6 +39,7 @@ namespace Content.Shared.PDA
ItemSlotsSystem.RemoveItemSlot(uid, pda.IdSlot);
ItemSlotsSystem.RemoveItemSlot(uid, pda.PenSlot);
ItemSlotsSystem.RemoveItemSlot(uid, pda.PaiSlot);
ItemSlotsSystem.RemoveItemSlot(uid, pda.PassportSlot); // WD EDIT
}
protected virtual void OnItemInserted(EntityUid uid, PdaComponent pda, EntInsertedIntoContainerMessage args)

View File

@@ -0,0 +1 @@
comp-pda-ui-eject-passport-button = Eject Passport

View File

@@ -0,0 +1 @@
comp-pda-ui-eject-passport-button = Извлечь паспорт

View File

@@ -41,6 +41,15 @@
whitelist:
components:
- IdCard
# WD EDIT START
passportSlot:
priority: -1
ejectSound: /Audio/Machines/id_swipe.ogg
insertSound: /Audio/Machines/id_insert.ogg
whitelist:
components:
- Passport
# WD EDIT END
- type: Item
size: Small
- type: ContainerContainer
@@ -48,6 +57,7 @@
PDA-id: !type:ContainerSlot {}
PDA-pen: !type:ContainerSlot {}
PDA-pai: !type:ContainerSlot {}
PDA-passport: !type:ContainerSlot {} # WD EDIT
Cartridge-Slot: !type:ContainerSlot {}
program-container: !type:Container
- type: ItemSlots