Allow changing instrument style while playing them (#9946)
* Properly dirty changes when calling "SetInstrumentProgram" method * Allow using swappable instrument verbs even while playing the instrument. It's funnier this way
This commit is contained in:
committed by
GitHub
parent
16a08a60d0
commit
cb5f051be5
@@ -25,9 +25,6 @@ public sealed class SwappableInstrumentSystem : EntitySystem
|
|||||||
if (!TryComp<SharedInstrumentComponent>(uid, out var instrument))
|
if (!TryComp<SharedInstrumentComponent>(uid, out var instrument))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (instrument.Playing) //no changing while playing
|
|
||||||
return;
|
|
||||||
|
|
||||||
var priority = 0;
|
var priority = 0;
|
||||||
foreach (var entry in component.InstrumentList)
|
foreach (var entry in component.InstrumentList)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,8 +20,10 @@ public abstract class SharedInstrumentSystem : EntitySystem
|
|||||||
|
|
||||||
public void SetInstrumentProgram(SharedInstrumentComponent component, byte program, byte bank)
|
public void SetInstrumentProgram(SharedInstrumentComponent component, byte program, byte bank)
|
||||||
{
|
{
|
||||||
component.InstrumentProgram = program;
|
|
||||||
component.InstrumentBank = bank;
|
component.InstrumentBank = bank;
|
||||||
|
component.InstrumentProgram = program;
|
||||||
|
component.DirtyRenderer = true;
|
||||||
|
Dirty(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGetState(EntityUid uid, SharedInstrumentComponent instrument, ref ComponentGetState args)
|
private void OnGetState(EntityUid uid, SharedInstrumentComponent instrument, ref ComponentGetState args)
|
||||||
|
|||||||
Reference in New Issue
Block a user