forked from Simple-Station/Einstein-Engines
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Simple-Station#387 from FoxxoTrystan/vore-update
The "VORE" Update
- Loading branch information
Showing
21 changed files
with
621 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Content.Shared.FloofStation; | ||
using Robust.Shared.Audio.Systems; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client.Floofstation; | ||
|
||
public sealed partial class VoredSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedAudioSystem _audio = default!; | ||
[Dependency] private readonly ISharedPlayerManager _playerMan = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<VoredComponent, ComponentInit>(OnInit); | ||
SubscribeLocalEvent<VoredComponent, ComponentShutdown>(Onhutdown); | ||
SubscribeLocalEvent<VoredComponent, LocalPlayerAttachedEvent>(OnPlayerAttached); | ||
SubscribeLocalEvent<VoredComponent, LocalPlayerDetachedEvent>(OnPlayerDetached); | ||
} | ||
|
||
private void OnInit(EntityUid uid, VoredComponent component, ComponentInit args) | ||
{ | ||
if (uid != _playerMan.LocalEntity) | ||
return; | ||
|
||
component.Stream = _audio.PlayGlobal(component.SoundBelly, Filter.Local(), false)?.Entity; | ||
} | ||
|
||
private void Onhutdown(EntityUid uid, VoredComponent component, ComponentShutdown args) | ||
{ | ||
if (uid != _playerMan.LocalEntity) | ||
return; | ||
|
||
QueueDel(component.Stream); | ||
} | ||
|
||
private void OnPlayerAttached(EntityUid uid, VoredComponent component, LocalPlayerAttachedEvent args) | ||
{ | ||
component.Stream = _audio.PlayGlobal(component.SoundBelly, Filter.Local(), false)?.Entity; | ||
} | ||
|
||
private void OnPlayerDetached(EntityUid uid, VoredComponent component, LocalPlayerDetachedEvent args) | ||
{ | ||
QueueDel(component.Stream); | ||
} | ||
} |
Oops, something went wrong.