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:
@@ -149,6 +149,12 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
|||||||
|
|
||||||
foreach (var instrument in EntityManager.EntityQuery<InstrumentComponent>(true))
|
foreach (var instrument in EntityManager.EntityQuery<InstrumentComponent>(true))
|
||||||
{
|
{
|
||||||
|
if (instrument.DirtyRenderer)
|
||||||
|
{
|
||||||
|
instrument.Dirty();
|
||||||
|
instrument.DirtyRenderer = false;
|
||||||
|
}
|
||||||
|
|
||||||
if ((instrument.BatchesDropped >= MaxMidiBatchesDropped
|
if ((instrument.BatchesDropped >= MaxMidiBatchesDropped
|
||||||
|| instrument.LaggedBatches >= MaxMidiLaggedBatches)
|
|| instrument.LaggedBatches >= MaxMidiLaggedBatches)
|
||||||
&& instrument.InstrumentPlayer != null && instrument.RespectMidiLimits)
|
&& instrument.InstrumentPlayer != null && instrument.RespectMidiLimits)
|
||||||
|
|||||||
@@ -20,19 +20,19 @@ public class SharedInstrumentComponent : Component
|
|||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public uint LastSequencerTick { get; set; }
|
public uint LastSequencerTick { get; set; }
|
||||||
|
|
||||||
[DataField("program")]
|
[DataField("program"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public byte InstrumentProgram { get; set; }
|
public byte InstrumentProgram { get; set; }
|
||||||
|
|
||||||
[DataField("bank")]
|
[DataField("bank"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public byte InstrumentBank { get; set; }
|
public byte InstrumentBank { get; set; }
|
||||||
|
|
||||||
[DataField("allowPercussion")]
|
[DataField("allowPercussion"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public bool AllowPercussion { get; set; }
|
public bool AllowPercussion { get; set; }
|
||||||
|
|
||||||
[DataField("allowProgramChange")]
|
[DataField("allowProgramChange"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public bool AllowProgramChange { get ; set; }
|
public bool AllowProgramChange { get ; set; }
|
||||||
|
|
||||||
[DataField("respectMidiLimits")]
|
[DataField("respectMidiLimits"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public bool RespectMidiLimits { get; set; }
|
public bool RespectMidiLimits { get; set; }
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
|||||||
Reference in New Issue
Block a user