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
This commit is contained in:
committed by
GitHub
parent
5e3d744233
commit
36b59c69f4
@@ -84,7 +84,7 @@ public sealed partial class BotanySystem : EntitySystem
|
|||||||
if (!TryGetSeed(component, out var seed))
|
if (!TryGetSeed(component, out var seed))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (args.PushGroup(nameof(SeedComponent)))
|
using (args.PushGroup(nameof(SeedComponent), 1))
|
||||||
{
|
{
|
||||||
var name = Loc.GetString(seed.DisplayName);
|
var name = Loc.GetString(seed.DisplayName);
|
||||||
args.PushMarkup(Loc.GetString($"seed-component-description", ("seedName", name)));
|
args.PushMarkup(Loc.GetString($"seed-component-description", ("seedName", name)));
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ using Robust.Shared.Player;
|
|||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
using Content.Server.Labels.Components;
|
||||||
|
using Content.Shared.Containers.ItemSlots;
|
||||||
|
|
||||||
namespace Content.Server.Botany.Systems;
|
namespace Content.Server.Botany.Systems;
|
||||||
|
|
||||||
@@ -39,6 +41,7 @@ public sealed class PlantHolderSystem : EntitySystem
|
|||||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||||
[Dependency] private readonly RandomHelperSystem _randomHelper = default!;
|
[Dependency] private readonly RandomHelperSystem _randomHelper = default!;
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
|
[Dependency] private readonly ItemSlotsSystem _itemSlots = default!;
|
||||||
|
|
||||||
|
|
||||||
public const float HydroponicsSpeedMultiplier = 1f;
|
public const float HydroponicsSpeedMultiplier = 1f;
|
||||||
@@ -176,6 +179,10 @@ public sealed class PlantHolderSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
component.LastCycle = _gameTiming.CurTime;
|
component.LastCycle = _gameTiming.CurTime;
|
||||||
|
|
||||||
|
if (TryComp<PaperLabelComponent>(args.Used, out var paperLabel))
|
||||||
|
{
|
||||||
|
_itemSlots.TryEjectToHands(args.Used, paperLabel.LabelSlot, args.User);
|
||||||
|
}
|
||||||
QueueDel(args.Used);
|
QueueDel(args.Used);
|
||||||
|
|
||||||
CheckLevelSanity(uid, component);
|
CheckLevelSanity(uid, component);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
comp-paper-label-has-label = There is a label attached, it reads:
|
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-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-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
|
||||||
|
|||||||
@@ -6,11 +6,37 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Specific/Hydroponics/seeds.rsi
|
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
|
- type: Item
|
||||||
size: Tiny
|
size: Tiny
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 20
|
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
|
- type: entity
|
||||||
parent: SeedBase
|
parent: SeedBase
|
||||||
|
|||||||
@@ -51,8 +51,8 @@
|
|||||||
- type: EntityStorageLayingDownOverride
|
- type: EntityStorageLayingDownOverride
|
||||||
- type: PaperLabel
|
- type: PaperLabel
|
||||||
labelSlot:
|
labelSlot:
|
||||||
insertVerbText: Attach Label
|
insertVerbText: comp-paper-label-insert
|
||||||
ejectVerbText: Remove Label
|
ejectVerbText: comp-paper-label-eject
|
||||||
whitelist:
|
whitelist:
|
||||||
components:
|
components:
|
||||||
- Paper
|
- Paper
|
||||||
|
|||||||
@@ -66,8 +66,8 @@
|
|||||||
acts: ["Destruction"]
|
acts: ["Destruction"]
|
||||||
- type: PaperLabel
|
- type: PaperLabel
|
||||||
labelSlot:
|
labelSlot:
|
||||||
insertVerbText: Attach Label
|
insertVerbText: comp-paper-label-insert
|
||||||
ejectVerbText: Remove Label
|
ejectVerbText: comp-paper-label-eject
|
||||||
whitelist:
|
whitelist:
|
||||||
components:
|
components:
|
||||||
- Paper
|
- Paper
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
- type: MovedByPressure
|
- type: MovedByPressure
|
||||||
- type: PaperLabel
|
- type: PaperLabel
|
||||||
labelSlot:
|
labelSlot:
|
||||||
insertVerbText: Attach Label
|
insertVerbText: comp-paper-label-insert
|
||||||
ejectVerbText: Remove Label
|
ejectVerbText: comp-paper-label-eject
|
||||||
whitelist:
|
whitelist:
|
||||||
components:
|
components:
|
||||||
- Paper
|
- Paper
|
||||||
|
|||||||
@@ -72,8 +72,8 @@
|
|||||||
Invoice: { state: invoice }
|
Invoice: { state: invoice }
|
||||||
- type: PaperLabel
|
- type: PaperLabel
|
||||||
labelSlot:
|
labelSlot:
|
||||||
insertVerbText: Attach Label
|
insertVerbText: comp-paper-label-insert
|
||||||
ejectVerbText: Remove Label
|
ejectVerbText: comp-paper-label-eject
|
||||||
whitelist:
|
whitelist:
|
||||||
components:
|
components:
|
||||||
- Paper
|
- Paper
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"license": "CC-BY-SA-3.0",
|
"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": {
|
"size": {
|
||||||
"x": 32,
|
"x": 32,
|
||||||
"y": 32
|
"y": 32
|
||||||
@@ -30,6 +30,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "seed-synthbrain"
|
"name": "seed-synthbrain"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "paper"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 750 B |
Reference in New Issue
Block a user