[Add] EmitAmbientOnUIOpenComponent EmitSoundOnUICloseComponent - #1010
Open
ArZarLordOfMango wants to merge 1 commit into
Open
[Add] EmitAmbientOnUIOpenComponent EmitSoundOnUICloseComponent#1010ArZarLordOfMango wants to merge 1 commit into
ArZarLordOfMango wants to merge 1 commit into
Conversation
ReWAFFlution
suggested changes
Aug 3, 2026
Comment on lines
+205
to
+221
| private void HandleEmitAmbientOnUIOpen(EntityUid uid, EmitAmbientOnUIOpenComponent component, AfterActivatableUIOpenEvent args) { | ||
| if (_whitelistSystem.IsWhitelistFail(component.Blacklist, args.User)) | ||
| { | ||
| if (TryComp<AmbientSoundComponent>(uid, out var ambient)) | ||
| _ambient.SetAmbience(uid, true, ambient); | ||
| } | ||
| } | ||
|
|
||
| private void HandleEmitAmbientOnUIClose(EntityUid uid, EmitAmbientOnUIOpenComponent component, BoundUIClosedEvent args) { | ||
| if (TryComp<AmbientSoundComponent>(uid, out var ambient)) | ||
| _ambient.SetAmbience(uid, false, ambient); | ||
| } | ||
|
|
||
| private void HandleEmitSoundOnUIClose(EntityUid uid, EmitSoundOnUICloseComponent component, BoundUIClosedEvent args) { | ||
| if (_whitelistSystem.IsWhitelistFail(component.Blacklist, args.Actor)) | ||
| TryEmitSound(uid, component, args.Actor); | ||
| } |
There was a problem hiding this comment.
Entity<T> попробуй
TryComp заменить на Resolve , чище будет
Comment on lines
+57
to
+59
| SubscribeLocalEvent<EmitAmbientOnUIOpenComponent, AfterActivatableUIOpenEvent>(HandleEmitAmbientOnUIOpen); // CorvaxGoob | ||
| SubscribeLocalEvent<EmitAmbientOnUIOpenComponent, BoundUIClosedEvent>(HandleEmitAmbientOnUIClose); // CorvaxGoob | ||
| SubscribeLocalEvent<EmitSoundOnUICloseComponent, BoundUIClosedEvent>(HandleEmitSoundOnUIClose);// CorvaxGoob |
There was a problem hiding this comment.
Не легче CorvaxGoob-Start и Corvax-End поставить?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание PR
Добавлены два компонента.
EmitAmbientOnUIOpenComponent - переключает эмбиент компач при включение выключения уишки.
EmitSoundOnUICloseComponent - делает звук когда закрывают уишку.
Почему / Баланс
гм предложил, хули нет, можно много куда добавить, например электрозвуки в лкп там или смешной музон для автоматов.
Технические детали
Медиа
Требования
Критические изменения
Список изменений