From 2abe4a8a0244b8b514c9c1c908d11c82d2e040fe Mon Sep 17 00:00:00 2001 From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Thu, 7 Aug 2025 05:32:25 -0700 Subject: [PATCH] Fix Ingestion Localization Pop-ups (#39437) Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: ScarKy0 --- Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs | 5 ++++- .../Nutrition/EntitySystems/SharedDrinkSystem.cs | 6 ++++-- Content.Shared/Nutrition/Prototypes/EdiblePrototype.cs | 8 +++++++- .../en-US/nutrition/components/ingestion-system.ftl | 3 +++ Resources/Prototypes/Nutrition/edible.yml | 3 +++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs b/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs index 3ac2df6508..470747fa3f 100644 --- a/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs +++ b/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs @@ -466,7 +466,10 @@ public sealed partial class IngestionSystem : EntitySystem } else { - _popup.PopupClient(Loc.GetString(edible.Message, ("food", entity.Owner), ("flavors", flavors)), args.User, args.User); + _popup.PopupPredicted(Loc.GetString(edible.Message, ("food", entity.Owner), ("flavors", flavors)), + Loc.GetString(edible.OtherMessage), + args.User, + args.User); // log successful voluntary eating _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(entity):food}"); diff --git a/Content.Shared/Nutrition/EntitySystems/SharedDrinkSystem.cs b/Content.Shared/Nutrition/EntitySystems/SharedDrinkSystem.cs index 303d94d55f..fe804dd2e6 100644 --- a/Content.Shared/Nutrition/EntitySystems/SharedDrinkSystem.cs +++ b/Content.Shared/Nutrition/EntitySystems/SharedDrinkSystem.cs @@ -141,8 +141,10 @@ public abstract partial class SharedDrinkSystem : EntitySystem } else { - _popup.PopupClient(Loc.GetString("edible-slurp", ("flavors", flavors)), args.User, args.User); - _popup.PopupEntity(Loc.GetString("edible-slurp"), args.User, Filter.PvsExcept(args.User), true); + _popup.PopupPredicted(Loc.GetString("edible-slurp", ("flavors", flavors)), + Loc.GetString("edible-slurp-other"), + args.User, + args.User); // log successful voluntary drinking _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} drank {ToPrettyString(entity.Owner):drink}"); diff --git a/Content.Shared/Nutrition/Prototypes/EdiblePrototype.cs b/Content.Shared/Nutrition/Prototypes/EdiblePrototype.cs index 0f4c23846a..2cfe900167 100644 --- a/Content.Shared/Nutrition/Prototypes/EdiblePrototype.cs +++ b/Content.Shared/Nutrition/Prototypes/EdiblePrototype.cs @@ -21,11 +21,17 @@ public sealed partial class EdiblePrototype : IPrototype public SoundSpecifier UseSound = new SoundCollectionSpecifier("eating"); /// - /// The localization identifier for the ingestion message. + /// The localization identifier for the user's ingestion message. /// [DataField] public LocId Message; + /// + /// The localization identifier for an observer's or "others'" ingestion message. + /// + [DataField] + public LocId OtherMessage; + /// /// Localization verb used when consuming this item. /// diff --git a/Resources/Locale/en-US/nutrition/components/ingestion-system.ftl b/Resources/Locale/en-US/nutrition/components/ingestion-system.ftl index 692100e61a..a82eae11e3 100644 --- a/Resources/Locale/en-US/nutrition/components/ingestion-system.ftl +++ b/Resources/Locale/en-US/nutrition/components/ingestion-system.ftl @@ -26,9 +26,12 @@ ingestion-verb-drink = Drink # Edible Component edible-nom = Nom. {$flavors} +edible-nom-other = Nom. edible-slurp = Slurp. {$flavors} +edible-slurp-other = Slurp. edible-swallow = You swallow { THE($food) } edible-gulp = Gulp. {$flavors} +edible-gulp-other = Gulp. edible-has-used-storage = You cannot {$verb} { THE($food) } with an item stored inside. diff --git a/Resources/Prototypes/Nutrition/edible.yml b/Resources/Prototypes/Nutrition/edible.yml index 1b29bbed69..3dd11521ef 100644 --- a/Resources/Prototypes/Nutrition/edible.yml +++ b/Resources/Prototypes/Nutrition/edible.yml @@ -11,6 +11,7 @@ volume: -1 collection: eating # I think this *should* grab the sound specifier... message: edible-nom + otherMessage: edible-nom-other verb: edible-verb-food noun: edible-noun-food verbName: ingestion-verb-food @@ -26,6 +27,7 @@ volume: -2 path: /Audio/Items/drink.ogg message: edible-slurp + otherMessage: edible-slurp-other verb: edible-verb-drink noun: edible-noun-drink verbName: ingestion-verb-drink @@ -41,6 +43,7 @@ volume: -1 path: /Audio/Items/pill.ogg message: edible-swallow + otherMessage: edible-gulp-other verb: edible-verb-pill noun: edible-noun-pill verbName: ingestion-verb-food -- 2.51.2