AccentlessSystem.cs 724 B

1234567891011121314151617181920212223242526
  1. using Robust.Shared.Serialization.Manager;
  2. namespace Content.Shared.Traits.Assorted;
  3. /// <summary>
  4. /// This handles removing accents when using the accentless trait.
  5. /// </summary>
  6. public sealed class AccentlessSystem : EntitySystem
  7. {
  8. /// <inheritdoc/>
  9. public override void Initialize()
  10. {
  11. base.Initialize();
  12. SubscribeLocalEvent<AccentlessComponent, ComponentStartup>(RemoveAccents);
  13. }
  14. private void RemoveAccents(EntityUid uid, AccentlessComponent component, ComponentStartup args)
  15. {
  16. foreach (var accent in component.RemovedAccents.Values)
  17. {
  18. var accentComponent = accent.Component;
  19. RemComp(uid, accentComponent.GetType());
  20. }
  21. }
  22. }