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)
}
}
+ 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);
/// </summary>
public abstract void PopupPredicted(string? message, EntityUid uid, EntityUid? recipient, PopupType type = PopupType.Small);
+ /// <summary>
+ /// Variant of <see cref="PopupEntity(string, EntityUid, Filter, bool, PopupType)"/> 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.
+ /// </summary>
+ /// <param name="message">The message to display.</param>
+ /// <param name="uid">The entity to display the popup above.</param>
+ /// <param name="recipient">The client that will see this popup locally during prediction.</param>
+ /// <param name="filter">Filter for players that will see the popup from the server.</param>
+ /// <param name="recordReplay">If true, this pop-up will be considered as a globally visible pop-up that gets shown during replays.</param>
+ /// <param name="type">Used to customize how this popup should appear visually. See: <see cref="PopupType"/>.</param>
+ public abstract void PopupPredicted(string? message, EntityUid uid, EntityUid? recipient, Filter filter, bool recordReplay, PopupType type = PopupType.Small);
+
/// <summary>
/// Variant of <see cref="PopupPredicted(string?, EntityUid, EntityUid?, PopupType)"/> that displays <paramref name="recipientMessage"/>
/// to the recipient and <paramref name="othersMessage"/> to everyone else in PVS range.