Make popups nullable (#24802)
This standardises it with audio and whatever. Me when I sprinkle nullchecks everywhere. Was 50/50 on making new non-nullable methods but figured it would bloat too hard and you can't access strings by .Value anyway.
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Content.Shared.Popups
|
||||
/// </summary>
|
||||
/// <param name="message">The message to display.</param>
|
||||
/// <param name="type">Used to customize how this popup should appear visually.</param>
|
||||
public abstract void PopupCursor(string message, PopupType type = PopupType.Small);
|
||||
public abstract void PopupCursor(string? message, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Shows a popup at a users' cursor.
|
||||
@@ -22,7 +22,7 @@ namespace Content.Shared.Popups
|
||||
/// <param name="message">The message to display.</param>
|
||||
/// <param name="recipient">Client that will see this popup.</param>
|
||||
/// <param name="type">Used to customize how this popup should appear visually.</param>
|
||||
public abstract void PopupCursor(string message, ICommonSession recipient, PopupType type = PopupType.Small);
|
||||
public abstract void PopupCursor(string? message, ICommonSession recipient, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Shows a popup at a users' cursor.
|
||||
@@ -30,7 +30,7 @@ namespace Content.Shared.Popups
|
||||
/// <param name="message">The message to display.</param>
|
||||
/// <param name="recipient">Client that will see this popup.</param>
|
||||
/// <param name="type">Used to customize how this popup should appear visually.</param>
|
||||
public abstract void PopupCursor(string message, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
public abstract void PopupCursor(string? message, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Shows a popup at a world location to every entity in PVS range.
|
||||
@@ -38,7 +38,7 @@ namespace Content.Shared.Popups
|
||||
/// <param name="message">The message to display.</param>
|
||||
/// <param name="coordinates">The coordinates where to display the message.</param>
|
||||
/// <param name="type">Used to customize how this popup should appear visually.</param>
|
||||
public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, PopupType type = PopupType.Small);
|
||||
public abstract void PopupCoordinates(string? message, EntityCoordinates coordinates, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Filtered variant of <see cref="PopupCoordinates(string, EntityCoordinates, PopupType)"/>, which should only be used
|
||||
@@ -46,17 +46,17 @@ namespace Content.Shared.Popups
|
||||
/// </summary>
|
||||
/// <param name="filter">Filter for the players that will see the popup.</param>
|
||||
/// <param name="recordReplay">If true, this pop-up will be considered as a globally visible pop-up that gets shown during replays.</param>
|
||||
public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter, bool recordReplay, PopupType type = PopupType.Small);
|
||||
public abstract void PopupCoordinates(string? message, EntityCoordinates coordinates, Filter filter, bool recordReplay, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Variant of <see cref="PopupCoordinates(string, EntityCoordinates, PopupType)"/> that sends a pop-up to the player attached to some entity.
|
||||
/// </summary>
|
||||
public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
public abstract void PopupCoordinates(string? message, EntityCoordinates coordinates, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Variant of <see cref="PopupCoordinates(string, EntityCoordinates, PopupType)"/> that sends a pop-up to a specific player.
|
||||
/// </summary>
|
||||
public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, ICommonSession recipient, PopupType type = PopupType.Small);
|
||||
public abstract void PopupCoordinates(string? message, EntityCoordinates coordinates, ICommonSession recipient, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Shows a popup above an entity for every player in pvs range.
|
||||
@@ -64,29 +64,29 @@ namespace Content.Shared.Popups
|
||||
/// <param name="message">The message to display.</param>
|
||||
/// <param name="uid">The UID of the entity.</param>
|
||||
/// <param name="type">Used to customize how this popup should appear visually.</param>
|
||||
public abstract void PopupEntity(string message, EntityUid uid, PopupType type=PopupType.Small);
|
||||
public abstract void PopupEntity(string? message, EntityUid uid, PopupType type=PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Variant of <see cref="PopupEntity(string, EntityUid, PopupType)"/> that shows the popup only to some specific client.
|
||||
/// </summary>
|
||||
public abstract void PopupEntity(string message, EntityUid uid, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
public abstract void PopupEntity(string? message, EntityUid uid, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Variant of <see cref="PopupEntity(string, EntityUid, PopupType)"/> that shows the popup only to some specific client.
|
||||
/// </summary>
|
||||
public abstract void PopupEntity(string message, EntityUid uid, ICommonSession recipient, PopupType type = PopupType.Small);
|
||||
public abstract void PopupEntity(string? message, EntityUid uid, ICommonSession recipient, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Filtered variant of <see cref="PopupEntity(string, EntityUid, PopupType)"/>, which should only be used
|
||||
/// if the filtering has to be more specific than simply PVS range based.
|
||||
/// </summary>
|
||||
public abstract void PopupEntity(string message, EntityUid uid, Filter filter, bool recordReplay, PopupType type = PopupType.Small);
|
||||
public abstract void PopupEntity(string? message, EntityUid uid, Filter filter, bool recordReplay, PopupType type = PopupType.Small);
|
||||
|
||||
/// <summary>
|
||||
/// Variant of <see cref="PopupEnity(string, EntityUid, EntityUid, PopupType)"/> that only runs on the client, outside of prediction.
|
||||
/// Useful for shared code that is always ran by both sides to avoid duplicate popups.
|
||||
/// </summary>
|
||||
public abstract void PopupClient(string message, EntityUid uid, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
public abstract void PopupClient(string? message, EntityUid uid, EntityUid recipient, PopupType type = PopupType.Small);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user