Inline Name

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:25:51 +01:00
parent 61be228ad0
commit ee4ff9cfe8
97 changed files with 237 additions and 177 deletions

View File

@@ -187,13 +187,13 @@ namespace Content.Server.Chemistry.Components
!EntitySystem.Get<SolutionContainerSystem>().TryGetSolution(beaker.Uid, fits.Solution, out var beakerSolution))
{
return new ChemMasterBoundUserInterfaceState(Powered, false, FixedPoint2.New(0), FixedPoint2.New(0),
"", _label, Owner.Name, new List<Solution.ReagentQuantity>(), BufferSolution.Contents, _bufferModeTransfer,
"", _label, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, new List<Solution.ReagentQuantity>(), BufferSolution.Contents, _bufferModeTransfer,
BufferSolution.TotalVolume, _pillType);
}
return new ChemMasterBoundUserInterfaceState(Powered, true, beakerSolution.CurrentVolume,
beakerSolution.MaxVolume,
beaker.Name, _label, Owner.Name, beakerSolution.Contents, BufferSolution.Contents, _bufferModeTransfer,
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(beaker.Uid).EntityName, _label, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, beakerSolution.Contents, BufferSolution.Contents, _bufferModeTransfer,
BufferSolution.TotalVolume, _pillType);
}
@@ -306,8 +306,9 @@ namespace Content.Server.Chemistry.Components
//Adding label
LabelComponent labelComponent = bottle.EnsureComponent<LabelComponent>();
labelComponent.OriginalName = bottle.Name;
bottle.Name += $" ({label})";
labelComponent.OriginalName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(bottle.Uid).EntityName;
string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(bottle.Uid).EntityName + $" ({label})";
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(bottle.Uid).EntityName = val;
labelComponent.CurrentLabel = label;
var bufferSolution = BufferSolution.SplitSolution(actualVolume);
@@ -348,8 +349,9 @@ namespace Content.Server.Chemistry.Components
//Adding label
LabelComponent labelComponent = pill.EnsureComponent<LabelComponent>();
labelComponent.OriginalName = pill.Name;
pill.Name += $" ({label})";
labelComponent.OriginalName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pill.Uid).EntityName;
string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pill.Uid).EntityName + $" ({label})";
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pill.Uid).EntityName = val;
labelComponent.CurrentLabel = label;
var bufferSolution = BufferSolution.SplitSolution(actualVolume);

View File

@@ -230,12 +230,12 @@ namespace Content.Server.Chemistry.Components
{
return new ReagentDispenserBoundUserInterfaceState(Powered, false, FixedPoint2.New(0),
FixedPoint2.New(0),
string.Empty, Inventory, Owner.Name, null, _dispenseAmount);
string.Empty, Inventory, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, null, _dispenseAmount);
}
return new ReagentDispenserBoundUserInterfaceState(Powered, true, solution.CurrentVolume,
solution.MaxVolume,
beaker.Name, Inventory, Owner.Name, solution.Contents.ToList(), _dispenseAmount);
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(beaker.Uid).EntityName, Inventory, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, solution.Contents.ToList(), _dispenseAmount);
}
public void UpdateUserInterface()

View File

@@ -29,7 +29,7 @@ namespace Content.Server.Chemistry.Components
InitialSprite = new SpriteSpecifier.Rsi(new ResourcePath(sprite.BaseRSIPath), "icon");
}
InitialName = Owner.Name;
InitialName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName;
InitialDescription = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription;
}