forked from SpaceStation14-Shenanigans/Monolith
Handheld Radio Frequencies (#1833)
* Handheld radio with frequency * Handheld radio * some fix * some fix 2 * Updating radio frequency for current build * Consistent handheld radio localization w/ intercom * Radio: show frequency, bound to 1000-3000 kHz * No handheld radio admin spam, smaller radio menu * Radio Sprites * Update radio.yml * fixup sprite * Separate out radio to NF, migration * Fix Appearance component * Replace RadioHandheld instances with NF versions * Set intercom frequency on map init --------- Co-authored-by: Sh1ntra <diewrist@korolevsky.me> Co-authored-by: Dvir <dvirf01@gmail.com> Co-authored-by: Dvir <39403717+dvir001@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using Content.Shared._NC.Radio;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client._NC.Radio.UI;
|
||||
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class HandheldRadioBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private HandheldRadioMenu? _menu;
|
||||
|
||||
public HandheldRadioBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_menu = new();
|
||||
|
||||
_menu.OnMicPressed += enabled =>
|
||||
{
|
||||
SendMessage(new ToggleHandheldRadioMicMessage(enabled));
|
||||
};
|
||||
_menu.OnSpeakerPressed += enabled =>
|
||||
{
|
||||
SendMessage(new ToggleHandheldRadioSpeakerMessage(enabled));
|
||||
};
|
||||
_menu.OnFrequencyChanged += frequency =>
|
||||
{
|
||||
if (int.TryParse(frequency.Trim(), out var intFreq) && intFreq > 0)
|
||||
SendMessage(new SelectHandheldRadioFrequencyMessage(intFreq));
|
||||
else
|
||||
SendMessage(new SelectHandheldRadioFrequencyMessage(-1)); // Query the current frequency
|
||||
};
|
||||
|
||||
_menu.OnClose += Close;
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (!disposing)
|
||||
return;
|
||||
_menu?.Close();
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
if (state is not HandheldRadioBoundUIState msg)
|
||||
return;
|
||||
|
||||
_menu?.Update(msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<controls:FancyWindow xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
Title="{Loc 'handheld-radio-menu-title'}"
|
||||
MinSize="200 150"
|
||||
SetSize="200 150">
|
||||
<BoxContainer Orientation="Vertical"
|
||||
HorizontalExpand="True"
|
||||
VerticalExpand="True"
|
||||
Margin="5 0 5 0">
|
||||
<Control MinHeight="10"/>
|
||||
<BoxContainer Orientation="Vertical" SeparationOverride="4" MinWidth="150">
|
||||
<Label Name="CurrentTextFrequency" Text="{Loc 'handheld-radio-current-text-frequency'}" />
|
||||
<LineEdit Name="FrequencyLineEdit" />
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" HorizontalAlignment="Right" Margin="5 0 5 5">
|
||||
<Button Name="MicButton" ToggleMode="True" Text="{Loc 'handheld-radio-button-text-mic'}" StyleClasses="OpenRight" MinWidth="70"/>
|
||||
<Button Name="SpeakerButton" ToggleMode="True" Text="{Loc 'handheld-radio-button-text-speaker'}" StyleClasses="OpenLeft" MinWidth="70"/>
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<PanelContainer StyleClasses="LowDivider" />
|
||||
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom">
|
||||
<Label Text="{Loc 'handheld-radio-flavor-text-left'}" StyleClasses="WindowFooterText"
|
||||
HorizontalAlignment="Left" HorizontalExpand="True" Margin="0 0 5 0" />
|
||||
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</controls:FancyWindow>
|
||||
@@ -0,0 +1,35 @@
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared._NC.Radio;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client._NC.Radio.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class HandheldRadioMenu : FancyWindow
|
||||
{
|
||||
|
||||
public event Action<bool>? OnMicPressed;
|
||||
public event Action<bool>? OnSpeakerPressed;
|
||||
public event Action<string>? OnFrequencyChanged;
|
||||
|
||||
public HandheldRadioMenu()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
MicButton.OnPressed += args => OnMicPressed?.Invoke(args.Button.Pressed);
|
||||
SpeakerButton.OnPressed += args => OnSpeakerPressed?.Invoke(args.Button.Pressed);
|
||||
|
||||
FrequencyLineEdit.OnTextEntered += e => OnFrequencyChanged?.Invoke(e.Text);
|
||||
FrequencyLineEdit.OnFocusExit += e => OnFrequencyChanged?.Invoke(e.Text);
|
||||
}
|
||||
|
||||
public void Update(HandheldRadioBoundUIState state)
|
||||
{
|
||||
MicButton.Pressed = state.MicEnabled;
|
||||
SpeakerButton.Pressed = state.SpeakerEnabled;
|
||||
FrequencyLineEdit.Text = state.Frequency.ToString();
|
||||
}
|
||||
}
|
||||
@@ -40,4 +40,11 @@ public sealed partial class RadioMicrophoneComponent : Component
|
||||
/// </summary>
|
||||
[DataField("unobstructedRequired")]
|
||||
public bool UnobstructedRequired = false;
|
||||
|
||||
// Nuclear-14
|
||||
/// <summary>
|
||||
// The radio frequency on which the message will be transmitted
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Frequency = 1459; // Common channel frequency
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Radio;
|
||||
using Content.Shared.Radio.Components;
|
||||
using Content.Shared.UserInterface; // Nuclear-14
|
||||
using Content.Shared._NC.Radio; // Nuclear-14
|
||||
using Robust.Server.GameObjects; // Nuclear-14
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Radio.EntitySystems;
|
||||
@@ -26,10 +29,15 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
[Dependency] private readonly RadioSystem _radio = default!;
|
||||
[Dependency] private readonly InteractionSystem _interaction = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _ui = default!;
|
||||
|
||||
// Used to prevent a shitter from using a bunch of radios to spam chat.
|
||||
private HashSet<(string, EntityUid)> _recentlySent = new();
|
||||
|
||||
// Frontier: minimum, maximum radio frequencies
|
||||
private const int MinRadioFrequency = 1000;
|
||||
private const int MaxRadioFrequency = 3000;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -49,6 +57,13 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
SubscribeLocalEvent<IntercomComponent, ToggleIntercomSpeakerMessage>(OnToggleIntercomSpeaker);
|
||||
SubscribeLocalEvent<IntercomComponent, SelectIntercomChannelMessage>(OnSelectIntercomChannel);
|
||||
|
||||
// Nuclear-14-Start
|
||||
SubscribeLocalEvent<RadioMicrophoneComponent, BeforeActivatableUIOpenEvent>(OnBeforeHandheldRadioUiOpen);
|
||||
SubscribeLocalEvent<RadioMicrophoneComponent, ToggleHandheldRadioMicMessage>(OnToggleHandheldRadioMic);
|
||||
SubscribeLocalEvent<RadioMicrophoneComponent, ToggleHandheldRadioSpeakerMessage>(OnToggleHandheldRadioSpeaker);
|
||||
SubscribeLocalEvent<RadioMicrophoneComponent, SelectHandheldRadioFrequencyMessage>(OnChangeHandheldRadioFrequency);
|
||||
// Nuclear-14-End
|
||||
|
||||
SubscribeLocalEvent<IntercomComponent, MapInitEvent>(OnMapInit); // Frontier
|
||||
}
|
||||
|
||||
@@ -180,7 +195,7 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
|
||||
using (args.PushGroup(nameof(RadioMicrophoneComponent)))
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("handheld-radio-component-on-examine", ("frequency", proto.Frequency)));
|
||||
args.PushMarkup(Loc.GetString("handheld-radio-component-on-examine", ("frequency", /*Nuclear-14-start*/ component.Frequency /*Nuclear-14-end*/)));
|
||||
args.PushMarkup(Loc.GetString("handheld-radio-component-chennel-examine",
|
||||
("channel", proto.LocalizedName)));
|
||||
}
|
||||
@@ -192,7 +207,7 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
return; // no feedback loops please.
|
||||
|
||||
if (_recentlySent.Add((args.Message, args.Source)))
|
||||
_radio.SendRadioMessage(args.Source, args.Message, _protoMan.Index<RadioChannelPrototype>(component.BroadcastChannel), uid);
|
||||
_radio.SendRadioMessage(args.Source, args.Message, _protoMan.Index<RadioChannelPrototype>(component.BroadcastChannel), uid, /*Nuclear-14-start*/ frequency: component.Frequency /*Nuclear-14-end*/);
|
||||
}
|
||||
|
||||
private void OnAttemptListen(EntityUid uid, RadioMicrophoneComponent component, ListenAttemptEvent args)
|
||||
@@ -256,7 +271,7 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
if (ent.Comp.RequiresPower && !this.IsPowered(ent, EntityManager))
|
||||
return;
|
||||
|
||||
if (!_protoMan.HasIndex<RadioChannelPrototype>(args.Channel) || !ent.Comp.SupportedChannels.Contains(args.Channel))
|
||||
if (!_protoMan.TryIndex<RadioChannelPrototype>(args.Channel, out var channel) || !ent.Comp.SupportedChannels.Contains(args.Channel)) // Nuclear-14: add channel
|
||||
return;
|
||||
|
||||
SetIntercomChannel(ent, args.Channel);
|
||||
@@ -277,14 +292,79 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
}
|
||||
|
||||
if (TryComp<RadioMicrophoneComponent>(ent, out var mic))
|
||||
{
|
||||
mic.BroadcastChannel = channel;
|
||||
if(_protoMan.TryIndex<RadioChannelPrototype>(channel, out var channelProto)) // Frontier
|
||||
mic.Frequency = _radio.GetFrequency(ent, channelProto); // Frontier
|
||||
}
|
||||
if (TryComp<RadioSpeakerComponent>(ent, out var speaker))
|
||||
speaker.Channels = new(){ channel };
|
||||
Dirty(ent);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, IntercomComponent ent, MapInitEvent args) // Frontier - Init on map
|
||||
// Nuclear-14-Start
|
||||
#region Handheld Radio
|
||||
|
||||
private void OnBeforeHandheldRadioUiOpen(Entity<RadioMicrophoneComponent> microphone, ref BeforeActivatableUIOpenEvent args)
|
||||
{
|
||||
UpdateHandheldRadioUi(microphone);
|
||||
}
|
||||
|
||||
private void OnToggleHandheldRadioMic(Entity<RadioMicrophoneComponent> microphone, ref ToggleHandheldRadioMicMessage args)
|
||||
{
|
||||
if (!args.Actor.Valid)
|
||||
return;
|
||||
|
||||
SetMicrophoneEnabled(microphone, args.Actor, args.Enabled, true);
|
||||
UpdateHandheldRadioUi(microphone);
|
||||
}
|
||||
|
||||
private void OnToggleHandheldRadioSpeaker(Entity<RadioMicrophoneComponent> microphone, ref ToggleHandheldRadioSpeakerMessage args)
|
||||
{
|
||||
if (!args.Actor.Valid)
|
||||
return;
|
||||
|
||||
SetSpeakerEnabled(microphone, args.Actor, args.Enabled, true);
|
||||
UpdateHandheldRadioUi(microphone);
|
||||
}
|
||||
|
||||
private void OnChangeHandheldRadioFrequency(Entity<RadioMicrophoneComponent> microphone, ref SelectHandheldRadioFrequencyMessage args)
|
||||
{
|
||||
if (!args.Actor.Valid)
|
||||
return;
|
||||
|
||||
// Update frequency if valid and within range.
|
||||
if (args.Frequency >= MinRadioFrequency && args.Frequency <= MaxRadioFrequency)
|
||||
microphone.Comp.Frequency = args.Frequency;
|
||||
// Update UI with current frequency.
|
||||
UpdateHandheldRadioUi(microphone);
|
||||
}
|
||||
|
||||
private void UpdateHandheldRadioUi(Entity<RadioMicrophoneComponent> radio)
|
||||
{
|
||||
var speakerComp = CompOrNull<RadioSpeakerComponent>(radio);
|
||||
var frequency = radio.Comp.Frequency;
|
||||
|
||||
var micEnabled = radio.Comp.Enabled;
|
||||
var speakerEnabled = speakerComp?.Enabled ?? false;
|
||||
var state = new HandheldRadioBoundUIState(micEnabled, speakerEnabled, frequency);
|
||||
if (TryComp<UserInterfaceComponent>(radio, out var uiComp))
|
||||
_ui.SetUiState((radio.Owner, uiComp), HandheldRadioUiKey.Key, state); // Frontier: TrySetUiState<SetUiState
|
||||
}
|
||||
|
||||
#endregion
|
||||
// Nuclear-14-End
|
||||
|
||||
// Frontier: init intercom with map
|
||||
private void OnMapInit(EntityUid uid, IntercomComponent ent, MapInitEvent args)
|
||||
{
|
||||
// Set initial frequency (must be done regardless of power/enabled)
|
||||
if (ent.CurrentChannel != null &&
|
||||
_protoMan.TryIndex(ent.CurrentChannel, out var channel) &&
|
||||
TryComp(uid, out RadioMicrophoneComponent? mic))
|
||||
{
|
||||
mic.Frequency = channel.Frequency;
|
||||
}
|
||||
if (ent.StartSpeakerOnMapInit)
|
||||
{
|
||||
SetSpeakerEnabled(uid, null, true);
|
||||
@@ -298,4 +378,5 @@ public sealed class RadioDeviceSystem : EntitySystem
|
||||
_appearance.SetData(uid, RadioDeviceVisuals.Broadcasting, true);
|
||||
}
|
||||
}
|
||||
// End Frontier
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ using Content.Shared.Radio;
|
||||
using Content.Shared.Radio.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Content.Shared.Speech;
|
||||
using Content.Shared.Ghost; // Nuclear-14
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Player;
|
||||
@@ -56,6 +57,18 @@ public sealed class RadioSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
//Nuclear-14
|
||||
/// <summary>
|
||||
/// Gets the message frequency, if there is no such frequency, returns the standard channel frequency.
|
||||
/// </summary>
|
||||
public int GetFrequency(EntityUid source, RadioChannelPrototype channel)
|
||||
{
|
||||
if (TryComp<RadioMicrophoneComponent>(source, out var radioMicrophone))
|
||||
return radioMicrophone.Frequency;
|
||||
|
||||
return channel.Frequency;
|
||||
}
|
||||
|
||||
private void OnIntrinsicReceive(EntityUid uid, IntrinsicRadioReceiverComponent component, ref RadioReceiveEvent args)
|
||||
{
|
||||
if (TryComp(uid, out ActorComponent? actor))
|
||||
@@ -65,9 +78,9 @@ public sealed class RadioSystem : EntitySystem
|
||||
/// <summary>
|
||||
/// Send radio message to all active radio listeners
|
||||
/// </summary>
|
||||
public void SendRadioMessage(EntityUid messageSource, string message, ProtoId<RadioChannelPrototype> channel, EntityUid radioSource, bool escapeMarkup = true)
|
||||
public void SendRadioMessage(EntityUid messageSource, string message, ProtoId<RadioChannelPrototype> channel, EntityUid radioSource, int? frequency = null, bool escapeMarkup = true) // Frontier: added frequency
|
||||
{
|
||||
SendRadioMessage(messageSource, message, _prototype.Index(channel), radioSource, escapeMarkup: escapeMarkup);
|
||||
SendRadioMessage(messageSource, message, _prototype.Index(channel), radioSource, frequency: frequency, escapeMarkup: escapeMarkup); // Frontier: added frequency
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -75,7 +88,7 @@ public sealed class RadioSystem : EntitySystem
|
||||
/// </summary>
|
||||
/// <param name="messageSource">Entity that spoke the message</param>
|
||||
/// <param name="radioSource">Entity that picked up the message and will send it, e.g. headset</param>
|
||||
public void SendRadioMessage(EntityUid messageSource, string message, RadioChannelPrototype channel, EntityUid radioSource, bool escapeMarkup = true)
|
||||
public void SendRadioMessage(EntityUid messageSource, string message, RadioChannelPrototype channel, EntityUid radioSource, int? frequency = null, bool escapeMarkup = true) // Nuclear-14: add frequency
|
||||
{
|
||||
// TODO if radios ever garble / modify messages, feedback-prevention needs to be handled better than this.
|
||||
if (!_messages.Add(message))
|
||||
@@ -127,12 +140,20 @@ public sealed class RadioSystem : EntitySystem
|
||||
? FormattedMessage.EscapeText(message)
|
||||
: message;
|
||||
|
||||
// Frontier: append frequency if the channel requests it
|
||||
string channelText;
|
||||
if (channel.ShowFrequency)
|
||||
channelText = $"\\[{channel.LocalizedName} ({frequency})\\]";
|
||||
else
|
||||
channelText = $"\\[{channel.LocalizedName}\\]";
|
||||
// End Frontier
|
||||
|
||||
var wrappedMessage = Loc.GetString(speech.Bold ? "chat-radio-message-wrap-bold" : "chat-radio-message-wrap",
|
||||
("color", channel.Color),
|
||||
("fontType", speech.FontId),
|
||||
("fontSize", speech.FontSize),
|
||||
("verb", Loc.GetString(_random.Pick(speech.SpeechVerbStrings))),
|
||||
("channel", $"\\[{channel.LocalizedName}\\]"),
|
||||
("channel", channelText), // Frontier: $"\\[{channel.LocalizedName}\\]"<channelText
|
||||
("name", name),
|
||||
("message", content));
|
||||
|
||||
@@ -156,6 +177,10 @@ public sealed class RadioSystem : EntitySystem
|
||||
var sourceServerExempt = _exemptQuery.HasComp(radioSource);
|
||||
|
||||
var radioQuery = EntityQueryEnumerator<ActiveRadioComponent, TransformComponent>();
|
||||
|
||||
if (frequency == null) // Nuclear-14
|
||||
frequency = GetFrequency(messageSource, channel); // Nuclear-14
|
||||
|
||||
while (canSend && radioQuery.MoveNext(out var receiver, out var radio, out var transform))
|
||||
{
|
||||
if (!radio.ReceiveAllChannels)
|
||||
@@ -165,6 +190,9 @@ public sealed class RadioSystem : EntitySystem
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!HasComp<GhostComponent>(receiver) && GetFrequency(receiver, channel) != frequency) // Nuclear-14
|
||||
continue; // Nuclear-14
|
||||
|
||||
if (!channel.LongRange && transform.MapID != sourceMapId && !radio.GlobalReceive)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -35,4 +35,12 @@ public sealed partial class RadioChannelPrototype : IPrototype
|
||||
/// </summary>
|
||||
[DataField("longRange"), ViewVariables]
|
||||
public bool LongRange = false;
|
||||
|
||||
// Frontier: radio channel frequencies
|
||||
/// <summary>
|
||||
/// If true, the frequency of the message being sent will be appended to the chat message
|
||||
/// </summary>
|
||||
[DataField, ViewVariables]
|
||||
public bool ShowFrequency = false;
|
||||
// End Frontier
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._NC.Radio;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum HandheldRadioUiKey : byte
|
||||
{
|
||||
Key,
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class HandheldRadioBoundUIState : BoundUserInterfaceState
|
||||
{
|
||||
public bool MicEnabled;
|
||||
public bool SpeakerEnabled;
|
||||
public int Frequency;
|
||||
|
||||
public HandheldRadioBoundUIState(bool micEnabled, bool speakerEnabled, int frequency)
|
||||
{
|
||||
MicEnabled = micEnabled;
|
||||
SpeakerEnabled = speakerEnabled;
|
||||
Frequency = frequency;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ToggleHandheldRadioMicMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public bool Enabled;
|
||||
|
||||
public ToggleHandheldRadioMicMessage(bool enabled)
|
||||
{
|
||||
Enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ToggleHandheldRadioSpeakerMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public bool Enabled;
|
||||
|
||||
public ToggleHandheldRadioSpeakerMessage(bool enabled)
|
||||
{
|
||||
Enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class SelectHandheldRadioFrequencyMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public int Frequency;
|
||||
|
||||
public SelectHandheldRadioFrequencyMessage(int frequency)
|
||||
{
|
||||
Frequency = frequency;
|
||||
}
|
||||
}
|
||||
@@ -3,4 +3,12 @@ handheld-radio-component-on-examine = It's set to broadcast over the {$frequency
|
||||
handheld-radio-component-on-state = on
|
||||
handheld-radio-component-off-state = off
|
||||
handheld-radio-component-channel-set = Channel set to {$channel}
|
||||
handheld-radio-component-chennel-examine = The current channel is {$channel}.
|
||||
handheld-radio-component-chennel-examine = The current channel is {$channel}.
|
||||
|
||||
# Nuclear-14-Start
|
||||
handheld-radio-menu-title = Handheld radio
|
||||
handheld-radio-current-text-frequency = Broadcast frequency
|
||||
handheld-radio-button-text-mic = Mic.
|
||||
handheld-radio-button-text-speaker = Spkr.
|
||||
handheld-radio-flavor-text-left = HandiComms, 1000-3000 kHz
|
||||
# Nuclear-14-End
|
||||
@@ -7,7 +7,7 @@
|
||||
- type: StorageFill
|
||||
contents:
|
||||
- id: CrowbarRed
|
||||
- id: RadioHandheld
|
||||
- id: RadioHandheldNF # Frontier: RadioHandheld<RadioHandheldNF
|
||||
- id: WelderMini
|
||||
- id: FireExtinguisherMini
|
||||
# Random lighting item orGroup
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
- id: SurvivalKnife
|
||||
- id: JetpackMiniFilled # Frontier
|
||||
- id: HandheldGPSBasic # Frontier
|
||||
- id: RadioHandheld
|
||||
- id: RadioHandheldNF # Frontier - RadioHandheld<RadioHandheldNF
|
||||
# - id: SeismicCharge # Frontier - why are you giving randos round start bombs
|
||||
# amount: 2
|
||||
- id: OreBag
|
||||
@@ -41,7 +41,7 @@
|
||||
- id: ClothingBeltUtilityEngineering # Frontier
|
||||
- id: SurvivalKnife
|
||||
# - id: HandheldGPSBasic # Frontier
|
||||
- id: RadioHandheld
|
||||
- id: RadioHandheldNF # Frontier - RadioHandheld<RadioHandheldNF
|
||||
# - id: SeismicCharge # Frontier - why are they giving them roudn start bombs
|
||||
# amount: 2
|
||||
- id: OreBag
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
Pickaxe: 10
|
||||
OreBag: 6
|
||||
Floodlight: 10
|
||||
RadioHandheld: 5
|
||||
RadioHandheldNF: 5 # Frontier: RadioHandheld<RadioHandheldNF
|
||||
HandheldGPSBasic: 14
|
||||
Flare: 20
|
||||
FlashlightLantern: 15
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
- HandLabeler
|
||||
- GlowstickBase
|
||||
- Bucket
|
||||
- RadioHandheld
|
||||
- RadioHandheldNF # Frontier: RadioHandheld<RadioHandheldNF
|
||||
- GeigerCounter
|
||||
- Beaker
|
||||
- ClothingMaskGas
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
- Shovel
|
||||
- OreBag
|
||||
- Crowbar
|
||||
- RadioHandheld
|
||||
- RadioHandheldNF # Frontier: RadioHandheld<RadioHandheldNF
|
||||
|
||||
- type: entity
|
||||
id: BorgModuleGrapplingGun
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
ClothingNeckTieBH: 2 # Frontier
|
||||
ClothingHeadHatFedoraGrey: 2
|
||||
ClothingHandsGlovesColorBlack: 2
|
||||
RadioHandheld: 2
|
||||
RadioHandheldNF: 2 # Frontier: RadioHandheld<RadioHandheldNF
|
||||
ClothingHeadsetService: 2
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
- type: RandomSpawner
|
||||
offset: 0
|
||||
prototypes:
|
||||
- RadioHandheld
|
||||
- RadioHandheldNF # RadioHandheld<RadioHandheldNF
|
||||
- Mousetrap
|
||||
- CigPackGreen
|
||||
- CigPackRed
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
outerClothing: ClothingOuterHardsuitCBURN
|
||||
shoes: ClothingShoesBootsCombatFilled
|
||||
id: CBURNPDA
|
||||
pocket1: RadioHandheld
|
||||
pocket1: RadioHandheldNF # Frontier: RadioHandheld<RadioHandheldNF
|
||||
pocket2: WeaponLaserPistolNF # Frontier
|
||||
suitstorage: OxygenTankFilled
|
||||
belt: ClothingBeltBandolier
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
ClothingOuterHardsuitBasic: 5
|
||||
ClothingOuterHardsuitEVA: 10
|
||||
ClothingHeadHelmetEVA: 15
|
||||
RadioHandheld: 15
|
||||
RadioHandheldNF: 15
|
||||
HandheldGPSBasic: 15
|
||||
ClothingMaskGas: 10
|
||||
JetpackMiniFilled: 10
|
||||
@@ -41,7 +41,7 @@
|
||||
ClothingOuterHardsuitBasic: 4294967295 # Infinite
|
||||
ClothingOuterHardsuitEVA: 4294967295 # Infinite
|
||||
ClothingHeadHelmetEVA: 4294967295 # Infinite
|
||||
RadioHandheld: 4294967295 # Infinite
|
||||
RadioHandheldNF: 4294967295 # Infinite
|
||||
HandheldGPSBasic: 4294967295 # Infinite
|
||||
ClothingMaskGas: 4294967295 # Infinite
|
||||
JetpackMiniFilled: 4294967295 # Infinite
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
- type: vendingMachineInventory
|
||||
id: SalvageEquipmentPOIInventory
|
||||
startingInventory:
|
||||
WeaponCrusherGlaive: 4294967295 # Frontier: 6<Infinite
|
||||
WeaponProtoKineticAccelerator: 4294967295 # Frontier: 3<Infinite
|
||||
WeaponCrusher: 4294967295 # Frontier: 6<Infinite
|
||||
WeaponCrusherDagger: 4294967295 # Frontier: 8<Infinite
|
||||
WeaponCrusherGlaive: 4294967295 # Infinite
|
||||
WeaponProtoKineticAccelerator: 4294967295 # Infinite
|
||||
WeaponCrusher: 4294967295 # Infinite
|
||||
WeaponCrusherDagger: 4294967295 # Infinite
|
||||
# MiningDrill: 3
|
||||
Pickaxe: 4294967295 # Frontier: 10<Infinite
|
||||
OreBag: 4294967295 # Frontier: 6<Infinite
|
||||
Floodlight: 4294967295 # Frontier: 10<Infinite
|
||||
RadioHandheld: 4294967295 # Frontier: 5<Infinite
|
||||
HandheldGPSBasic: 4294967295 # Frontier: 14<Infinite
|
||||
Flare: 4294967295 # Frontier: 20<Infinite
|
||||
FlashlightLantern: 4294967295 # Frontier: 15<Infinite
|
||||
Pickaxe: 4294967295 # Infinite
|
||||
OreBag: 4294967295 # Infinite
|
||||
Floodlight: 4294967295 # Infinite
|
||||
RadioHandheldNF: 4294967295 # Infinite
|
||||
HandheldGPSBasic: 4294967295 # Infinite
|
||||
Flare: 4294967295 # Infinite
|
||||
FlashlightLantern: 4294967295 # Infinite
|
||||
# FultonBeacon: 6
|
||||
# Fulton: 12
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
- WeaponProtoKineticAccelerator
|
||||
- WeaponProtoKineticAcceleratorSawn
|
||||
- OreBag
|
||||
- RadioHandheld
|
||||
- RadioHandheldNF
|
||||
- HandheldGPSBasic
|
||||
- Floodlight
|
||||
- Pickaxe
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
- type: entity
|
||||
name: handicomms
|
||||
description: A handy handheld radio with adjustible frequency.
|
||||
parent: RadioHandheld
|
||||
id: RadioHandheldNF
|
||||
components:
|
||||
- type: RadioMicrophone
|
||||
broadcastChannel: Handheld
|
||||
toggleOnInteract: false # Nuclear-14
|
||||
frequency: 1330 # Nuclear-14
|
||||
- type: RadioSpeaker
|
||||
toggleOnInteract: false # Nuclear-14
|
||||
- type: Sprite
|
||||
sprite: _NF/Objects/Devices/communication.rsi
|
||||
layers:
|
||||
- state: base
|
||||
- state: broadcasting
|
||||
map: ["enum.RadioDeviceVisualLayers.Broadcasting"]
|
||||
shader: unshaded
|
||||
visible: false
|
||||
- state: speaker
|
||||
map: ["enum.RadioDeviceVisualLayers.Speaker"]
|
||||
shader: unshaded
|
||||
visible: false
|
||||
- type: Item
|
||||
sprite: _NF/Objects/Devices/communication.rsi
|
||||
heldPrefix: walkietalkie
|
||||
# Nuclear-14-Start
|
||||
- type: ActivatableUI
|
||||
key: enum.HandheldRadioUiKey.Key
|
||||
- type: UserInterface
|
||||
interfaces:
|
||||
enum.HandheldRadioUiKey.Key:
|
||||
type: HandheldRadioBoundUserInterface
|
||||
# Nuclear-14-End
|
||||
- type: Appearance
|
||||
- type: GenericVisualizer
|
||||
visuals:
|
||||
enum.RadioDeviceVisuals.Broadcasting:
|
||||
enum.RadioDeviceVisualLayers.Broadcasting:
|
||||
True: { visible: true }
|
||||
False: { visible: false }
|
||||
enum.RadioDeviceVisuals.Speaker:
|
||||
enum.RadioDeviceVisualLayers.Speaker:
|
||||
True: { visible: true }
|
||||
False: { visible: false }
|
||||
@@ -295,7 +295,7 @@
|
||||
- ClothingOuterEVASuitSalvage
|
||||
- ClothingBeltSalvageWebbing
|
||||
- Pickaxe
|
||||
- RadioHandheld
|
||||
- RadioHandheldNF
|
||||
- Floodlight
|
||||
- FlareLathe
|
||||
- GlowstickBlue
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
- type: startingGear
|
||||
id: ContractorRadioHandheld
|
||||
inhand:
|
||||
- RadioHandheld
|
||||
- RadioHandheldNF
|
||||
|
||||
- type: loadout
|
||||
id: ContractorNetworkConfigurator
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
Silver: 500
|
||||
|
||||
- type: latheRecipe
|
||||
id: RadioHandheld
|
||||
result: RadioHandheld
|
||||
id: RadioHandheldNF
|
||||
result: RadioHandheldNF
|
||||
completetime: 1
|
||||
category: Tools
|
||||
materials:
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
color: "#d39f01"
|
||||
# long range since otherwise it'd defeat the point of a handheld radio independent of telecomms
|
||||
longRange: true
|
||||
showFrequency: true # Frontier
|
||||
|
||||
- type: radioChannel
|
||||
id: Binary
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 489 B |
Binary file not shown.
|
After Width: | Height: | Size: 110 B |
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Inhand sprites taken from cev-eris and modified by Swept and dvir01 at https://github.com/discordia-space/CEV-Eris/commit/efce5b6c3be75458ce238dcc01510e8f8a653ca6",
|
||||
"copyright": "Other sprites taken from paradise at https://github.com/ParadiseSS13/Paradise/commit/494704e323de19a4432fcbf5a27064b11a6e0b97",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "base"
|
||||
},
|
||||
{
|
||||
"name": "broadcasting"
|
||||
},
|
||||
{
|
||||
"name": "speaker"
|
||||
},
|
||||
{
|
||||
"name": "walkietalkie-inhand-right",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "walkietalkie-inhand-left",
|
||||
"directions": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 155 B |
Binary file not shown.
|
After Width: | Height: | Size: 263 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -412,4 +412,8 @@ MobRandomCargoCorpse: DungeonHumanCorpseRandomCargo
|
||||
MobRandomMedicCorpse: DungeonHumanCorpseRandomMedic
|
||||
MobRandomScienceCorpse: DungeonHumanCorpseRandomScience
|
||||
MobRandomCommandCorpse: DungeonHumanCorpseRandomCommand
|
||||
MobRandomSecurityCorpse: DungeonHumanCorpseRandomSecurity
|
||||
MobRandomSecurityCorpse: DungeonHumanCorpseRandomSecurity
|
||||
|
||||
# 2024-08-17
|
||||
# Adjustible frequency radios
|
||||
RadioHandheld: RadioHandheldNF
|
||||
Reference in New Issue
Block a user