Refactor all references to AudioSystem functions now that the old ones are obsolete. (#1081)
Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
This commit is contained in:
@@ -68,7 +68,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
return false;
|
||||
}
|
||||
|
||||
EntitySystem.Get<AudioSystem>().Play("/Audio/items/weapons/pistol_magin.ogg", Owner);
|
||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/items/weapons/pistol_magin.ogg", Owner);
|
||||
|
||||
|
||||
Dirty();
|
||||
@@ -132,7 +132,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
SetState(false);
|
||||
Activated = false;
|
||||
|
||||
EntitySystem.Get<AudioSystem>().Play("/Audio/items/flashlight_toggle.ogg", Owner);
|
||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/items/flashlight_toggle.ogg", Owner);
|
||||
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
if (cell == null)
|
||||
{
|
||||
|
||||
EntitySystem.Get<AudioSystem>().Play("/Audio/machines/button.ogg", Owner);
|
||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/machines/button.ogg", Owner);
|
||||
|
||||
_notifyManager.PopupMessage(Owner, user, _localizationManager.GetString("Cell missing..."));
|
||||
return;
|
||||
@@ -158,7 +158,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
// Simple enough.
|
||||
if (cell.AvailableCharge(1) < Wattage)
|
||||
{
|
||||
EntitySystem.Get<AudioSystem>().Play("/Audio/machines/button.ogg", Owner);
|
||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/machines/button.ogg", Owner);
|
||||
_notifyManager.PopupMessage(Owner, user, _localizationManager.GetString("Dead cell..."));
|
||||
return;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
Activated = true;
|
||||
SetState(true);
|
||||
|
||||
EntitySystem.Get<AudioSystem>().Play("/Audio/items/flashlight_toggle.ogg", Owner);
|
||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/items/flashlight_toggle.ogg", Owner);
|
||||
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
cell.Owner.Transform.GridPosition = user.Transform.GridPosition;
|
||||
}
|
||||
|
||||
EntitySystem.Get<AudioSystem>().Play("/Audio/items/weapons/pistol_magout.ogg", Owner);
|
||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/items/weapons/pistol_magout.ogg", Owner);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
SetTool();
|
||||
var current = _tools[_currentTool];
|
||||
if(!string.IsNullOrEmpty(current.ChangeSound))
|
||||
_audioSystem.Play(current.ChangeSound, Owner);
|
||||
_audioSystem.PlayFromEntity(current.ChangeSound, Owner);
|
||||
}
|
||||
|
||||
private void SetTool()
|
||||
|
||||
@@ -127,13 +127,13 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(name);
|
||||
var file = _robustRandom.Pick(soundCollection.PickFiles);
|
||||
EntitySystem.Get<AudioSystem>()
|
||||
.Play(file, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
|
||||
.PlayFromEntity(file, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
|
||||
}
|
||||
|
||||
public void PlayUseSound(float volume=-5f)
|
||||
{
|
||||
if(string.IsNullOrEmpty(UseSoundCollection))
|
||||
_audioSystem.Play(UseSound, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
|
||||
_audioSystem.PlayFromEntity(UseSound, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
|
||||
else
|
||||
PlaySoundCollection(UseSoundCollection, volume);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user