Inline Description

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:15:12 +01:00
parent 70bbd8c502
commit f06bfc22ce
9 changed files with 16 additions and 11 deletions

View File

@@ -55,7 +55,7 @@ namespace Content.Server.Atmos.Components
return; return;
} }
Owner.Description = _type switch var val = _type switch
{ {
PlaqueType.Zumos => PlaqueType.Zumos =>
"This plaque commemorates the rise of the Atmos ZUM division. May they carry the torch that the Atmos ZAS, LINDA and FEA divisions left behind.", "This plaque commemorates the rise of the Atmos ZUM division. May they carry the torch that the Atmos ZAS, LINDA and FEA divisions left behind.",
@@ -68,6 +68,7 @@ namespace Content.Server.Atmos.Components
PlaqueType.Unset => "Uhm", PlaqueType.Unset => "Uhm",
_ => "Uhm", _ => "Uhm",
}; };
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription = val;
Owner.Name = _type switch Owner.Name = _type switch
{ {

View File

@@ -90,7 +90,7 @@ namespace Content.Server.BarSign.Systems
component.Owner.Name = Loc.GetString("barsign-component-name"); component.Owner.Name = Loc.GetString("barsign-component-name");
} }
component.Owner.Description = prototype.Description; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityDescription = prototype.Description;
} }
} }
} }

View File

@@ -342,7 +342,8 @@ namespace Content.Server.Botany
if (Mysterious) if (Mysterious)
{ {
entity.Name += "?"; entity.Name += "?";
entity.Description += " " + Loc.GetString("botany-mysterious-description-addon"); string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription + (" " + Loc.GetString("botany-mysterious-description-addon"));
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription = val;
} }
} }

View File

@@ -2,6 +2,7 @@ using Content.Server.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Utility; using Robust.Shared.Utility;
namespace Content.Server.Chemistry.Components namespace Content.Server.Chemistry.Components
@@ -29,7 +30,7 @@ namespace Content.Server.Chemistry.Components
} }
InitialName = Owner.Name; InitialName = Owner.Name;
InitialDescription = Owner.Description; InitialDescription = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription;
} }
protected override void Startup() protected override void Startup()

View File

@@ -57,7 +57,7 @@ namespace Content.Server.Chemistry.EntitySystems
} }
ownerEntity.Name = proto.Name + " glass"; ownerEntity.Name = proto.Name + " glass";
ownerEntity.Description = proto.Description; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ownerEntity.Uid).EntityDescription = proto.Description;
component.CurrentReagent = proto; component.CurrentReagent = proto;
component.Transformed = true; component.Transformed = true;
} }
@@ -75,7 +75,7 @@ namespace Content.Server.Chemistry.EntitySystems
} }
component.Owner.Name = component.InitialName; component.Owner.Name = component.InitialName;
component.Owner.Description = component.InitialDescription; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityDescription = component.InitialDescription;
} }
} }
} }

View File

@@ -268,7 +268,7 @@ namespace Content.Server.Cuffs.Components
cuff.Broken = true; cuff.Broken = true;
cuffsToRemove.Name = cuff.BrokenName; cuffsToRemove.Name = cuff.BrokenName;
cuffsToRemove.Description = cuff.BrokenDesc; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(cuffsToRemove.Uid).EntityDescription = cuff.BrokenDesc;
if (cuffsToRemove.TryGetComponent<SpriteComponent>(out var sprite) && cuff.BrokenState != null) if (cuffsToRemove.TryGetComponent<SpriteComponent>(out var sprite) && cuff.BrokenState != null)
{ {

View File

@@ -5,6 +5,7 @@ using Content.Shared.Light.Component;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -155,7 +156,7 @@ namespace Content.Server.Light.Components
CurrentState = ExpendableLightState.Dead; CurrentState = ExpendableLightState.Dead;
Owner.Name = SpentName; Owner.Name = SpentName;
Owner.Description = SpentDesc; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription = SpentDesc;
UpdateSpriteAndSounds(Activated); UpdateSpriteAndSounds(Activated);
UpdateVisualizer(); UpdateVisualizer();

View File

@@ -6,6 +6,7 @@ using Content.Shared.Paper;
using Content.Shared.Tag; using Content.Shared.Tag;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -95,7 +96,7 @@ namespace Content.Server.Paper
appearance.SetData(PaperVisuals.Status, PaperStatus.Written); appearance.SetData(PaperVisuals.Status, PaperStatus.Written);
} }
Owner.Description = ""; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription = "";
UpdateUserInterface(); UpdateUserInterface();
} }

View File

@@ -212,9 +212,9 @@ namespace Content.Shared.Examine
var doNewline = false; var doNewline = false;
//Add an entity description if one is declared //Add an entity description if one is declared
if (!string.IsNullOrEmpty(entity.Description)) if (!string.IsNullOrEmpty(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription))
{ {
message.AddText(entity.Description); message.AddText(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription);
doNewline = true; doNewline = true;
} }