plants inspection, resolve #449 (#615)

* plants inspection, resolve #449

* Update farming.ftl

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
This commit is contained in:
A.Ne.
2025-01-09 23:05:22 +04:00
committed by GitHub
parent 1af112aeb2
commit c3976dd08d
3 changed files with 17 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ using Content.Shared._CP14.Farming;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Damage;
using Content.Shared.Tag;
using Content.Shared.Examine;
using Content.Shared.Whitelist;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
@@ -46,6 +47,7 @@ public sealed partial class CP14FarmingSystem : CP14SharedFarmingSystem
SubscribeLocalEvent<CP14PlantComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<CP14PlantComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<CP14PlantAutoRootComponent, MapInitEvent>(OnAutoRootMapInit);
SubscribeLocalEvent<CP14PlantComponent, ExaminedEvent>(OnExamine);
}
public override void Update(float frameTime)
@@ -86,6 +88,15 @@ public sealed partial class CP14FarmingSystem : CP14SharedFarmingSystem
plant.Comp.NextUpdateTime = _timing.CurTime + TimeSpan.FromSeconds(newTime);
}
private void OnExamine(EntityUid uid, CP14PlantComponent component, ExaminedEvent args)
{
if (component.Energy <= 0)
args.PushMarkup(Loc.GetString("cp14-farming-low-energy"));
if (component.Resource <= 0)
args.PushMarkup(Loc.GetString("cp14-farming-low-resources"));
}
private void OnAutoRootMapInit(Entity<CP14PlantAutoRootComponent> autoRoot, ref MapInitEvent args)
{
var grid = Transform(autoRoot).GridUid;

View File

@@ -1 +1,3 @@
cp14-farming-soil-interact-plant-exist = There's already something planted here!
cp14-farming-soil-interact-plant-exist = There's already something planted here!
cp14-farming-low-energy = The plant looks wilted and shriveled.
cp14-farming-low-resources = The plant looks dry.

View File

@@ -1 +1,3 @@
cp14-farming-soil-interact-plant-exist = Здесь уже что-то посажено!
cp14-farming-soil-interact-plant-exist = Здесь уже что-то посажено!
cp14-farming-low-energy = Растение выглядит увядшим и сморщенным.
cp14-farming-low-resources = Растение выглядит сухим.