-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into floof-merge
- Loading branch information
Showing
8 changed files
with
1,015 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
Content.Server/DeltaV/Speech/Components/IrishAccentComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Content.Server.DeltaV.Speech.EntitySystems; | ||
|
||
namespace Content.Server.DeltaV.Speech.Components; | ||
|
||
// Takes the ES and assigns the system and component to each other | ||
[RegisterComponent] | ||
[Access(typeof(IrishAccentSystem))] | ||
public sealed partial class IrishAccentComponent : Component | ||
{ } |
33 changes: 33 additions & 0 deletions
33
Content.Server/DeltaV/Speech/EntitySystems/IrishAccentSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Content.Server.DeltaV.Speech.Components; | ||
using Content.Server.Speech; | ||
using Content.Server.Speech.EntitySystems; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace Content.Server.DeltaV.Speech.EntitySystems; | ||
|
||
public sealed class IrishAccentSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ReplacementAccentSystem _replacement = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<IrishAccentComponent, AccentGetEvent>(OnAccentGet); | ||
} | ||
|
||
// converts left word when typed into the right word. For example typing you becomes ye. | ||
public string Accentuate(string message, IrishAccentComponent component) | ||
{ | ||
var msg = message; | ||
|
||
msg = _replacement.ApplyReplacements(msg, "irish"); | ||
|
||
return msg; | ||
} | ||
|
||
private void OnAccentGet(EntityUid uid, IrishAccentComponent component, AccentGetEvent args) | ||
{ | ||
args.Message = Accentuate(args.Message, component); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.