Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow changing instrument style while playing them #9946

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Content.Server/Instruments/SwappableInstrumentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ private void AddStyleVerb(EntityUid uid, SwappableInstrumentComponent component,
if (!TryComp<SharedInstrumentComponent>(uid, out var instrument))
return;

if (instrument.Playing) //no changing while playing
return;

var priority = 0;
foreach (var entry in component.InstrumentList)
{
Expand Down
4 changes: 3 additions & 1 deletion Content.Shared/Instruments/SharedInstrumentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ public virtual void EndRenderer(EntityUid uid, bool fromStateChange, SharedInstr

public void SetInstrumentProgram(SharedInstrumentComponent component, byte program, byte bank)
{
component.InstrumentProgram = program;
component.InstrumentBank = bank;
component.InstrumentProgram = program;
component.DirtyRenderer = true;
Dirty(component);
}

private void OnGetState(EntityUid uid, SharedInstrumentComponent instrument, ref ComponentGetState args)
Expand Down