Power cell slot QOL (#15373)

This commit is contained in:
metalgearsloth
2023-04-23 12:25:12 +10:00
committed by GitHub
parent abc84070c6
commit a4dfe8beed
17 changed files with 544 additions and 264 deletions

View File

@@ -0,0 +1,25 @@
namespace Content.Server.PowerCell;
/// <summary>
/// Indicates that the entity's ActivatableUI requires power or else it closes.
/// </summary>
[RegisterComponent]
public sealed class PowerCellDrawComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("enabled")]
public bool Enabled = false;
/// <summary>
/// How much the entity draws while the UI is open.
/// Set to 0 if you just wish to check for power upon opening the UI.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("drawRate")]
public float DrawRate = 1f;
/// <summary>
/// How much power is used whenever the entity is "used".
/// This is used to ensure the UI won't open again without a minimum use power.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("useRate")]
public float UseRate = 0f;
}