[Add] Adds the accentless trait (#18303)

* Accentless trait revival, not done yet

* Works for lizard, but for some reason dwarf crashes it

* Fixed!
This commit is contained in:
OctoRocket
2023-07-26 01:54:45 -05:00
committed by GitHub
parent f2e1329ad0
commit 84a225da47
4 changed files with 57 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
using Robust.Shared.Serialization.Manager;
namespace Content.Shared.Traits.Assorted;
/// <summary>
/// This handles removing accents when using the accentless trait.
/// </summary>
public sealed class AccentlessSystem : EntitySystem
{
/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AccentlessComponent, ComponentStartup>(RemoveAccents);
}
private void RemoveAccents(EntityUid uid, AccentlessComponent component, ComponentStartup args)
{
foreach (var accent in component.RemovedAccents.Values)
{
var accentComponent = accent.Component;
RemComp(uid, accentComponent.GetType());
}
}
}