Material Reclaimer (#14969)
* Material Reclaimer * Fix this test * autostack output, tweak volume, add upgrade examine * whitelist AND blacklist support why not * trying so hard to get this fucking test to work * EmoGarbage delves into MaterialArbitrageTest, never to return * VV and restore cloth to glory * make the system more robust * even more stuff has composition; add blacklist for important items * fix test fails * convert recycling * forgor :sadge: * lol * simply a modiCUM of doc commentary
This commit is contained in:
9
Content.Client/Materials/MaterialReclaimerSystem.cs
Normal file
9
Content.Client/Materials/MaterialReclaimerSystem.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Content.Shared.Materials;
|
||||
|
||||
namespace Content.Client.Materials;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
using Content.Shared.Conveyor;
|
||||
using Content.Shared.Recycling;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Client.Recycling
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class RecyclerVisualizer : AppearanceVisualizer
|
||||
{
|
||||
[DataField("state_on")]
|
||||
private string _stateOn = "grinder-o1";
|
||||
|
||||
[DataField("state_off")]
|
||||
private string _stateOff = "grinder-o0";
|
||||
|
||||
[Obsolete("Subscribe to your component being initialised instead.")]
|
||||
public override void InitializeEntity(EntityUid entity)
|
||||
{
|
||||
base.InitializeEntity(entity);
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entMan.TryGetComponent(entity, out SpriteComponent? sprite) ||
|
||||
!entMan.TryGetComponent(entity, out AppearanceComponent? appearance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateAppearance(appearance, sprite);
|
||||
}
|
||||
|
||||
[Obsolete("Subscribe to AppearanceChangeEvent instead.")]
|
||||
public override void OnChangeData(AppearanceComponent component)
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(component.Owner, out SpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateAppearance(component, sprite);
|
||||
}
|
||||
|
||||
private void UpdateAppearance(AppearanceComponent component, SpriteComponent sprite)
|
||||
{
|
||||
var state = _stateOff;
|
||||
if (component.TryGetData(ConveyorVisuals.State, out ConveyorState conveyorState) && conveyorState != ConveyorState.Off)
|
||||
{
|
||||
state = _stateOn;
|
||||
}
|
||||
|
||||
if (component.TryGetData(RecyclerVisuals.Bloody, out bool bloody) && bloody)
|
||||
{
|
||||
state += "bld";
|
||||
}
|
||||
|
||||
sprite.LayerSetState(RecyclerVisualLayers.Main, state);
|
||||
}
|
||||
}
|
||||
|
||||
public enum RecyclerVisualLayers : byte
|
||||
{
|
||||
Main
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user