From dc9844edd1be8e1d9738a0a74712f60f9851e76d Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:32:11 -0400 Subject: [PATCH] Genpop Closets & IDs (#36392) * Genpop IDs and Lockers * placeholder generation, no ui yet. * UI * Fix time offset * fix meta.jsons * big speller * Scarkyo review * Add turnstile prototypes * make IDs recyclable --------- Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com> Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> --- Content.Client/Security/GenpopSystem.cs | 9 + .../Ui/GenpopLockerBoundUserInterface.cs | 36 + .../Security/Ui/GenpopLockerMenu.xaml | 24 + .../Security/Ui/GenpopLockerMenu.xaml.cs | 49 + Content.Server/Access/Systems/IdCardSystem.cs | 20 + Content.Server/Security/GenpopSystem.cs | 30 + .../Components/ExpireIdCardComponent.cs | 44 + .../Access/Systems/SharedIdCardSystem.cs | 48 + Content.Shared/Lock/LockComponent.cs | 7 + Content.Shared/Lock/LockSystem.cs | 10 +- .../Components/GenpopIdCardComponent.cs | 22 + .../Components/GenpopLockerComponent.cs | 47 + .../Security/Systems/SharedGenpopSystem.cs | 240 ++++ .../SharedEntityStorageComponent.cs | 2 +- .../SharedEntityStorageSystem.cs | 10 +- .../Locale/en-US/access/components/genpop.ftl | 28 + .../en-US/prototypes/access/accesses.ftl | 4 +- Resources/Prototypes/Access/misc.yml | 2 + Resources/Prototypes/Access/security.yml | 8 + .../Objects/Misc/identification_cards.yml | 34 + .../Objects/Tools/access_configurator.yml | 2 + .../Entities/Structures/Doors/turnstile.yml | 18 + .../Storage/Closets/Lockers/lockers.yml | 105 ++ .../Structures/Wallmounts/Signs/signs.yml | 9 + .../Structures/Storage/closet.rsi/genpop.png | Bin 0 -> 315 bytes .../Storage/closet.rsi/genpop_door_1.png | Bin 0 -> 379 bytes .../Storage/closet.rsi/genpop_door_2.png | Bin 0 -> 391 bytes .../Storage/closet.rsi/genpop_door_3.png | Bin 0 -> 393 bytes .../Storage/closet.rsi/genpop_door_4.png | Bin 0 -> 378 bytes .../Storage/closet.rsi/genpop_door_5.png | Bin 0 -> 391 bytes .../Storage/closet.rsi/genpop_door_6.png | Bin 0 -> 390 bytes .../Storage/closet.rsi/genpop_door_7.png | Bin 0 -> 380 bytes .../Storage/closet.rsi/genpop_door_8.png | Bin 0 -> 385 bytes .../Storage/closet.rsi/genpop_open.png | Bin 0 -> 303 bytes .../Structures/Storage/closet.rsi/meta.json | 1158 +++++++++-------- .../Wallmounts/signs.rsi/genpop.png | Bin 0 -> 390 bytes .../Structures/Wallmounts/signs.rsi/meta.json | 17 +- 37 files changed, 1403 insertions(+), 580 deletions(-) create mode 100644 Content.Client/Security/GenpopSystem.cs create mode 100644 Content.Client/Security/Ui/GenpopLockerBoundUserInterface.cs create mode 100644 Content.Client/Security/Ui/GenpopLockerMenu.xaml create mode 100644 Content.Client/Security/Ui/GenpopLockerMenu.xaml.cs create mode 100644 Content.Server/Security/GenpopSystem.cs create mode 100644 Content.Shared/Access/Components/ExpireIdCardComponent.cs create mode 100644 Content.Shared/Security/Components/GenpopIdCardComponent.cs create mode 100644 Content.Shared/Security/Components/GenpopLockerComponent.cs create mode 100644 Content.Shared/Security/Systems/SharedGenpopSystem.cs create mode 100644 Resources/Locale/en-US/access/components/genpop.ftl create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_1.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_2.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_3.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_4.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_5.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_6.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_7.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_door_8.png create mode 100644 Resources/Textures/Structures/Storage/closet.rsi/genpop_open.png create mode 100644 Resources/Textures/Structures/Wallmounts/signs.rsi/genpop.png diff --git a/Content.Client/Security/GenpopSystem.cs b/Content.Client/Security/GenpopSystem.cs new file mode 100644 index 0000000000..2f537cd96e --- /dev/null +++ b/Content.Client/Security/GenpopSystem.cs @@ -0,0 +1,9 @@ +using Content.Shared.Security.Systems; + +namespace Content.Client.Security; + +/// +public sealed class GenpopSystem : SharedGenpopSystem +{ + +} diff --git a/Content.Client/Security/Ui/GenpopLockerBoundUserInterface.cs b/Content.Client/Security/Ui/GenpopLockerBoundUserInterface.cs new file mode 100644 index 0000000000..a546fa6fc6 --- /dev/null +++ b/Content.Client/Security/Ui/GenpopLockerBoundUserInterface.cs @@ -0,0 +1,36 @@ +using Content.Shared.Security.Components; +using JetBrains.Annotations; + +namespace Content.Client.Security.Ui; + +[UsedImplicitly] +public sealed class GenpopLockerBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) +{ + private GenpopLockerMenu? _menu; + + protected override void Open() + { + base.Open(); + + _menu = new(Owner, EntMan); + + _menu.OnConfigurationComplete += (name, time, crime) => + { + SendMessage(new GenpopLockerIdConfiguredMessage(name, time, crime)); + Close(); + }; + + _menu.OnClose += Close; + _menu.OpenCentered(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) + return; + _menu?.Orphan(); + _menu = null; + } +} + diff --git a/Content.Client/Security/Ui/GenpopLockerMenu.xaml b/Content.Client/Security/Ui/GenpopLockerMenu.xaml new file mode 100644 index 0000000000..4eb670d25d --- /dev/null +++ b/Content.Client/Security/Ui/GenpopLockerMenu.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + +