Device link visualizer (#11054)

* shuffles devicelist to shared, adds an overlay for devicelist

* adds space property to overlay

* moves networkconfigurator to shared, makes devicelistsystem clientside check activedevicelist

* dirties components upon change, adds networkedcomponent to sharednetworkconfigurator

* state handlers for networked components

* whoops

* lots of shuffling, renaming, and access changes

* randomizes color for every new entity added to the overlay

* adds a client-side action to clear all network overlays if they're active

* clones action (oops)

* localization, adds a command for clearing network link overlays (in case the action disappears)

* moves the entity manager up into the bui fields

* makes that a dependency

* attempts to just directly get the color from the dict when drawing, now

* fixes up a few comments

* adds dirty on init to devicelistcomponent

* hacky solution related to mapping with a networkconfigurator

* more stricter bound on that hacky solution

* just checks if the life stage is initialized instead of if the entity was initialized

* moves getalldevices to shared

* readds linq import

* tries to ensure that the show button is toggled on if the device we're trying to configure is currently being tracked by the overlay

* some reorganization
This commit is contained in:
Flipp Syder
2022-09-05 17:55:44 -07:00
committed by GitHub
parent 6301ac5147
commit 9ace52a6c1
16 changed files with 454 additions and 55 deletions

View File

@@ -1,28 +0,0 @@
using Content.Server.DeviceNetwork.Systems;
namespace Content.Server.DeviceNetwork.Components;
[RegisterComponent]
[Access(typeof(DeviceListSystem))]
public sealed class DeviceListComponent : Component
{
/// <summary>
/// The list of devices can or can't connect to, depending on the <see cref="IsAllowList"/> field.
/// </summary>
[DataField("devices")]
public HashSet<EntityUid> Devices = new();
/// <summary>
/// Whether the device list is used as an allow or deny list
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("isAllowList")]
public bool IsAllowList = true;
/// <summary>
/// Whether this device list also handles incoming device net packets
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("handleIncoming")]
public bool HandleIncomingPackets = false;
}

View File

@@ -1,24 +0,0 @@
using Content.Server.DeviceNetwork.Systems;
using Robust.Shared.Audio;
namespace Content.Server.DeviceNetwork.Components;
[RegisterComponent]
[Access(typeof(NetworkConfiguratorSystem))]
public sealed class NetworkConfiguratorComponent : Component
{
/// <summary>
/// The list of devices stored in the configurator-
/// </summary>
[DataField("devices")]
public Dictionary<string, EntityUid> Devices = new();
/// <summary>
/// The entity containing a <see cref="DeviceListComponent"/> this configurator is currently interacting with
/// </summary>
[DataField("activeDeviceList")]
public EntityUid? ActiveDeviceList = null;
[DataField("soundNoAccess")]
public SoundSpecifier SoundNoAccess = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg");
}