Allow admins to change instrument values with VV.

Just set DirtyRenderer to true after your changes are done, on the server.
This commit is contained in:
Vera Aguilera Puerto
2021-12-25 02:02:14 +01:00
parent 267d7193f4
commit cdc1a70c03
2 changed files with 11 additions and 5 deletions

View File

@@ -149,6 +149,12 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
foreach (var instrument in EntityManager.EntityQuery<InstrumentComponent>(true))
{
if (instrument.DirtyRenderer)
{
instrument.Dirty();
instrument.DirtyRenderer = false;
}
if ((instrument.BatchesDropped >= MaxMidiBatchesDropped
|| instrument.LaggedBatches >= MaxMidiLaggedBatches)
&& instrument.InstrumentPlayer != null && instrument.RespectMidiLimits)

View File

@@ -20,19 +20,19 @@ public class SharedInstrumentComponent : Component
[ViewVariables]
public uint LastSequencerTick { get; set; }
[DataField("program")]
[DataField("program"), ViewVariables(VVAccess.ReadWrite)]
public byte InstrumentProgram { get; set; }
[DataField("bank")]
[DataField("bank"), ViewVariables(VVAccess.ReadWrite)]
public byte InstrumentBank { get; set; }
[DataField("allowPercussion")]
[DataField("allowPercussion"), ViewVariables(VVAccess.ReadWrite)]
public bool AllowPercussion { get; set; }
[DataField("allowProgramChange")]
[DataField("allowProgramChange"), ViewVariables(VVAccess.ReadWrite)]
public bool AllowProgramChange { get ; set; }
[DataField("respectMidiLimits")]
[DataField("respectMidiLimits"), ViewVariables(VVAccess.ReadWrite)]
public bool RespectMidiLimits { get; set; }
[ViewVariables(VVAccess.ReadWrite)]