Adds support for unlimited stacks (#5084)

Co-authored-by: ike709 <ike709@github.com>
This commit is contained in:
ike709
2021-10-31 08:27:11 -05:00
committed by GitHub
parent 0bbc4d9afe
commit 0865409521
3 changed files with 16 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ namespace Content.Shared.Stacks
{
public sealed override string Name => "Stack";
[ViewVariables(VVAccess.ReadWrite)]
[DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<StackPrototype>))]
public string StackTypeId { get; private set; } = string.Empty;
@@ -32,7 +33,14 @@ namespace Content.Shared.Stacks
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
[DataField("max")]
public int MaxCount { get; set; } = 30;
public int MaxCount { get; set; } = 30;
/// <summary>
/// Set to true to not reduce the count when used.
/// </summary>
[DataField("unlimited")]
[ViewVariables(VVAccess.ReadOnly)]
public bool Unlimited { get; set; }
[ViewVariables]
public int AvailableSpace => MaxCount - Count;