mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 22:18:52 +03:00
# Description Port smartfridge functionality from [Delta-V](https://github.com/DeltaV-Station/Delta-v) and commits from [Frontier](https://github.com/new-frontiers-14/frontier-station-14) Pr and commits: https://github.com/DeltaV-Station/Delta-v/pull/320770a90320852d4abf62b7--- <details><summary><h1>Media</h1></summary> <p> https://github.com/user-attachments/assets/a67f78ca-327c-4e08-8e34-8be6a1a59eac </p> </details> --- # Changelog 🆑 sowelipililimute, Whatstone and Will-Oliver-Br - tweak: SmartFridge now really has functionality --------- Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Co-authored-by: Whatstone <whatston3@gmail.com>
82 lines
2.1 KiB
C#
82 lines
2.1 KiB
C#
using Content.Shared.Whitelist;
|
|
using Robust.Shared.Analyzers;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared._DV.SmartFridge;
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
|
|
public sealed partial class SmartFridgeComponent : Component
|
|
{
|
|
[DataField]
|
|
public string Container = "smart_fridge_inventory";
|
|
|
|
[DataField]
|
|
public EntityWhitelist? Whitelist;
|
|
|
|
[DataField]
|
|
public EntityWhitelist? Blacklist;
|
|
|
|
[DataField]
|
|
public SoundSpecifier? InsertSound = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/revolver_magin.ogg");
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public List<SmartFridgeEntry> Entries = new();
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public Dictionary<SmartFridgeEntry, List<NetEntity>> ContainedEntries = new();
|
|
|
|
/// <summary>
|
|
/// Sound that plays when ejecting an item
|
|
/// </summary>
|
|
[DataField]
|
|
public SoundSpecifier SoundVend = new SoundPathSpecifier("/Audio/Machines/machine_vend.ogg")
|
|
{
|
|
Params = new AudioParams
|
|
{
|
|
Volume = -4f,
|
|
Variation = 0.15f
|
|
}
|
|
};
|
|
|
|
/// <summary>
|
|
/// Sound that plays when an item can't be ejected
|
|
/// </summary>
|
|
[DataField]
|
|
public SoundSpecifier SoundDeny = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg");
|
|
|
|
// Frontier:
|
|
/// <summary>
|
|
/// The maximum number of entities that can be stored in the fridge
|
|
/// </summary>
|
|
[DataField]
|
|
public int MaxContainedCount = 300;
|
|
// End Frontier
|
|
}
|
|
|
|
[Serializable, NetSerializable, DataRecord]
|
|
public record struct SmartFridgeEntry
|
|
{
|
|
public string Name;
|
|
|
|
public SmartFridgeEntry(string name)
|
|
{
|
|
Name = name;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum SmartFridgeUiKey
|
|
{
|
|
Key,
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class SmartFridgeDispenseItemMessage(SmartFridgeEntry entry) : BoundUserInterfaceMessage
|
|
{
|
|
public SmartFridgeEntry Entry = entry;
|
|
}
|