Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow paper labels on seeds #34450

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Server/Botany/Systems/BotanySystem.Seed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void OnExamined(EntityUid uid, SeedComponent component, ExaminedEvent ar
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)));
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/Botany/Systems/PlantHolderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
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;

Expand All @@ -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;
Expand Down Expand Up @@ -176,6 +179,10 @@ private void OnInteractUsing(Entity<PlantHolderComponent> entity, ref InteractUs
}
component.LastCycle = _gameTiming.CurTime;

if (TryComp<PaperLabelComponent>(args.Used, out var paperLabel))
{
_itemSlots.TryEjectToHands(args.Used, paperLabel.LabelSlot, args.User);
}
QueueDel(args.Used);

CheckLevelSanity(uid, component);
Expand Down
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/label/paper-label-component.ftl
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -30,6 +30,9 @@
},
{
"name": "seed-synthbrain"
},
{
"name": "paper"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading