Begin to use text macros (#914)
This commit is contained in:
@@ -7,6 +7,7 @@ using Robust.Shared.Interfaces.GameObjects;
|
|||||||
using Robust.Shared.Interfaces.Map;
|
using Robust.Shared.Interfaces.Map;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Timers;
|
using Robust.Shared.Timers;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
@@ -124,13 +125,12 @@ namespace Content.Server.GameObjects.Components.Mobs
|
|||||||
if (species.CurrentDamageState is DeadState)
|
if (species.CurrentDamageState is DeadState)
|
||||||
dead = true;
|
dead = true;
|
||||||
|
|
||||||
// TODO: Use gendered pronouns depending on the entity
|
|
||||||
if(!HasMind)
|
if(!HasMind)
|
||||||
message.AddMarkup(!dead
|
message.AddMarkup(!dead
|
||||||
? $"[color=red]They are totally catatonic. The stresses of life in deep-space must have been too much for them. Any recovery is unlikely.[/color]"
|
? $"[color=red]" + Loc.GetString("{0:They} are totally catatonic. The stresses of life in deep-space must have been too much for {0:them}. Any recovery is unlikely.", Owner) + "[/color]"
|
||||||
: $"[color=purple]Their soul has departed.[/color]");
|
: $"[color=purple]" + Loc.GetString("{0:Their} soul has departed.", Owner) + "[/color]");
|
||||||
else if(Mind.Session == null)
|
else if (Mind.Session == null)
|
||||||
message.AddMarkup("[color=yellow]They have a blank, absent-minded stare and appears completely unresponsive to anything. They may snap out of it soon.[/color]");
|
message.AddMarkup("[color=yellow]" + Loc.GetString("{0:They} have a blank, absent-minded stare and appears completely unresponsive to anything. {0:They} may snap out of it soon.", Owner) + "[/color]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
using Robust.Shared.Interfaces.Map;
|
using Robust.Shared.Interfaces.Map;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Localization.Macros;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Shared
|
namespace Content.Shared
|
||||||
{
|
{
|
||||||
@@ -25,6 +26,9 @@
|
|||||||
{
|
{
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
|
var textMacroFactory = IoCManager.Resolve<ITextMacroFactory>();
|
||||||
|
textMacroFactory.DoAutoRegistrations();
|
||||||
|
|
||||||
// Default to en-US.
|
// Default to en-US.
|
||||||
_localizationManager.LoadCulture(new CultureInfo(Culture));
|
_localizationManager.LoadCulture(new CultureInfo(Culture));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using Content.Shared.Preferences;
|
using Content.Shared.Preferences;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Localization.Macros;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Shared.GameObjects.Components.Mobs
|
namespace Content.Shared.GameObjects.Components.Mobs
|
||||||
{
|
{
|
||||||
public abstract class SharedHumanoidAppearanceComponent : Component
|
public abstract class SharedHumanoidAppearanceComponent : Component, IGenderable
|
||||||
{
|
{
|
||||||
private HumanoidCharacterAppearance _appearance;
|
private HumanoidCharacterAppearance _appearance;
|
||||||
private Sex _sex;
|
private Sex _sex;
|
||||||
@@ -36,6 +37,13 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Gender Gender => Sex switch
|
||||||
|
{
|
||||||
|
Sex.Female => Gender.Female,
|
||||||
|
Sex.Male => Gender.Male,
|
||||||
|
_ => Gender.Epicene,
|
||||||
|
};
|
||||||
|
|
||||||
public override ComponentState GetComponentState()
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new HumanoidAppearanceComponentState(Appearance, Sex);
|
return new HumanoidAppearanceComponentState(Appearance, Sex);
|
||||||
|
|||||||
Reference in New Issue
Block a user