From c58538a9fec6d8045442d064ba99d1caa4216458 Mon Sep 17 00:00:00 2001 From: Vordenburg <114301317+Vordenburg@users.noreply.github.com> Date: Mon, 3 Oct 2022 21:46:54 -0400 Subject: [PATCH] Permit ReagentEffect PopupMessage to access the solutionEntity it occurs in. (#11537) --- Content.Server/Chemistry/ReagentEffects/PopupMessage.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs b/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs index 0b445be564..e13985a22f 100644 --- a/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs +++ b/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs @@ -22,10 +22,14 @@ namespace Content.Server.Chemistry.ReagentEffects var random = IoCManager.Resolve(); var msg = random.Pick(Messages); + var msgArgs = new (string, object)[] { + ("entity", args.SolutionEntity), + ("organ", args.OrganEntity.GetValueOrDefault()), + }; if (Type == PopupRecipients.Local) - popupSys.PopupEntity(Loc.GetString(msg), args.SolutionEntity, Filter.Entities(args.SolutionEntity), VisualType); + popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, Filter.Entities(args.SolutionEntity), VisualType); else if (Type == PopupRecipients.Pvs) - popupSys.PopupEntity(Loc.GetString(msg), args.SolutionEntity, Filter.Pvs(args.SolutionEntity), VisualType); + popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, Filter.Pvs(args.SolutionEntity), VisualType); } }