Remove instruments compref (#19560)
This commit is contained in:
@@ -2,10 +2,7 @@ namespace Content.Shared.Instruments;
|
||||
|
||||
public abstract class SharedInstrumentSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<SharedInstrumentComponent, AfterAutoHandleStateEvent>(AfterHandleInstrumentState);
|
||||
}
|
||||
public abstract bool ResolveInstrument(EntityUid uid, ref SharedInstrumentComponent? component);
|
||||
|
||||
public virtual void SetupRenderer(EntityUid uid, bool fromStateChange, SharedInstrumentComponent? instrument = null)
|
||||
{
|
||||
@@ -21,12 +18,4 @@ public abstract class SharedInstrumentSystem : EntitySystem
|
||||
component.InstrumentProgram = program;
|
||||
Dirty(component);
|
||||
}
|
||||
|
||||
private void AfterHandleInstrumentState(EntityUid uid, SharedInstrumentComponent instrument, ref AfterAutoHandleStateEvent args)
|
||||
{
|
||||
if(instrument.Playing)
|
||||
SetupRenderer(uid, true, instrument);
|
||||
else
|
||||
EndRenderer(uid, true, instrument);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user