-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Accents, Accent Weight Change + New Irish Accent Redux (From PR #…
…1640 Thanks GitHub) (#1701) * From the top! - Redid my branch... * Cleanup with some comments and explanation * Testing if Accentless is issue- failed build test * Wasn't the bug- * Changed accent weights based off int discussion * uh, forgot comment change * Changed comments a final time- reflect new weights --------- Co-authored-by: Adeinitas <[email protected]>
- Loading branch information
1 parent
1e2eb23
commit 303eae8
Showing
7 changed files
with
1,006 additions
and
40 deletions.
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); | ||
} | ||
} |
Oops, something went wrong.