* commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
127 lines
3.8 KiB
C#
127 lines
3.8 KiB
C#
using System;
|
|
using Content.Shared.Chemistry;
|
|
using Content.Shared.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.GameObjects.Components.UserInterface;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Kitchen
|
|
{
|
|
public abstract class SharedReagentGrinderComponent : Component
|
|
{
|
|
public override string Name => "ReagentGrinder";
|
|
public override uint? NetID => ContentNetIDs.REAGENT_GRINDER;
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderGrindStartMessage : BoundUserInterfaceMessage
|
|
{
|
|
public ReagentGrinderGrindStartMessage()
|
|
{
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderJuiceStartMessage : BoundUserInterfaceMessage
|
|
{
|
|
public ReagentGrinderJuiceStartMessage()
|
|
{
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderEjectChamberAllMessage : BoundUserInterfaceMessage
|
|
{
|
|
public ReagentGrinderEjectChamberAllMessage()
|
|
{
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderEjectBeakerMessage : BoundUserInterfaceMessage
|
|
{
|
|
public ReagentGrinderEjectBeakerMessage()
|
|
{
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderEjectChamberContentMessage : BoundUserInterfaceMessage
|
|
{
|
|
public EntityUid EntityID;
|
|
public ReagentGrinderEjectChamberContentMessage(EntityUid entityID)
|
|
{
|
|
EntityID = entityID;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderVaporizeReagentIndexedMessage : BoundUserInterfaceMessage
|
|
{
|
|
public Solution.ReagentQuantity ReagentQuantity;
|
|
public ReagentGrinderVaporizeReagentIndexedMessage(Solution.ReagentQuantity reagentQuantity)
|
|
{
|
|
ReagentQuantity = reagentQuantity;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderWorkStartedMessage : BoundUserInterfaceMessage
|
|
{
|
|
public GrinderProgram GrinderProgram;
|
|
public ReagentGrinderWorkStartedMessage(GrinderProgram grinderProgram)
|
|
{
|
|
GrinderProgram = grinderProgram;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class ReagentGrinderWorkCompleteMessage : BoundUserInterfaceMessage
|
|
{
|
|
public ReagentGrinderWorkCompleteMessage()
|
|
{
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum ReagentGrinderVisualState : byte
|
|
{
|
|
BeakerAttached
|
|
}
|
|
|
|
[NetSerializable, Serializable]
|
|
public enum ReagentGrinderUiKey : byte
|
|
{
|
|
Key
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum GrinderProgram : byte
|
|
{
|
|
Grind,
|
|
Juice
|
|
}
|
|
}
|
|
|
|
[NetSerializable, Serializable]
|
|
public sealed class ReagentGrinderInterfaceState : BoundUserInterfaceState
|
|
{
|
|
public bool IsBusy;
|
|
public bool HasBeakerIn;
|
|
public bool Powered;
|
|
public bool CanJuice;
|
|
public bool CanGrind;
|
|
public EntityUid[] ChamberContents;
|
|
public Solution.ReagentQuantity[] ReagentQuantities;
|
|
public ReagentGrinderInterfaceState(bool isBusy, bool hasBeaker, bool powered, bool canJuice, bool canGrind, EntityUid[] chamberContents, Solution.ReagentQuantity[] heldBeakerContents)
|
|
{
|
|
IsBusy = isBusy;
|
|
HasBeakerIn = hasBeaker;
|
|
Powered = powered;
|
|
CanJuice = canJuice;
|
|
CanGrind = canGrind;
|
|
ChamberContents = chamberContents;
|
|
ReagentQuantities = heldBeakerContents;
|
|
}
|
|
}
|
|
}
|