And a bunch more.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 12:09:43 +01:00
parent 9b9babd429
commit 680ad72939
30 changed files with 176 additions and 125 deletions

View File

@@ -36,9 +36,11 @@ namespace Content.Client.Body.UI
return;
}
if (!IoCManager.Resolve<IEntityManager>().EntityExists(scannerState.Uid))
var entMan = IoCManager.Resolve<IEntityManager>();
if (!entMan.EntityExists(scannerState.Uid))
{
throw new ArgumentException($"Received an invalid entity with id {scannerState.Uid} for body scanner with id {Owner.Owner} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Owner).MapPosition}");
throw new ArgumentException($"Received an invalid entity with id {scannerState.Uid} for body scanner with id {Owner.Owner} at {entMan.GetComponent<TransformComponent>(Owner.Owner).MapPosition}");
}
_display?.UpdateDisplay(_entity);

View File

@@ -146,10 +146,11 @@ namespace Content.Client.Body.UI
private void UpdateBodyPartBox(SharedBodyPartComponent part, string slotName)
{
BodyPartLabel.Text = $"{Loc.GetString(slotName)}: {Loc.GetString(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(part.Owner).EntityName)}";
var entMan = IoCManager.Resolve<IEntityManager>();
BodyPartLabel.Text = $"{Loc.GetString(slotName)}: {Loc.GetString(entMan.GetComponent<MetaDataComponent>(part.Owner).EntityName)}";
// TODO BODY Part damage
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(part.Owner, out DamageableComponent? damageable))
if (entMan.TryGetComponent(part.Owner, out DamageableComponent? damageable))
{
BodyPartHealth.Text = Loc.GetString("body-scanner-display-body-part-damage-text",("damage", damageable.TotalDamage));
}