Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,10 @@ private void SendEntityWhisper(
if (session.AttachedEntity is not { Valid: true } listener) // Starlight-edit: Languages
continue;

if (MessageRangeCheck(session, data, range) != MessageRangeCheckResult.Full)
// Moffstation - Start - Radio Host, hide chat messages from station radio
var rangeCheck = MessageRangeCheck(session, data, range);
if (rangeCheck == MessageRangeCheckResult.Disallowed)
// Moffstation - End
Comment thread
coderabbitai[bot] marked this conversation as resolved.
continue; // Won't get logged to chat, and ghosts are too far away to see the pop-up, so we just won't send it to them.

// Starlight - Start
Expand Down Expand Up @@ -673,7 +676,7 @@ private void SendEntityWhisper(
wrappedMessage = WrapWhisperMessage(source, "chat-manager-entity-whisper-unknown-wrap-message", string.Empty, result, language, obfuscated);
}

_chatManager.ChatMessageToOne(ChatChannel.Whisper, result, wrappedMessage, source, false, session.Channel);
_chatManager.ChatMessageToOne(ChatChannel.Whisper, result, wrappedMessage, source, rangeCheck == MessageRangeCheckResult.HideChat, session.Channel); // Moffstation - Radio Host, hide chat messages from station radio
// Starlight - End
}

Expand Down
20 changes: 17 additions & 3 deletions Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Server.Interaction;
using Content.Server.Popups;
using Content.Server.Power.EntitySystems;
using Content.Shared._Goobstation.StationRadio.Components;
using Content.Shared.Chat;
using Content.Shared.Examine;
using Content.Shared.Interaction;
Expand All @@ -14,6 +15,7 @@
using Content.Shared.Speech.Components;
using Robust.Shared.Prototypes;
using Content.Shared.Power.EntitySystems; // Goobstation - Radio Host
using Content.Shared._Goobstation.StationRadio.Components; // Goobstation - Radio Host

#region Starlight
using Content.Server._Starlight.Language;
Expand Down Expand Up @@ -195,7 +197,7 @@ private void OnAttemptListen(EntityUid uid, RadioMicrophoneComponent component,

private void OnReceiveRadio(EntityUid uid, RadioSpeakerComponent component, ref RadioReceiveEvent args)
{
if (uid == args.RadioSource || component.PowerRequired && !_power.IsPowered(uid)) // Goobstation - Radio Host - Powered required
if (uid == args.RadioSource || !_power.IsPowered(uid)) // Goobstation - Radio Host
Comment thread
coderabbitai[bot] marked this conversation as resolved.
return;

var nameEv = new TransformSpeakerNameEvent(args.MessageSource, Name(args.MessageSource));
Expand All @@ -205,10 +207,22 @@ private void OnReceiveRadio(EntityUid uid, RadioSpeakerComponent component, ref
("speaker", Name(uid)),
("originalName", nameEv.VoiceName));

// Starlight - Start - Radio Host
var chatType = InGameICChatType.Whisper; // Default, messages from radios are sent as whispers.
var transmitRange = ChatTransmitRange.GhostRangeLimit; // Default, all ghosts can hear whispers from radios.
if (TryComp<StationRadioReceiverComponent>(uid, out var receiverComp))
{
transmitRange = ChatTransmitRange.HideChat; // Message hidden from chat if from a Station Radio.
chatType = receiverComp.LowVolume ? InGameICChatType.Whisper : InGameICChatType.Speak; // Radios will talk loudly if at full volume.
}
// Starlight - End

// log to chat so people can identity the speaker/source, but avoid clogging ghost chat if there are many radios
var message = args.OriginalChatMsg.Message; // Starlight-edit: The chat system will handle the rest and re-obfuscate if needed.
_chat.TrySendInGameICMessage(uid, message, InGameICChatType.Whisper, ChatTransmitRange.GhostRangeLimit, nameOverride: name,
checkRadioPrefix: component.ParseRadioPrefix, // Starlight - Radio Host, change LouderSpeech to ParseRadioPrefix
_chat.TrySendInGameICMessage(uid, message,
chatType, // Starlight - Radio Host (InGameICChatType.Whisper -> chatType)
transmitRange,// Starlight - Radio Host (ChatTransmitRange.GhostRangeLimit -> transmitRange)
nameOverride: name, checkRadioPrefix: false,
languageOverride: args.Language); // Starlight
}

Expand Down
16 changes: 0 additions & 16 deletions Content.Shared/Radio/Components/RadioSpeakerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,4 @@ public sealed partial class RadioSpeakerComponent : Component

[DataField, AutoNetworkedField]
public bool Enabled;

// Starlight - Radio Host LouderSpeech -> ParseRadioPrefix.
/// <summary>
/// Whether or not a message is parsed through the radio when when sent in local chat.
/// </summary>
[DataField, AutoNetworkedField]
public bool ParseRadioPrefix;
// Starlight - End

// Goobstation - Radio Host
/// <summary>
/// Does the radio need to be on a power grid to work?
/// </summary>
[DataField]
public bool PowerRequired;
// Goobstation - End
}
26 changes: 26 additions & 0 deletions Content.Shared/Radio/EntitySystems/SharedRadioDeviceSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Content.Shared.Popups;
using Content.Shared.Radio.Components;
using Content.Shared._Goobstation.StationRadio.Components; // Starlight - Examine the station radio server to see if microphone is active.
using Content.Shared.Examine; // Starlight - Examine the station radio server to see if microphone is active.

namespace Content.Shared.Radio.EntitySystems;

Expand Down Expand Up @@ -49,5 +51,29 @@ public void SetSpeakerEnabled(EntityUid uid, EntityUid? user, bool enabled, bool
RemCompDeferred<ActiveRadioComponent>(uid);
}
#endregion

// Starlight - Start
#region Starlight

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StationRadioServerComponent, ExaminedEvent>(OnExamined);
}

/// <summary>
/// Examining a Radio Station Server will now tell you if it is recording or not.
/// </summary>
private void OnExamined(EntityUid uid, StationRadioServerComponent comp, ref ExaminedEvent args)
{
if (!TryComp<RadioMicrophoneComponent>(uid, out var mic))
return;

args.PushMarkup(Loc.GetString(mic.Enabled
? "station-radio-server-examine-not-recording"
: "station-radio-server-examine-recording"));
}
#endregion
// Starlight - End
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Content.Shared.Power.EntitySystems;
using Robust.Shared.Audio.Systems;
using Content.Shared.DeviceLinking; // Starlight - Remove Server Check from VinylSummonSystem
using Content.Shared.Radio.Components; // Starlight - Alt click to lower volume.
using Content.Shared.Examine; // Starlight - Shift Click to view what volume the radio is at.
using Content.Shared.Verbs; // Starlight - Alt click to lower volume.
using Robust.Shared.Network; // Starlight - Add Station Radio Resume Play
using Robust.Shared.Timing; // Starlight - Add Station Radio Resume Play
Expand Down Expand Up @@ -35,6 +35,7 @@ public override void Initialize()
SubscribeLocalEvent<RadioRigComponent, EntityTerminatingEvent>(OnRigTerminating); // Starlight - When Rig is destroyed, it should stop broadcasting.

SubscribeLocalEvent<StationRadioReceiverComponent, GetVerbsEvent<AlternativeVerb>>(OnGetAltVerbs); // Starlight - Alt click to lower volume.
SubscribeLocalEvent<StationRadioReceiverComponent, ExaminedEvent>(OnExamined); // Starlight - Shift Click to view what volume the radio is at.
}

private void OnRadioToggle(EntityUid uid, StationRadioReceiverComponent comp, ActivateInWorldEvent args)
Expand Down Expand Up @@ -132,8 +133,8 @@ private void OnServerPowerChanged(EntityUid uid, StationRadioServerComponent com
}
}

// Starlight - Start - Remove Server Check from VinylSummonSystem

// Starlight - Start
#region Starlight
/// <summary>
/// Method for getting the current volume of the station radio.
/// </summary>
Expand Down Expand Up @@ -235,5 +236,16 @@ private void StopAllReceivers()
RaiseLocalEvent(receiver, new StationRadioMediaStoppedEvent());
}
}

/// <summary>
/// Display whether or not the station radio is at full or low volume when examined.
/// </summary>
private void OnExamined(EntityUid uid, StationRadioReceiverComponent comp, ref ExaminedEvent args)
{
args.PushMarkup(Loc.GetString(comp.LowVolume
? "station-radio-receiver-examine-low-volume"
: "station-radio-receiver-examine-full-volume"));
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
Comment thread
Huaqas marked this conversation as resolved.
#endregion
// Starlight - End
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
using Content.Shared.DeviceLinking;
using Content.Shared.Power;
using Content.Shared.Power.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Network;
using Content.Shared._Goobstation.StationRadio.Systems; // Starlight - Remove Server Check from VinylSummonSystem
using Content.Shared.Examine; // Starlight - Shift Click to view what Vinyl is inserted.
using Robust.Shared.Timing; // Starlight - Add Station Radio Resume Play

namespace Content.Shared._Goobstation.StationRadio.Systems; // Starlight - _Goob -> _Goobstation
Expand All @@ -22,13 +21,17 @@ public sealed partial class VinylPlayerSystem : EntitySystem
[Dependency] private StationRadioReceiverSystem _stationRadio = default!; // Starlight - Remove Server Check from VinylSummonSystem
[Dependency] private IGameTiming _timing = default!; // Starlight - Add Station Radio Resume Play

[Dependency] private readonly SharedContainerSystem _container = default!; // Starlight - Shift Click to view what Vinyl is inserted.
Comment thread
Huaqas marked this conversation as resolved.

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<VinylPlayerComponent, EntInsertedIntoContainerMessage>(OnVinylInserted);
SubscribeLocalEvent<VinylPlayerComponent, EntRemovedFromContainerMessage>(OnVinylRemove);
SubscribeLocalEvent<VinylPlayerComponent, DestructionEventArgs>(OnDestruction);
SubscribeLocalEvent<VinylPlayerComponent, PowerChangedEvent>(OnPowerChanged);

SubscribeLocalEvent<VinylPlayerComponent, ExaminedEvent>(OnExamined); // Starlight - Shift Click to view what Vinyl is inserted.
}

private void OnPowerChanged(EntityUid uid, VinylPlayerComponent comp, PowerChangedEvent args)
Expand Down Expand Up @@ -154,4 +157,21 @@ private bool CheckForRadioServer(EntityUid uid)
}
return false;
}

#region Starlight
/// <summary>
/// Show what vinyl is currently inserted when examined.
/// </summary>
private void OnExamined(EntityUid uid, VinylPlayerComponent comp, ref ExaminedEvent args)
{
if (!_container.TryGetContainer(uid, "vinyl", out var container) || container.ContainedEntities.Count == 0) // confirm actual container ID
{
args.PushMarkup(Loc.GetString("vinyl-player-examine-empty"));
return;
}

var vinyl = container.ContainedEntities[0];
args.PushMarkup(Loc.GetString("vinyl-player-examine-loaded", ("vinyl", Name(vinyl))));
}
#endregion
}
11 changes: 11 additions & 0 deletions Resources/Locale/en-US/_Goobstation/machines/stationradio.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@ signal-port-description-radio-server = The input of the radio server, connect a
vinyl-popout-no-station = The vinyl ejects itself, you're not on a station!
vinyl-popout-no-power = The vinyl ejects itself, the player isn't powered!
vinyl-popout-no-radio-connection = The vinyl ejects itself, the player isn't connected to the radio system!

# Starlight - Station Radio Examination Text.
vinyl-player-examine-empty = It's empty.
vinyl-player-examine-loaded = There's a copy of { $vinyl } inside.

station-radio-receiver-examine-full-volume = It's playing at full volume.
station-radio-receiver-examine-low-volume = It's playing at low volume.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

station-radio-server-examine-recording = The station server is not recording.
station-radio-server-examine-not-recording = The station server is currently recording.
# Starlight - End
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Hydroponics # Starlight
extendedAccess:
- Theatre # Starlight
- Journalism # Starlight
# - Hydroponics # Starlight

- type: startingGear
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Roles/Jobs/Wildcards/reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
access:
- Service
- Maintenance
- Journalism # Starlight

- type: startingGear
id: ReporterGear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
- type: Machine
board: StationRadioCircuitboard
- type: RadioSpeaker
powerRequired: true
parseRadioPrefix: false
enabled: true
channels:
- RadioShow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- type: loadoutGroup
id: RadioHostJumpsuit
name: loadout-group-radiohost-jumpsuit
minLimit: 0
minLimit: 1
Comment thread
coderabbitai[bot] marked this conversation as resolved.
loadouts:
- JumpsuitHawaiBlack
- JumpsuitHawaiBlue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
access:
- Maintenance
- Journalism
- Service

- type: startingGear
id: RadioHostGear
equipment:
id: RadioHostPDA
ears: ClothingHeadsetAltRadioHost
belt: ClothingBeltStorageWaistbag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- Mining
- SalvageLead
- Debrief
- Journalism
special:
- !type:AddImplantSpecial
implants: [MindShieldImplant]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
- Surgery
- Paramedic
- Debrief
- Journalism
special:
- !type:AddImplantSpecial
implants: [MindShieldImplant]
Expand Down
Loading