@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user