* plants inspection, resolve #449 * Update farming.ftl --------- Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
cp14-farming-soil-interact-plant-exist = Здесь уже что-то посажено!
|
||||
cp14-farming-soil-interact-plant-exist = Здесь уже что-то посажено!
|
||||
cp14-farming-low-energy = Растение выглядит увядшим и сморщенным.
|
||||
cp14-farming-low-resources = Растение выглядит сухим.
|
||||
|
||||
Reference in New Issue
Block a user