Fix Ingestion Localization Pop-ups (#39437)

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
Princess Cheeseballs 2025-08-07 05:32:25 -07:00 committed by Vanessa
parent 0fce727d62
commit 6bfa31a3bd
5 changed files with 21 additions and 4 deletions

View 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}");

View 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}");

View 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>

View 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.

View 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