Better robotics console (#38023)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -19,9 +19,15 @@ public sealed class RoboticsConsoleState : BoundUserInterfaceState
|
||||
/// </summary>
|
||||
public Dictionary<string, CyborgControlData> Cyborgs;
|
||||
|
||||
public RoboticsConsoleState(Dictionary<string, CyborgControlData> cyborgs)
|
||||
/// <summary>
|
||||
/// If the UI will have the buttons to disable and destroy.
|
||||
/// </summary>
|
||||
public bool AllowBorgControl;
|
||||
|
||||
public RoboticsConsoleState(Dictionary<string, CyborgControlData> cyborgs, bool allowBorgControl)
|
||||
{
|
||||
Cyborgs = cyborgs;
|
||||
AllowBorgControl = allowBorgControl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +90,12 @@ public partial record struct CyborgControlData
|
||||
[DataField]
|
||||
public float Charge;
|
||||
|
||||
/// <summary>
|
||||
/// HP level from 0 to 1.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float HpPercent; // 0.0 to 1.0
|
||||
|
||||
/// <summary>
|
||||
/// How many modules this borg has, just useful information for roboticists.
|
||||
/// Lets them keep track of the latejoin borgs that need new modules and stuff.
|
||||
@@ -111,12 +123,13 @@ public partial record struct CyborgControlData
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan Timeout = TimeSpan.Zero;
|
||||
|
||||
public CyborgControlData(SpriteSpecifier? chassisSprite, string chassisName, string name, float charge, int moduleCount, bool hasBrain, bool canDisable)
|
||||
public CyborgControlData(SpriteSpecifier? chassisSprite, string chassisName, string name, float charge, float hpPercent, int moduleCount, bool hasBrain, bool canDisable)
|
||||
{
|
||||
ChassisSprite = chassisSprite;
|
||||
ChassisName = chassisName;
|
||||
Name = name;
|
||||
Charge = charge;
|
||||
HpPercent = hpPercent;
|
||||
ModuleCount = moduleCount;
|
||||
HasBrain = hasBrain;
|
||||
CanDisable = canDisable;
|
||||
|
||||
Reference in New Issue
Block a user