-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
473a594
commit 739ba46
Showing
42 changed files
with
151 additions
and
341 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
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
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
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
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
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 |
---|---|---|
@@ -1,42 +1,44 @@ | ||
using Content.Server.Corvax.TTS; | ||
using Content.Shared.VoiceMask; | ||
|
||
namespace Content.Server.VoiceMask; | ||
|
||
public partial class VoiceMaskSystem | ||
{ | ||
private void InitializeTTS() | ||
{ | ||
SubscribeLocalEvent<VoiceMaskComponent, TransformSpeakerVoiceEvent>(OnSpeakerVoiceTransform); | ||
SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeVoiceMessage>(OnChangeVoice); | ||
} | ||
|
||
private void OnSpeakerVoiceTransform(EntityUid uid, VoiceMaskComponent component, TransformSpeakerVoiceEvent args) | ||
{ | ||
if (component.Enabled) | ||
args.VoiceId = component.VoiceId; | ||
} | ||
|
||
private void OnChangeVoice(EntityUid uid, VoiceMaskComponent component, VoiceMaskChangeVoiceMessage message) | ||
{ | ||
component.VoiceId = message.Voice; | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("voice-mask-voice-popup-success"), uid); | ||
|
||
TrySetLastKnownVoice(uid, message.Voice); | ||
|
||
UpdateUI(uid, component); | ||
} | ||
|
||
private void TrySetLastKnownVoice(EntityUid maskWearer, string? voiceId) | ||
{ | ||
if (!HasComp<VoiceMaskComponent>(maskWearer) | ||
|| !_inventory.TryGetSlotEntity(maskWearer, MaskSlot, out var maskEntity) | ||
|| !TryComp<VoiceMaskerComponent>(maskEntity, out var maskComp)) | ||
{ | ||
return; | ||
} | ||
|
||
maskComp.LastSetVoice = voiceId; | ||
} | ||
} | ||
// Я хз как заставить работать после этого: https://github.com/Simple-Station/Einstein-Engines/pull/1147 | ||
|
||
// using Content.Server.Corvax.TTS; | ||
// using Content.Shared.VoiceMask; | ||
|
||
// namespace Content.Server.VoiceMask; | ||
|
||
// public partial class VoiceMaskSystem | ||
// { | ||
// private void InitializeTTS() | ||
// { | ||
// SubscribeLocalEvent<VoiceMaskComponent, TransformSpeakerVoiceEvent>(OnSpeakerVoiceTransform); | ||
// SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeVoiceMessage>(OnChangeVoice); | ||
// } | ||
|
||
// private void OnSpeakerVoiceTransform(EntityUid uid, VoiceMaskComponent component, TransformSpeakerVoiceEvent args) | ||
// { | ||
// if (component.Enabled) | ||
// args.VoiceId = component.VoiceId; | ||
// } | ||
|
||
// private void OnChangeVoice(EntityUid uid, VoiceMaskComponent component, VoiceMaskChangeVoiceMessage message) | ||
// { | ||
// component.VoiceId = message.Voice; | ||
|
||
// _popupSystem.PopupEntity(Loc.GetString("voice-mask-voice-popup-success"), uid); | ||
|
||
// TrySetLastKnownVoice(uid, message.Voice); | ||
|
||
// UpdateUI(uid, component); | ||
// } | ||
|
||
// private void TrySetLastKnownVoice(EntityUid maskWearer, string? voiceId) | ||
// { | ||
// if (!HasComp<VoiceMaskComponent>(maskWearer) | ||
// || !_inventory.TryGetSlotEntity(maskWearer, MaskSlot, out var maskEntity) | ||
// || !TryComp<VoiceMaskerComponent>(maskEntity, out var maskComp)) | ||
// { | ||
// return; | ||
// } | ||
|
||
// maskComp.LastSetVoice = voiceId; | ||
// } | ||
// } |
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
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
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
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
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
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
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
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
Oops, something went wrong.