diff --git a/Content.Client/Popups/PopupSystem.cs b/Content.Client/Popups/PopupSystem.cs
index 38cad2d59c..b0a3d9b21e 100644
--- a/Content.Client/Popups/PopupSystem.cs
+++ b/Content.Client/Popups/PopupSystem.cs
@@ -237,6 +237,12 @@ namespace Content.Client.Popups
PopupEntity(message, uid, recipient.Value, type);
}
+ public override void PopupPredicted(string? message, EntityUid uid, EntityUid? recipient, Filter filter, bool recordReplay, PopupType type = PopupType.Small)
+ {
+ if (recipient != null && _timing.IsFirstTimePredicted)
+ PopupEntity(message, uid, recipient.Value, type);
+ }
+
public override void PopupPredicted(string? recipientMessage, string? othersMessage, EntityUid uid, EntityUid? recipient, PopupType type = PopupType.Small)
{
if (recipient != null && _timing.IsFirstTimePredicted)
diff --git a/Content.Server/Popups/PopupSystem.cs b/Content.Server/Popups/PopupSystem.cs
index 22e4ae483a..9338d81b92 100644
--- a/Content.Server/Popups/PopupSystem.cs
+++ b/Content.Server/Popups/PopupSystem.cs
@@ -149,6 +149,20 @@ namespace Content.Server.Popups
}
}
+ public override void PopupPredicted(string? message, EntityUid uid, EntityUid? recipient, Filter filter, bool recordReplay, PopupType type = PopupType.Small)
+ {
+ if (message == null)
+ return;
+
+ if (recipient != null)
+ {
+ // Don't send to recipient, since they predicted it locally
+ filter = filter.RemovePlayerByAttachedEntity(recipient.Value);
+ }
+
+ RaiseNetworkEvent(new PopupEntityEvent(message, type, GetNetEntity(uid)), filter, recordReplay);
+ }
+
public override void PopupPredicted(string? recipientMessage, string? othersMessage, EntityUid uid, EntityUid? recipient, PopupType type = PopupType.Small)
{
PopupPredicted(othersMessage, uid, recipient, type);
diff --git a/Content.Shared/Popups/SharedPopupSystem.cs b/Content.Shared/Popups/SharedPopupSystem.cs
index 1ce8efcdf1..66f901c59f 100644
--- a/Content.Shared/Popups/SharedPopupSystem.cs
+++ b/Content.Shared/Popups/SharedPopupSystem.cs
@@ -114,6 +114,19 @@ namespace Content.Shared.Popups
///
public abstract void PopupPredicted(string? message, EntityUid uid, EntityUid? recipient, PopupType type = PopupType.Small);
+ ///
+ /// Variant of for use with prediction.
+ /// The local client will show the popup to the recipient, and the server will show it to players in the filter.
+ /// If recipient is null, the local client will do nothing and the server will show the message to players in the filter.
+ ///
+ /// The message to display.
+ /// The entity to display the popup above.
+ /// The client that will see this popup locally during prediction.
+ /// Filter for players that will see the popup from the server.
+ /// If true, this pop-up will be considered as a globally visible pop-up that gets shown during replays.
+ /// Used to customize how this popup should appear visually. See: .
+ public abstract void PopupPredicted(string? message, EntityUid uid, EntityUid? recipient, Filter filter, bool recordReplay, PopupType type = PopupType.Small);
+
///
/// Variant of that displays
/// to the recipient and to everyone else in PVS range.