Lathe Categories (#24247)

* Lathe Categories

* serilog my beloathed
This commit is contained in:
Nemanja
2024-01-19 19:45:03 -05:00
committed by GitHub
parent 7583662672
commit 73e94dfa92
19 changed files with 472 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
using Content.Shared.Lathe.Prototypes;
using Content.Shared.Materials;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -38,6 +39,7 @@ namespace Content.Shared.Research.Prototypes
[DataField("materials", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, MaterialPrototype>))]
private Dictionary<string, int> _requiredMaterials = new();
//todo make these function calls because we're eating tons of resolves here.
/// <summary>
/// Name displayed in the lathe GUI.
/// </summary>
@@ -46,7 +48,8 @@ namespace Content.Shared.Research.Prototypes
{
get
{
if (_name.Trim().Length != 0) return _name;
if (_name.Trim().Length != 0)
return _name;
var protoMan = IoCManager.Resolve<IPrototypeManager>();
protoMan.TryIndex(Result, out EntityPrototype? prototype);
if (prototype?.Name != null)
@@ -63,7 +66,8 @@ namespace Content.Shared.Research.Prototypes
{
get
{
if (_description.Trim().Length != 0) return _description;
if (_description.Trim().Length != 0)
return _description;
var protoMan = IoCManager.Resolve<IPrototypeManager>();
protoMan.TryIndex(Result, out EntityPrototype? prototype);
if (prototype?.Description != null)
@@ -93,5 +97,11 @@ namespace Content.Shared.Research.Prototypes
[DataField("applyMaterialDiscount")]
public bool ApplyMaterialDiscount = true;
/// <summary>
/// A category used for visually sorting lathe recipes in the UI.
/// </summary>
[DataField]
public ProtoId<LatheCategoryPrototype>? Category;
}
}