]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Ingestion Localization Pop-ups (#39437)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Thu, 7 Aug 2025 12:32:25 +0000 (05:32 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Aug 2025 12:32:25 +0000 (14:32 +0200)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs
Content.Shared/Nutrition/EntitySystems/SharedDrinkSystem.cs
Content.Shared/Nutrition/Prototypes/EdiblePrototype.cs
Resources/Locale/en-US/nutrition/components/ingestion-system.ftl
Resources/Prototypes/Nutrition/edible.yml

index 3ac2df6508c90c57e01c56f89a5740ad27fdc41e..470747fa3f7d2a8dee50dcf089a77c725079f9c3 100644 (file)
@@ -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}");
index 303d94d55f609e4f135f382466c85d253defa230..fe804dd2e6a7e0d593371b84cb46d4573d531b94 100644 (file)
@@ -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}");
index 0f4c23846af9b8488b42b65bbfccbb763539ce51..2cfe90016724ce06b177e0dc84dbaa6ed4dfffdd 100644 (file)
@@ -21,11 +21,17 @@ public sealed partial class EdiblePrototype : IPrototype
     public SoundSpecifier UseSound = new SoundCollectionSpecifier("eating");
 
     /// <summary>
-    /// The localization identifier for the ingestion message.
+    /// The localization identifier for the user's ingestion message.
     /// </summary>
     [DataField]
     public LocId Message;
 
+    /// <summary>
+    /// The localization identifier for an observer's or "others'" ingestion message.
+    /// </summary>
+    [DataField]
+    public LocId OtherMessage;
+
     /// <summary>
     /// Localization verb used when consuming this item.
     /// </summary>
index 692100e61a0d9bc6890ea420c688f7936bcda8ac..a82eae11e305f7b79d658400d981d2d8f6fa8906 100644 (file)
@@ -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.
 
index 1b29bbed69488eb4ef82f76b560861e41d0698bb..3dd11521ef3bc1fdaab7a7759253554d720430e2 100644 (file)
@@ -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