Adds PopupMessage to being hugged [Fix #7644] (#7698)

This commit is contained in:
Júlio César Ueti
2022-04-23 20:43:11 -03:00
committed by GitHub
parent 94bd2b7c94
commit f5eead4ba9
9 changed files with 20 additions and 9 deletions

View File

@@ -56,8 +56,12 @@ public sealed class InteractionPopupSystem : EntitySystem
sfx = component.InteractFailureSound.GetSound();
}
if (component.PopupPerceivedByOthers)
_popupSystem.PopupEntity(msg, uid, Filter.Pvs(uid)); //play for everyone in range
if (component.MessagePerceivedByOthers != null)
{
string msgOthers = Loc.GetString(component.MessagePerceivedByOthers,("user", args.User), ("target", uid));
_popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User));
_popupSystem.PopupEntity(msgOthers, uid, Filter.Pvs(uid, 2F, EntityManager).RemoveWhereAttachedEntity(puid => puid == args.User));
}
else
_popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User)); //play only for the initiating entity.