Skip to content

Commit

Permalink
Finalize illesim toggle action and localize
Browse files Browse the repository at this point in the history
  • Loading branch information
thetolbean committed Feb 5, 2025
1 parent e3a7567 commit 0939718
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Content.Server/Speech/EntitySystems/IlleismAccentSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Text.RegularExpressions;
using Content.Server.Actions;
using Content.Server.Popups;
using Content.Server.Speech.Components;
using Content.Shared.Actions;
using Content.Shared.Toggleable;
Expand All @@ -10,6 +11,7 @@ public sealed class IlleismAccentSystem : EntitySystem
{
[Dependency] private readonly ActionsSystem _actions = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly PopupSystem _popup = default!;

// I am going -> NAME is going
private static readonly Regex RegexIAmUpper = new(@"\bI\s*AM\b|\bI'?M\b");
Expand Down Expand Up @@ -86,10 +88,10 @@ private bool MostlyUppercase(string message)

private void OnToggleAction(Entity<IlleismAccentComponent> ent, ref ToggleActionEvent args)
{
// TODO: Add popup when cycling states
if (args.Handled)
return;
ent.Comp.IllesimStateIndex = (ent.Comp.IllesimStateIndex + 1) % 3;
_popup.PopupEntity(Loc.GetString("trait-illeism-adjust"), ent.Owner, ent.Owner);
args.Handled = true;
}
private void OnAccent(EntityUid uid, IlleismAccentComponent component, AccentGetEvent args)
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ trait-liar-desc = You can hardly bring yourself to tell the truth. Sometimes you
trait-illeism-name = Illeism
trait-illeism-desc = You seem to only be able to refer to yourself by name.
trait-illeism-adjust = You adjust your illeism.
trait-cowboy-name = Cowboy accent
trait-cowboy-desc = You speak with a distinct cowboy accent!
Expand Down
3 changes: 1 addition & 2 deletions Resources/Prototypes/Actions/speech.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
description: Alternate between splitting on hyphens, spaces, or saying your full name.
components:
- type: InstantAction
icon: Interface/Actions/eyeopen.png # TO BE CHANGED, PLACEHOLDER
iconOn: Interface/Actions/eyeclose.png # TO BE CHANGED, PLACEHOLDER
icon: Interface/Actions/illeismtoggle.png # Potentially changed?
event: !type:ToggleActionEvent
useDelay: 0.2
checkCanInteract: false
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0939718

Please sign in to comment.