Refactor AME to use ItemSlot for Fuel (#25558)
* Using wrench on AME doesn't first try to put it in. * Refactor AME to use ItemSlot for fuel. * Apparently these names want to match.
This commit is contained in:
19
Content.Shared/Ame/Components/AmeFuelContainerComponent.cs
Normal file
19
Content.Shared/Ame/Components/AmeFuelContainerComponent.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Ame.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class AmeFuelContainerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The amount of fuel in the container.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public int FuelAmount = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum fuel capacity of the container.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public int FuelCapacity = 1000;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Ame.Components;
|
||||
|
||||
[Virtual]
|
||||
public partial class SharedAmeControllerComponent : Component
|
||||
{
|
||||
public const string FuelSlotId = "fuelSlot";
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AmeControllerBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public readonly bool HasPower;
|
||||
public readonly bool IsMaster;
|
||||
public readonly bool Injecting;
|
||||
public readonly bool HasFuelJar;
|
||||
public readonly int FuelAmount;
|
||||
public readonly int InjectionAmount;
|
||||
public readonly int CoreCount;
|
||||
public readonly float CurrentPowerSupply;
|
||||
public readonly float TargetedPowerSupply;
|
||||
|
||||
public AmeControllerBoundUserInterfaceState(bool hasPower, bool isMaster, bool injecting, bool hasFuelJar, int fuelAmount, int injectionAmount, int coreCount, float currentPowerSupply, float targetedPowerSupply)
|
||||
{
|
||||
HasPower = hasPower;
|
||||
IsMaster = isMaster;
|
||||
Injecting = injecting;
|
||||
HasFuelJar = hasFuelJar;
|
||||
FuelAmount = fuelAmount;
|
||||
InjectionAmount = injectionAmount;
|
||||
CoreCount = coreCount;
|
||||
CurrentPowerSupply = currentPowerSupply;
|
||||
TargetedPowerSupply = targetedPowerSupply;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class UiButtonPressedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly UiButton Button;
|
||||
|
||||
public UiButtonPressedMessage(UiButton button)
|
||||
{
|
||||
Button = button;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum AmeControllerUiKey
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
public enum UiButton
|
||||
{
|
||||
Eject,
|
||||
ToggleInjection,
|
||||
IncreaseFuel,
|
||||
DecreaseFuel,
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum AmeControllerVisuals
|
||||
{
|
||||
DisplayState,
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum AmeControllerState
|
||||
{
|
||||
On,
|
||||
Warning,
|
||||
Critical,
|
||||
Fuck,
|
||||
Off,
|
||||
}
|
||||
23
Content.Shared/Ame/Components/SharedAmeShieldComponent.cs
Normal file
23
Content.Shared/Ame/Components/SharedAmeShieldComponent.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Ame.Components;
|
||||
|
||||
[Virtual]
|
||||
public partial class SharedAmeShieldComponent : Component
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum AmeShieldVisuals
|
||||
{
|
||||
Core,
|
||||
CoreState
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum AmeCoreState
|
||||
{
|
||||
Off,
|
||||
Weak,
|
||||
Strong
|
||||
}
|
||||
Reference in New Issue
Block a user