Simplifying Machine Upgrading (#15802)

This commit is contained in:
Nemanja
2023-04-28 23:23:49 -04:00
committed by GitHub
parent cedec8d415
commit 823c8204c9
49 changed files with 199 additions and 499 deletions

View File

@@ -1,5 +1,7 @@
using Content.Shared.Construction.Components;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Examine;
using Robust.Shared.Prototypes;
namespace Content.Shared.Construction
{
@@ -8,6 +10,8 @@ namespace Content.Shared.Construction
/// </summary>
public sealed class MachinePartSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
public override void Initialize()
{
base.Initialize();
@@ -24,7 +28,7 @@ namespace Content.Shared.Construction
{
args.PushMarkup(Loc.GetString("machine-board-component-required-element-entry-text",
("amount", amount),
("requiredElement", Loc.GetString(part))));
("requiredElement", Loc.GetString(_prototype.Index<MachinePartPrototype>(part).Name))));
}
foreach (var (material, amount) in component.MaterialRequirements)
@@ -54,7 +58,8 @@ namespace Content.Shared.Construction
if (!args.IsInDetailsRange)
return;
args.PushMarkup(Loc.GetString("machine-part-component-on-examine-rating-text", ("rating", component.Rating)));
args.PushMarkup(Loc.GetString("machine-part-component-on-examine-type-text", ("type", component.PartType)));
args.PushMarkup(Loc.GetString("machine-part-component-on-examine-type-text", ("type",
Loc.GetString(_prototype.Index<MachinePartPrototype>(component.PartType).Name))));
}
}
}