Inline OwnerUid

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 16:30:34 +01:00
parent 2eacf98335
commit f386b57148
85 changed files with 219 additions and 215 deletions

View File

@@ -104,7 +104,7 @@ namespace Content.Client.Instruments.UI
await Task.WhenAll(Timer.Delay(100), file.CopyToAsync(memStream));
if (_owner.Instrument is not {} instrument
|| !EntitySystem.Get<InstrumentSystem>().OpenMidi(instrument.OwnerUid, memStream.GetBuffer().AsSpan(0, (int) memStream.Length), instrument))
|| !EntitySystem.Get<InstrumentSystem>().OpenMidi(((IComponent) instrument).Owner, memStream.GetBuffer().AsSpan(0, (int) memStream.Length), instrument))
return;
MidiPlaybackSetButtonsDisabled(false);
@@ -123,10 +123,10 @@ namespace Content.Client.Instruments.UI
MidiStopButtonOnPressed(null);
if(_owner.Instrument is {} instrument)
instrumentSystem.OpenInput(instrument.OwnerUid, instrument);
instrumentSystem.OpenInput(((IComponent) instrument).Owner, instrument);
}
else if(_owner.Instrument is {} instrument)
instrumentSystem.CloseInput(instrument.OwnerUid, false, instrument);
instrumentSystem.CloseInput(((IComponent) instrument).Owner, false, instrument);
}
private bool PlayCheck()
@@ -162,7 +162,7 @@ namespace Content.Client.Instruments.UI
if (_owner.Instrument is not { } instrument)
return;
EntitySystem.Get<InstrumentSystem>().CloseMidi(instrument.OwnerUid, false, instrument);
EntitySystem.Get<InstrumentSystem>().CloseMidi(((IComponent) instrument).Owner, false, instrument);
}
private void MidiLoopButtonOnOnToggled(ButtonToggledEventArgs obj)
@@ -179,14 +179,14 @@ namespace Content.Client.Instruments.UI
// Do not seek while still grabbing.
if (PlaybackSlider.Grabbed || _owner.Instrument is not {} instrument) return;
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(instrument.OwnerUid, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(((IComponent) instrument).Owner, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
}
private void PlaybackSliderKeyUp(GUIBoundKeyEventArgs args)
{
if (args.Function != EngineKeyFunctions.UIClick || _owner.Instrument is not {} instrument) return;
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(instrument.OwnerUid, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
EntitySystem.Get<InstrumentSystem>().SetPlayerTick(((IComponent) instrument).Owner, (int)Math.Ceiling(PlaybackSlider.Value), instrument);
}
protected override void FrameUpdate(FrameEventArgs args)