Files
OldThink/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs
Remuchi 467eb84d43 [WIP] [Tweak] Ограничение раздатчиков реагентов и прочих жидкостей. (#498)
* Reapply "Add limited-reagent dispensers (#23907)"

This reverts commit 531becd592.

# Conflicts:
#	Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs
#	Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs
#	Content.Shared/Chemistry/SharedReagentDispenser.cs
#	Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs
#	Resources/Prototypes/Catalog/ReagentDispensers/beverage.yml
#	Resources/Prototypes/Entities/Objects/Specific/chemical-containers.yml
#	Resources/Prototypes/Entities/Structures/Dispensers/chem.yml

* Reapply "Fix comp.Owner (#24206)"

This reverts commit 2d2405ff93.

* Reapply "Use old reagent dispenser beaker slot ID (#24209)"

This reverts commit 388424e2f3.

* Add a container display to dispenser UI (#25391)

* Implemented contents display for dispenser UI

* Update Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>

* Resolve the netent into a euid first

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>

* Add prediction to hand labeler labels (#25869)

Added prediction to labels

* scoopable ash and foam, solution transfer prediction (#25832)

* move SolutionTransfer to shared and predict as much as possible

* fully move OpenableSystem to shared now that SolutionTransfer is

* fix imports for everything

* doc for solution transfer system

* trolling

* add scoopable system

* make ash and foam scoopable

* untroll

* untroll real

* make clickable it work

* troll

* the scooping room

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
# Conflicts:
#	Resources/Prototypes/Entities/Effects/chemistry_effects.yml

* Reagent dispenser UI (#27831)

* reagent dispenser: fancy window

* reagent dispenser: dispense button grid

* reagent dispenser: rearrange containers & info

* reagent dispenser: remove `reagent-dispenser-window-container-label`

* reagent dispenser: add `Scrollcontainer` on right side

* reagent dispenser: get rid of pointless actions

* reagent dispenser: cleanup actions and `inventory` field on bound ui state

* reagent dispenser: cool reagent cards & finishing touches

* reagent dispenser: final cleanup and formatting

* reagent dispenser: `ButtonGrid` and `ReagentDispenserSetDispenseAmountMessage` refactor

* reagent dispenser: cleanup code & address minor concerns

* reagent dispenser: text in reagent cards no longer clips

* reagent dispenser: oh wait i forgot to change this and thats why the builds keep failing probably

* reagent dispenser mayybe this

* reagent dispenser: remove `using FastAccessors;`
# Conflicts:
#	Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs

* Reagent dispenser UI (Again) (#27958)

* reagent dispenser: fancy window

* reagent dispenser: dispense button grid

* reagent dispenser: rearrange containers & info

* reagent dispenser: remove `reagent-dispenser-window-container-label`

* reagent dispenser: add `Scrollcontainer` on right side

* reagent dispenser: get rid of pointless actions

* reagent dispenser: cleanup actions and `inventory` field on bound ui state

* reagent dispenser: cool reagent cards & finishing touches

* reagent dispenser: final cleanup and formatting

* reagent dispenser: `ButtonGrid` and `ReagentDispenserSetDispenseAmountMessage` refactor

* reagent dispenser: cleanup code & address minor concerns

* reagent dispenser: text in reagent cards no longer clips

* reagent dispenser: oh wait i forgot to change this and thats why the builds keep failing probably

* reagent dispenser mayybe this

* reagent dispenser: remove `using FastAccessors;`

* delete unused classes

* disable reagent button when container is empty

* Make things a bit bigger

* remove obsolete text color override

* пару фиксов поверх

* переводики хихиххи

* еще переводы

* feat: химические картриджи

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: Brandon Li <48413902+aspiringLich@users.noreply.github.com>
2024-08-04 09:36:11 +03:00

76 lines
2.9 KiB
C#

using Content.Shared.Whitelist;
using Content.Shared.Containers.ItemSlots;
using Content.Server.Chemistry.EntitySystems;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Dispenser;
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Chemistry.Components
{
/// <summary>
/// A machine that dispenses reagents into a solution container from containers in its storage slots.
/// </summary>
[RegisterComponent]
[Access(typeof(ReagentDispenserSystem), typeof(ChemMasterSystem))]
public sealed partial class ReagentDispenserComponent : Component
{
/// <summary>
/// String with the pack name that stores the initial fill of the dispenser. The initial
/// fill is added to the dispenser on MapInit. Note that we don't use ContainerFill because
/// we have to generate the storage slots at MapInit first, then fill them.
/// </summary>
[DataField("pack", customTypeSerializer:typeof(PrototypeIdSerializer<ReagentDispenserInventoryPrototype>))]
[ViewVariables(VVAccess.ReadWrite)]
public string? PackPrototypeId = default!;
/// <summary>
/// Maximum number of internal storage slots. Dispenser can't store (or dispense) more than
/// this many chemicals (without unloading and reloading).
/// </summary>
[DataField("numStorageSlots")]
public int NumSlots = 25;
/// <summary>
/// For each created storage slot for the reagent containers being dispensed, apply this
/// entity whitelist. Makes sure weird containers don't fit in the dispenser and that beakers
/// don't accidentally get slotted into the source slots.
/// </summary>
[DataField]
public EntityWhitelist? StorageWhitelist;
[DataField]
public ItemSlot BeakerSlot = new();
/// <summary>
/// Prefix for automatically-generated slot name for storage, up to NumSlots.
/// </summary>
public static string BaseStorageSlotId = "ReagentDispenser-storageSlot";
/// <summary>
/// List of storage slots that were created at MapInit.
/// </summary>
[DataField]
public List<string> StorageSlotIds = new List<string>();
[DataField]
public List<ItemSlot> StorageSlots = new List<ItemSlot>();
[DataField("clickSound"), ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier ClickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
[ViewVariables(VVAccess.ReadWrite)]
public ReagentDispenserDispenseAmount DispenseAmount = ReagentDispenserDispenseAmount.U10;
// WD START
public const string ChemMasterPort = "ChemMasterSender";
[ViewVariables]
public bool ChemMasterInRange;
[ViewVariables]
public EntityUid? ChemMaster;
// WD END
}
}