Makes tools and welders ECS, add ToolQualityPrototype. (#4741)
This commit is contained in:
committed by
GitHub
parent
f2760d0002
commit
365c7da4dc
28
Content.Client/Tools/ToolSystem.cs
Normal file
28
Content.Client/Tools/ToolSystem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Content.Client.Tools.Components;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Client.Tools
|
||||
{
|
||||
public class ToolSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<WelderComponent, ComponentHandleState>(OnWelderHandleState);
|
||||
}
|
||||
|
||||
private void OnWelderHandleState(EntityUid uid, WelderComponent welder, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not WelderComponentState state)
|
||||
return;
|
||||
|
||||
welder.FuelCapacity = state.FuelCapacity;
|
||||
welder.Fuel = state.Fuel;
|
||||
welder.Lit = state.Lit;
|
||||
welder.UiUpdateNeeded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user