Improved RCDs (#22799)
* Initial radial menu prototyping for the RCD * Radial UI buttons can send messages to the server * Beginning to update RCDSystem * RCD building system in progress * Further updates * Added extra effects, RCDSystem now reads RCD prototype data * Replacing tiles is instant, multiple constructions are allowed, deconstruction is broken * Added extra functionality to RadialContainers plus documentation * Fixed localization of RCD UI strings * Menu opens near cursor, added basic RCD * Avoiding merge conflict * Implemented atomized construction / deconstruction rules * Increased RCD ammo base charges * Moved input context definition to content * Removed obsoleted code * Updates to system * Switch machine and computer frames for electrical cabling * Added construction ghosts * Fixed issue with keybind detection code * Fixed RCD construction ghost mispredications * Code clean up * Updated deconstruction effects * RCDs effects don't rotate * Code clean up * Balancing for ammo counts * Code clean up * Added missing localized strings * More clean up * Made directional window handling more robust * Added documentation to radial menus and made them no longer dependent on Content * Made radial containers more robust * Further robustness to the radial menu * The RCD submenu buttons are only shown when the destination layer has at least one children * Expanded upon deconstructing plus construction balance * Fixed line endings * Updated list of RCD deconstructable entities. Now needs a component to deconstruct instead of a tag * Bug fixes * Revert unnecessary change * Updated RCD strings * Fixed bug * More fixes * Deconstructed tiles/subflooring convert to lattice instead * Fixed failed tests (Linux doesn't like invalid spritespecifer paths) * Fixing merge conflict * Updated airlock assembly * Fixing merge conflict * Fixing merge conflict * More fixing... * Removed erroneous project file change * Fixed string handling issue * Trying to fix merge conflict * Still fixing merge conflicts * Balancing * Hidden RCD construction ghosts when in 'build' mode * Fixing merge conflict * Implemented requested changes (Part 1) * Added more requested changes * Fix for failed test. Removed sussy null suppression * Made requested changes - custom construction ghost system was replaced * Fixing merge conflict * Fixed merge conflict * Fixed bug in RCD construction ghost validation * Fixing merge conflict * Merge conflict fixed * Made required update * Removed lingering RCD deconstruct tag * Fixing merge conflict * Merge conflict fixed * Made requested changes * Bug fixes and balancing * Made string names more consistent * Can no longer stack catwalks
This commit is contained in:
@@ -1,20 +1,11 @@
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.RCD.Systems;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.RCD.Components;
|
||||
|
||||
public enum RcdMode : byte
|
||||
{
|
||||
Floors,
|
||||
Walls,
|
||||
Airlock,
|
||||
Deconstruct
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Main component for the RCD
|
||||
/// Optionally uses LimitedChargesComponent.
|
||||
@@ -25,27 +16,57 @@ public enum RcdMode : byte
|
||||
public sealed partial class RCDComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Time taken to do an action like placing a wall
|
||||
/// List of RCD prototypes that the device comes loaded with
|
||||
/// </summary>
|
||||
[DataField("delay"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public float Delay = 2f;
|
||||
|
||||
[DataField("swapModeSound")]
|
||||
public SoundSpecifier SwapModeSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg");
|
||||
|
||||
[DataField("successSound")]
|
||||
public SoundSpecifier SuccessSound = new SoundPathSpecifier("/Audio/Items/deconstruct.ogg");
|
||||
[DataField, AutoNetworkedField]
|
||||
public HashSet<ProtoId<RCDPrototype>> AvailablePrototypes { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// What mode are we on? Can be floors, walls, airlock, deconstruct.
|
||||
/// Sound that plays when a RCD operation successfully completes
|
||||
/// </summary>
|
||||
[DataField("mode"), AutoNetworkedField]
|
||||
public RcdMode Mode = RcdMode.Floors;
|
||||
[DataField]
|
||||
public SoundSpecifier SuccessSound { get; set; } = new SoundPathSpecifier("/Audio/Items/deconstruct.ogg");
|
||||
|
||||
/// <summary>
|
||||
/// ID of the floor to create when using the floor mode.
|
||||
/// The ProtoId of the currently selected RCD prototype
|
||||
/// </summary>
|
||||
[DataField("floor", customTypeSerializer: typeof(PrototypeIdSerializer<ContentTileDefinition>))]
|
||||
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public string Floor = "FloorSteel";
|
||||
[DataField, AutoNetworkedField]
|
||||
public ProtoId<RCDPrototype> ProtoId { get; set; } = "Invalid";
|
||||
|
||||
/// <summary>
|
||||
/// A cached copy of currently selected RCD prototype
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If the ProtoId is changed, make sure to update the CachedPrototype as well
|
||||
/// </remarks>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public RCDPrototype CachedPrototype { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The direction constructed entities will face upon spawning
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public Direction ConstructionDirection
|
||||
{
|
||||
get
|
||||
{
|
||||
return _constructionDirection;
|
||||
}
|
||||
set
|
||||
{
|
||||
_constructionDirection = value;
|
||||
ConstructionTransform = new Transform(new(), _constructionDirection.ToAngle());
|
||||
}
|
||||
}
|
||||
|
||||
private Direction _constructionDirection = Direction.South;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a rotated transform based on the specified ConstructionDirection
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Contains no position data
|
||||
/// </remarks>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public Transform ConstructionTransform { get; private set; } = default!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user