mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* - rework a bunch of cargo orders to not send a crate with just one thing - instead sends the item, wrapped - add ability for cargo orders to wrap the item ordered in parcel wrap - cargo order name and descriptions are now localization strings, but still 99.99% of the time just get that info from the entity they're spawning - small refactor to how cargo orders move around in cargo code so that the actual order proto is kept around longer - small rework to certain restock cargo orders to halve the cost and number of items received in one order * oop * Suffering * Arbitrary containers for cargo products * I ran the tests locally and they passed, github please rerun :) * massage Slarti's work into this. Mainly by taking the API wrapping ability out back with the rifle q-q * testfail fake * wow `_applyingState` is useful, I wonder where I should've been using that in other PRs before :^) * pr comments * tfw the hook doesn't update the submodule * Update Content.Client/Cargo/UI/CargoConsoleMenu.xaml.cs Co-authored-by: āda <ss.adasts@gmail.com> * PR comments * fixies * Update Content.Client/Cargo/UI/CargoConsoleMenu.xaml.cs * Update Content.Shared/ParcelWrap/Systems/ParcelWrappingSystem.WrappedParcel.cs * fix wrapped parcel entity name + audio * Actually read PR comments * Apply suggestions from code review Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> --------- Co-authored-by: āda <ss.adasts@gmail.com> Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
71 lines
2.4 KiB
C#
71 lines
2.4 KiB
C#
using Content.Shared.Item;
|
|
using Content.Shared.ParcelWrap.Systems;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Containers;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.ParcelWrap.Components;
|
|
|
|
/// <summary>
|
|
/// This component marks its owner as being a parcel created by wrapping another item up. It can be unwrapped,
|
|
/// destroying this entity and releasing <see cref="Contents"/>.
|
|
/// </summary>
|
|
/// <seealso cref="ParcelWrapComponent"/>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
[Access(typeof(ParcelWrappingSystem))]
|
|
public sealed partial class WrappedParcelComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The contents of this parcel.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
public ContainerSlot Contents = default!;
|
|
|
|
/// <summary>
|
|
/// Specifies the entity to spawn when this parcel is unwrapped.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public EntProtoId? UnwrapTrash;
|
|
|
|
/// <summary>
|
|
/// How long it takes to unwrap this parcel.
|
|
/// </summary>
|
|
[DataField(required: true), AutoNetworkedField]
|
|
public TimeSpan UnwrapDelay = TimeSpan.FromSeconds(1);
|
|
|
|
/// <summary>
|
|
/// Sound played when unwrapping this parcel.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public SoundSpecifier? UnwrapSound;
|
|
|
|
/// <summary>
|
|
/// The ID of <see cref="Contents"/>.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadOnly)]
|
|
public string ContainerId = "contents";
|
|
|
|
/// <summary>
|
|
/// If true, the owner of this entity has its <see cref="ItemComponent.Size"/> set to the size of any item inserted
|
|
/// into <see cref="Container"/>. If the contents do not have a size,
|
|
/// <see cref="ParcelWrappingSystem._fallbackParcelSize"/> is used instead.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool GetsSizeFromContent = true;
|
|
|
|
/// <summary>
|
|
/// If true, the owner of this entity has its <see cref="ItemComponent.Shape"/> set to the shape of any item
|
|
/// inserted into <see cref="Container"/>.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool GetsShapeFromContent;
|
|
|
|
/// <summary>
|
|
/// If a player trapped inside this parcel can escape from it by unwrapping it.
|
|
/// This is set by the <see cref="ParcelWrapComponent" /> used to create the parcel.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool CanSelfUnwrap = true;
|
|
}
|