2024-02-02 23:24:33 -05:00
|
|
|
using Content.Shared.Tools;
|
2023-03-24 03:09:45 +03:00
|
|
|
using Robust.Shared.Audio;
|
|
|
|
|
using Robust.Shared.GameStates;
|
2024-02-02 23:24:33 -05:00
|
|
|
using Robust.Shared.Prototypes;
|
2023-03-24 03:09:45 +03:00
|
|
|
|
|
|
|
|
namespace Content.Shared.Wires;
|
|
|
|
|
|
|
|
|
|
[NetworkedComponent, RegisterComponent]
|
|
|
|
|
[Access(typeof(SharedWiresSystem))]
|
2023-08-10 03:33:03 -05:00
|
|
|
[AutoGenerateComponentState]
|
|
|
|
|
public sealed partial class WiresPanelComponent : Component
|
2023-03-24 03:09:45 +03:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Is the panel open for this entity's wires?
|
|
|
|
|
/// </summary>
|
2023-04-20 09:42:22 +03:00
|
|
|
[DataField("open")]
|
2023-08-10 03:33:03 -05:00
|
|
|
[AutoNetworkedField]
|
2023-03-24 03:09:45 +03:00
|
|
|
public bool Open;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should this entity's wires panel be visible at all?
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables]
|
2023-08-10 03:33:03 -05:00
|
|
|
[AutoNetworkedField]
|
2023-03-24 03:09:45 +03:00
|
|
|
public bool Visible = true;
|
|
|
|
|
|
|
|
|
|
[DataField("screwdriverOpenSound")]
|
|
|
|
|
public SoundSpecifier ScrewdriverOpenSound = new SoundPathSpecifier("/Audio/Machines/screwdriveropen.ogg");
|
|
|
|
|
|
|
|
|
|
[DataField("screwdriverCloseSound")]
|
|
|
|
|
public SoundSpecifier ScrewdriverCloseSound = new SoundPathSpecifier("/Audio/Machines/screwdriverclose.ogg");
|
2024-02-02 23:24:33 -05:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Amount of times in seconds it takes to open
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public TimeSpan OpenDelay = TimeSpan.FromSeconds(1);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The tool quality needed to open this panel.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<ToolQualityPrototype> OpeningTool = "Screwing";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Text showed on examine when the panel is closed.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[DataField]
|
|
|
|
|
public LocId? ExamineTextClosed = "wires-panel-component-on-examine-closed";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Text showed on examine when the panel is open.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[DataField]
|
|
|
|
|
public LocId? ExamineTextOpen = "wires-panel-component-on-examine-open";
|
2023-03-24 03:09:45 +03:00
|
|
|
}
|
2023-08-13 03:09:30 -04:00
|
|
|
|
2024-03-31 02:34:17 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Event raised on a <see cref="WiresPanelComponent"/> before its open state is about to be changed.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ByRefEvent]
|
|
|
|
|
public record struct AttemptChangePanelEvent(bool Open, EntityUid? User, bool Cancelled = false);
|
|
|
|
|
|
2023-08-13 03:09:30 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Event raised when a panel is opened or closed.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ByRefEvent]
|
|
|
|
|
public readonly record struct PanelChangedEvent(bool Open);
|