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)
+ PopupEntity(recipientMessage, uid, recipient.Value, type);
+ }
+
#endregion
#region Network Event Handlers
RaiseNetworkEvent(new PopupEntityEvent(message, type, GetNetEntity(uid)));
}
}
+
+ public override void PopupPredicted(string? recipientMessage, string? othersMessage, EntityUid uid, EntityUid? recipient, PopupType type = PopupType.Small)
+ {
+ PopupPredicted(othersMessage, uid, recipient, type);
+ }
}
}
{
if (used != null)
{
- _popupSystem.PopupClient(Loc.GetString("grave-start-digging-user", ("grave", uid), ("tool", used)), user, user);
- _popupSystem.PopupEntity(Loc.GetString("grave-start-digging-others", ("user", user), ("grave", uid), ("tool", used)), user, Filter.PvsExcept(user), true);
+ var selfMessage = Loc.GetString("grave-start-digging-user", ("grave", uid), ("tool", used));
+ var othersMessage = Loc.GetString("grave-start-digging-others", ("user", user), ("grave", uid), ("tool", used));
+ _popupSystem.PopupPredicted(selfMessage, othersMessage, user, user);
component.ActiveShovelDigging = true;
Dirty(uid, component);
}
if (user == source)
{
// Non-local, non-bonking players
- _popupSystem.PopupEntity(Loc.GetString("bonkable-success-message-others", ("user", userName), ("bonkable", bonkableName)), user, Filter.PvsExcept(user), true);
+ var othersMessage = Loc.GetString("bonkable-success-message-others", ("user", userName), ("bonkable", bonkableName));
// Local, bonking player
- _popupSystem.PopupClient(Loc.GetString("bonkable-success-message-user", ("user", userName), ("bonkable", bonkableName)), user, user);
+ var selfMessage = Loc.GetString("bonkable-success-message-user", ("user", userName), ("bonkable", bonkableName));
+
+ _popupSystem.PopupPredicted(selfMessage, othersMessage, user, user);
}
else if (source != null)
{
("climbable", climbable));
}
- _popupSystem.PopupEntity(othersMessage, uid, Filter.PvsExcept(user, entityManager: EntityManager), true);
- _popupSystem.PopupClient(selfMessage, uid, user);
+ _popupSystem.PopupPredicted(selfMessage, othersMessage, uid, user);
}
/// <summary>
/// will do nothing and the server will show the message to every player in PVS range.
/// </summary>
public abstract void PopupPredicted(string? message, EntityUid uid, EntityUid? recipient, 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.
+ /// </summary>
+ public abstract void PopupPredicted(string? recipientMessage, string? othersMessage, EntityUid uid, EntityUid? recipient, PopupType type = PopupType.Small);
}
/// <summary>
&& !_delay.TryResetDelay((used, useDelay), true))
return false;
- _popupSystem.PopupClient(Loc.GetString("wieldable-component-successful-wield", ("item", used)), user, user);
- _popupSystem.PopupEntity(Loc.GetString("wieldable-component-successful-wield-other", ("user", user), ("item", used)), user, Filter.PvsExcept(user), true);
+ var selfMessage = Loc.GetString("wieldable-component-successful-wield", ("item", used));
+ var othersMessage = Loc.GetString("wieldable-component-successful-wield-other", ("user", user), ("item", used));
+ _popupSystem.PopupPredicted(selfMessage, othersMessage, user, user);
var targEv = new ItemWieldedEvent();
RaiseLocalEvent(used, ref targEv);
if (component.UnwieldSound != null)
_audioSystem.PlayPredicted(component.UnwieldSound, uid, args.User);
- _popupSystem.PopupClient(Loc.GetString("wieldable-component-failed-wield",
- ("item", uid)), args.User.Value, args.User.Value);
- _popupSystem.PopupEntity(Loc.GetString("wieldable-component-failed-wield-other",
- ("user", args.User.Value), ("item", uid)), args.User.Value, Filter.PvsExcept(args.User.Value), true);
+ var selfMessage = Loc.GetString("wieldable-component-failed-wield", ("item", uid));
+ var othersMessage = Loc.GetString("wieldable-component-failed-wield-other", ("user", args.User.Value), ("item", uid));
+ _popupSystem.PopupPredicted(selfMessage, othersMessage, args.User.Value, args.User.Value);
}
_appearance.SetData(uid, WieldableVisuals.Wielded, false);