forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intercom buffs and fixes (space-wizards#29580)
* Intercom buffs and fixes * remove unused bui state * mild sec intercom buff * reinforce sec intercoms
- Loading branch information
1 parent
a00b6d0
commit 7ea1379
Showing
18 changed files
with
357 additions
and
127 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,23 @@ | ||
using Content.Client.Radio.Ui; | ||
using Content.Shared.Radio; | ||
using Content.Shared.Radio.Components; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Radio.EntitySystems; | ||
|
||
public sealed class RadioDeviceSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly UserInterfaceSystem _ui = default!; | ||
|
||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<IntercomComponent, AfterAutoHandleStateEvent>(OnAfterHandleState); | ||
} | ||
|
||
private void OnAfterHandleState(Entity<IntercomComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
if (_ui.TryGetOpenUi<IntercomBoundUserInterface>(ent.Owner, IntercomUiKey.Key, out var bui)) | ||
bui.Update(ent); | ||
} | ||
} |
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,23 +1,32 @@ | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared.Radio.Components; | ||
|
||
/// <summary> | ||
/// Handles intercom ui and is authoritative on the channels an intercom can access. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] | ||
public sealed partial class IntercomComponent : Component | ||
{ | ||
/// <summary> | ||
/// Does this intercom require popwer to function | ||
/// Does this intercom require power to function | ||
/// </summary> | ||
[DataField("requiresPower"), ViewVariables(VVAccess.ReadWrite)] | ||
[DataField] | ||
public bool RequiresPower = true; | ||
|
||
[DataField, AutoNetworkedField] | ||
public bool SpeakerEnabled; | ||
|
||
[DataField, AutoNetworkedField] | ||
public bool MicrophoneEnabled; | ||
|
||
[DataField, AutoNetworkedField] | ||
public ProtoId<RadioChannelPrototype>? CurrentChannel; | ||
|
||
/// <summary> | ||
/// The list of radio channel prototypes this intercom can choose between. | ||
/// </summary> | ||
[DataField("supportedChannels", customTypeSerializer: typeof(PrototypeIdListSerializer<RadioChannelPrototype>))] | ||
public List<string> SupportedChannels = new(); | ||
[DataField, AutoNetworkedField] | ||
public List<ProtoId<RadioChannelPrototype>> SupportedChannels = new(); | ||
} |
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,9 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Radio.Components; | ||
|
||
/// <summary> | ||
/// This is used for a radio that doesn't need a telecom server in order to broadcast. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class TelecomExemptComponent : Component; |
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.