mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-06-09 10:06:34 +02:00
Expose access to more fields on AudioComponent (#6510)
Co-authored-by: mirrorcult <mirrorcult@pm.me>
This commit is contained in:
@@ -51,6 +51,7 @@ public sealed partial class AudioComponent : Component, IAudioSource
|
||||
|
||||
// We can't just start playing on audio creation as we don't have the correct position yet.
|
||||
// As such we'll wait for FrameUpdate before we start playing to avoid the position being cooked.
|
||||
[Access(Other = AccessPermissions.ReadWriteExecute)]
|
||||
public bool Started = false;
|
||||
|
||||
[AutoNetworkedField]
|
||||
@@ -85,12 +86,15 @@ public sealed partial class AudioComponent : Component, IAudioSource
|
||||
|
||||
#region Source
|
||||
|
||||
[Access(Other = AccessPermissions.Execute)]
|
||||
public void Pause() => Source.Pause();
|
||||
|
||||
/// <inheritdoc />
|
||||
[Access(Other = AccessPermissions.Execute)]
|
||||
public void StartPlaying() => Source.StartPlaying();
|
||||
|
||||
/// <inheritdoc />
|
||||
[Access(Other = AccessPermissions.Execute)]
|
||||
public void StopPlaying()
|
||||
{
|
||||
PlaybackPosition = 0f;
|
||||
@@ -98,6 +102,7 @@ public sealed partial class AudioComponent : Component, IAudioSource
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[Access(Other = AccessPermissions.Execute)]
|
||||
public void Restart() => Source.Restart();
|
||||
|
||||
[DataField, AutoNetworkedField]
|
||||
@@ -179,6 +184,7 @@ public sealed partial class AudioComponent : Component, IAudioSource
|
||||
/// Not replicated as audio always tracks the entity's position.
|
||||
/// </remarks>
|
||||
[ViewVariables]
|
||||
[Access(Other = AccessPermissions.ReadWriteExecute)]
|
||||
public Vector2 Position
|
||||
{
|
||||
get => Source.Position;
|
||||
@@ -236,6 +242,7 @@ public sealed partial class AudioComponent : Component, IAudioSource
|
||||
/// Not replicated.
|
||||
/// </remarks>
|
||||
[ViewVariables]
|
||||
[Access(Other = AccessPermissions.ReadWriteExecute)]
|
||||
public Vector2 Velocity
|
||||
{
|
||||
get => Source.Velocity;
|
||||
|
||||
Reference in New Issue
Block a user