lathe recipes no longer specify textures (#12944)

Co-authored-by: Moony <moony@hellomouse.net>
This commit is contained in:
Nemanja
2023-01-01 18:56:03 -05:00
committed by GitHub
parent 4a7c0b94b2
commit 69971272e6
20 changed files with 25 additions and 566 deletions

View File

@@ -17,14 +17,20 @@ namespace Content.Shared.Research.Prototypes
[DataField("name")]
private string _name = string.Empty;
[DataField("icon")]
private SpriteSpecifier _icon = SpriteSpecifier.Invalid;
[DataField("description")]
private string _description = string.Empty;
[DataField("result", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string _result = string.Empty;
/// <summary>
/// The prototype name of the resulting entity when the recipe is printed.
/// </summary>
[DataField("result", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Result = string.Empty;
/// <summary>
/// An entity whose sprite is displayed in the ui in place of the actual recipe result.
/// </summary>
[DataField("icon")]
public SpriteSpecifier? Icon;
[DataField("completetime")]
private TimeSpan _completeTime = TimeSpan.FromSeconds(5);
@@ -42,7 +48,7 @@ namespace Content.Shared.Research.Prototypes
{
if (_name.Trim().Length != 0) return _name;
var protoMan = IoCManager.Resolve<IPrototypeManager>();
protoMan.TryIndex(_result, out EntityPrototype? prototype);
protoMan.TryIndex(Result, out EntityPrototype? prototype);
if (prototype?.Name != null)
_name = prototype.Name;
return _name;
@@ -59,25 +65,13 @@ namespace Content.Shared.Research.Prototypes
{
if (_description.Trim().Length != 0) return _description;
var protoMan = IoCManager.Resolve<IPrototypeManager>();
protoMan.TryIndex(_result, out EntityPrototype? prototype);
protoMan.TryIndex(Result, out EntityPrototype? prototype);
if (prototype?.Description != null)
_description = prototype.Description;
return _description;
}
}
/// <summary>
/// Texture path used in the lathe GUI.
/// </summary>
[ViewVariables]
public SpriteSpecifier Icon => _icon;
/// <summary>
/// The prototype name of the resulting entity when the recipe is printed.
/// </summary>
[ViewVariables]
public string Result => _result;
/// <summary>
/// The materials required to produce this recipe.
/// Takes a material ID as string.