mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
* Shitspawner Extraordinare * Shitcoder Extraordinare * the code is leaking * ёбушки-воробушки * it will all be over soon * шутки кончились * virtual selfantag * шейдеры это на удивление весело * i'm tired boss * connection terminated * консервная банка * а чё сразу нельзя было? * minus * Removed Herobrine. * мусор * Apply suggestions from code review Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com> * code review * fix: unshit * shit: unfix * потемнее * переперевод * ok i clean up * жопа Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com> * scuffed english localization --------- Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
121 lines
3.4 KiB
C#
121 lines
3.4 KiB
C#
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Content.Shared._White.Event;
|
|
|
|
[RegisterComponent, AutoGenerateComponentState(true), NetworkedComponent]
|
|
public sealed partial class EventItemDispenserComponent : Component
|
|
{
|
|
|
|
[DataField("dispensing"), AutoNetworkedField]
|
|
public EntProtoId DispensingPrototype;
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public bool CanManuallyDispose = true;
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public bool AutoDispose = true;
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public bool Infinite = true;
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public int Limit = 3;
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public bool AutoCleanUp = true;
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public SoundSpecifier DispenseSound = new SoundPathSpecifier("/Audio/Machines/machine_vend.ogg");
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public SoundSpecifier FailSound = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg");
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public SoundSpecifier ManualDisposeSound = new SoundCollectionSpecifier("trashBagRustle");
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public bool ReplaceDisposedItems = true;
|
|
[DataField, AutoNetworkedField]
|
|
public EntProtoId DisposedReplacement = "EffectTeslaSparksSilent";
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public float ItemPreviewScale = 0f;
|
|
|
|
/// <summary>
|
|
/// Stores Lists with all (currently existing) items.
|
|
/// Owners' Uids used as keys.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public Dictionary<EntityUid, List<EntityUid>> dispensedItems = new();
|
|
|
|
/// <summary>
|
|
/// Stores the amount of items spawned by each person in this dispenser's lifetime.
|
|
/// Owners' Uids used as keys.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public Dictionary<EntityUid, int> dispensedItemsAmount = new();
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Stores relevant info about who dispensed this item to avoid having to look for it in the dispensedItems dict.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed partial class EventDispensedComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The person who took the item.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public EntityUid ItemOwner;
|
|
/// <summary>
|
|
/// The dispenser which dispensed (duh) the item.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public EntityUid Dispenser;
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public List<EntityUid> Slaved = new();
|
|
}
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum EventItemDispenserUiKey : byte
|
|
{
|
|
Key,
|
|
}
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
public class EventItemDispenserNewConfigBoundUserInterfaceMessage : BoundUserInterfaceMessage
|
|
{
|
|
public string DispensingPrototype = "FoodBanana";
|
|
public bool CanManuallyDispose;
|
|
public bool AutoDispose;
|
|
public bool Infinite;
|
|
public int Limit;
|
|
public bool AutoCleanUp;
|
|
public bool ReplaceDisposedItems;
|
|
public string DisposedReplacement = "EffectTeslaSparksSilent";
|
|
}
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
public class EventItemDispenserNewProtoBoundUserInterfaceMessage : BoundUserInterfaceMessage
|
|
{
|
|
public string DispensingPrototype = "FoodBanana";
|
|
public EventItemDispenserNewProtoBoundUserInterfaceMessage(string proto) { DispensingPrototype = proto; }
|
|
}
|
|
|