From 36b59c69f4849400e6d2b8e6027aec9f7a445834 Mon Sep 17 00:00:00 2001 From: "Ignaz \"Ian\" Kraft" Date: Sun, 9 Feb 2025 00:16:06 +0100 Subject: [PATCH] allow paper labels on seeds (#34450) * allow paper labels on seeds * added the components required by PaperLabel to the SeedBase * localize insert/eject for PaperLabel * visualize the paper label on seeds * new paper layer for seeds * eject the seed label on use * different looking paper label * forgot to turn on a layer --- .../Botany/Systems/BotanySystem.Seed.cs | 2 +- .../Botany/Systems/PlantHolderSystem.cs | 7 +++++ .../en-US/label/paper-label-component.ftl | 2 ++ .../Objects/Specific/Hydroponics/seeds.yml | 28 +++++++++++++++++- .../Objects/Specific/Medical/morgue.yml | 4 +-- .../Xenoarchaeology/artifact_equipment.yml | 4 +-- .../Storage/Closets/base_structureclosets.yml | 4 +-- .../Storage/Crates/base_structurecrates.yml | 4 +-- .../Specific/Hydroponics/seeds.rsi/meta.json | 5 +++- .../Specific/Hydroponics/seeds.rsi/paper.png | Bin 0 -> 750 bytes 10 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 Resources/Textures/Objects/Specific/Hydroponics/seeds.rsi/paper.png diff --git a/Content.Server/Botany/Systems/BotanySystem.Seed.cs b/Content.Server/Botany/Systems/BotanySystem.Seed.cs index 1487ed71d4..76421daf2e 100644 --- a/Content.Server/Botany/Systems/BotanySystem.Seed.cs +++ b/Content.Server/Botany/Systems/BotanySystem.Seed.cs @@ -84,7 +84,7 @@ public sealed partial class BotanySystem : EntitySystem if (!TryGetSeed(component, out var seed)) return; - using (args.PushGroup(nameof(SeedComponent))) + using (args.PushGroup(nameof(SeedComponent), 1)) { var name = Loc.GetString(seed.DisplayName); args.PushMarkup(Loc.GetString($"seed-component-description", ("seedName", name))); diff --git a/Content.Server/Botany/Systems/PlantHolderSystem.cs b/Content.Server/Botany/Systems/PlantHolderSystem.cs index 271acb606a..7eda4949a9 100644 --- a/Content.Server/Botany/Systems/PlantHolderSystem.cs +++ b/Content.Server/Botany/Systems/PlantHolderSystem.cs @@ -22,6 +22,8 @@ using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; +using Content.Server.Labels.Components; +using Content.Shared.Containers.ItemSlots; namespace Content.Server.Botany.Systems; @@ -39,6 +41,7 @@ public sealed class PlantHolderSystem : EntitySystem [Dependency] private readonly TagSystem _tagSystem = default!; [Dependency] private readonly RandomHelperSystem _randomHelper = default!; [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly ItemSlotsSystem _itemSlots = default!; public const float HydroponicsSpeedMultiplier = 1f; @@ -176,6 +179,10 @@ public sealed class PlantHolderSystem : EntitySystem } component.LastCycle = _gameTiming.CurTime; + if (TryComp(args.Used, out var paperLabel)) + { + _itemSlots.TryEjectToHands(args.Used, paperLabel.LabelSlot, args.User); + } QueueDel(args.Used); CheckLevelSanity(uid, component); diff --git a/Resources/Locale/en-US/label/paper-label-component.ftl b/Resources/Locale/en-US/label/paper-label-component.ftl index a62fc0244d..8b268596b0 100644 --- a/Resources/Locale/en-US/label/paper-label-component.ftl +++ b/Resources/Locale/en-US/label/paper-label-component.ftl @@ -1,3 +1,5 @@ comp-paper-label-has-label = There is a label attached, it reads: comp-paper-label-has-label-blank = There is a label attached, but it's blank. comp-paper-label-has-label-cant-read = There is a label attached, but you can't read it from this distance. +comp-paper-label-insert = Attach label +comp-paper-label-eject = Detach label diff --git a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml index 1ad3dd5bdf..bc78ab5911 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml @@ -6,11 +6,37 @@ - type: SolutionContainerManager - type: Sprite sprite: Objects/Specific/Hydroponics/seeds.rsi - state: seed + layers: + - state: seed + - state: paper + visible: false + map: ["enum.PaperLabelVisuals.Layer"] + sprite: Objects/Specific/Hydroponics/seeds.rsi + - type: Appearance + - type: GenericVisualizer + visuals: + enum.PaperLabelVisuals.HasLabel: + enum.PaperLabelVisuals.Layer: + True: { visible: true } + False: { visible: false } - type: Item size: Tiny - type: StaticPrice price: 20 + - type: ItemSlots + - type: ContainerContainer + containers: + paper_label: !type:ContainerSlot + - type: PaperLabel + labelSlot: + insertVerbText: comp-paper-label-insert + ejectVerbText: comp-paper-label-eject + whitelist: + components: + - Paper + blacklist: + tags: + - Book - type: entity parent: SeedBase diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml index d1085ff5de..6c42b8f59f 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml @@ -51,8 +51,8 @@ - type: EntityStorageLayingDownOverride - type: PaperLabel labelSlot: - insertVerbText: Attach Label - ejectVerbText: Remove Label + insertVerbText: comp-paper-label-insert + ejectVerbText: comp-paper-label-eject whitelist: components: - Paper diff --git a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml index a003ba9079..7053eda226 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml @@ -66,8 +66,8 @@ acts: ["Destruction"] - type: PaperLabel labelSlot: - insertVerbText: Attach Label - ejectVerbText: Remove Label + insertVerbText: comp-paper-label-insert + ejectVerbText: comp-paper-label-eject whitelist: components: - Paper diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml index 2568c45a6a..6777b0f638 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml @@ -26,8 +26,8 @@ - type: MovedByPressure - type: PaperLabel labelSlot: - insertVerbText: Attach Label - ejectVerbText: Remove Label + insertVerbText: comp-paper-label-insert + ejectVerbText: comp-paper-label-eject whitelist: components: - Paper diff --git a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml index 48804893ca..3e9a09be5a 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml @@ -72,8 +72,8 @@ Invoice: { state: invoice } - type: PaperLabel labelSlot: - insertVerbText: Attach Label - ejectVerbText: Remove Label + insertVerbText: comp-paper-label-insert + ejectVerbText: comp-paper-label-eject whitelist: components: - Paper diff --git a/Resources/Textures/Objects/Specific/Hydroponics/seeds.rsi/meta.json b/Resources/Textures/Objects/Specific/Hydroponics/seeds.rsi/meta.json index fc716313c8..bd5d13d6df 100644 --- a/Resources/Textures/Objects/Specific/Hydroponics/seeds.rsi/meta.json +++ b/Resources/Textures/Objects/Specific/Hydroponics/seeds.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at 1dbcf389b0ec6b2c51b002df5fef8dd1519f8068", + "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at 1dbcf389b0ec6b2c51b002df5fef8dd1519f8068, paper layer by Ian321", "size": { "x": 32, "y": 32 @@ -30,6 +30,9 @@ }, { "name": "seed-synthbrain" + }, + { + "name": "paper" } ] } diff --git a/Resources/Textures/Objects/Specific/Hydroponics/seeds.rsi/paper.png b/Resources/Textures/Objects/Specific/Hydroponics/seeds.rsi/paper.png new file mode 100644 index 0000000000000000000000000000000000000000..31a4559c1f864850c325088db2a7f85d034ccb75 GIT binary patch literal 750 zcmVEX>4Tx04R}tkv&MmKpe$iQ>8^J9qb_DkfAzR2QA`Qt5Adrp;l;yWphgA|?JWDYS_3;J6>}?mh0_0Ya# zo%23%gq3BL_?&pcpbHW|a$RxxjdRIifoDdHY-XM~LM)bgSm|L_HZ^gBRM1zJxlVHwDJ)_M5=1Cypn@ta#Aww?F_EGDq=$dR@k``V$W;L& z#{z25AUl5WKlt6PS)877lR`)s#Kpat9cGs>_D#NPe0^u?W1M(KqFRp<7^J&F!tTkJASrOI@XJfP+I| zyhPdS9`6qJ_V(|YPJchs8FJ0K*P0&y000JJOGiWi{{a60|De66lK=n!32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rk0tgT;2g|Ocng9R*>`6pHR9M69)xnB`Fc1ddU!xlm zg@}0qufG3-_yArOYGqF%7$#}7*~6Z`-!F>zv z`g8UazR#P$pX}TK;eLCjEZL)X-}hlz7AU3AG);17fUfJpFbt^c8X*K!RfV=~lehNt z3TrL2)+oyo&N+XE4UV zIfs<;;jMi-z?TpLS(d>$hjm@CZQH{>pAO)O2-7sddk-Rlwf4{z1jZPYQjk)DF$N+6 gfGvK}Q55~>7qWg^9YoBw?EnA(07*qoM6N<$f-?|Kp#T5? literal 0 HcmV?d00001