stack cleanup and mild refactoring (#11717)

* stack cleanup

* fix tests and ulong

* somehow did half a commit

* ulong got usmall. (it's ints now)

* sussy baka cleanup

* mirror's review

* make da tests pass again

* shadowcommander review

* sloth por favor

* Update StoreSystem.Ui.cs
This commit is contained in:
Nemanja
2022-11-08 21:24:23 -05:00
committed by GitHub
parent eebb31493c
commit 9428d4b341
31 changed files with 252 additions and 115 deletions

View File

@@ -8,8 +8,8 @@ namespace Content.Shared.Stacks
public abstract class SharedStackComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<StackPrototype>))]
public string StackTypeId { get; private set; } = string.Empty;
[DataField("stackType", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<StackPrototype>))]
public string? StackTypeId { get; private set; }
/// <summary>
/// Current stack count.
@@ -20,10 +20,11 @@ namespace Content.Shared.Stacks
/// <summary>
/// Max amount of things that can be in the stack.
/// Overrides the max defined on the stack prototype.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
[DataField("max")]
public int MaxCount { get; set; } = 30;
[DataField("maxCountOverride")]
public int? MaxCountOverride { get; set; }
/// <summary>
/// Set to true to not reduce the count when used.
@@ -31,9 +32,6 @@ namespace Content.Shared.Stacks
[DataField("unlimited")]
[ViewVariables(VVAccess.ReadOnly)]
public bool Unlimited { get; set; }
[ViewVariables]
public int AvailableSpace => MaxCount - Count;
}
[Serializable, NetSerializable]