using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
namespace Content.Shared.Popups
{
///
/// System for displaying small text popups on users' screens.
///
public abstract class SharedPopupSystem : EntitySystem
{
///
/// Shows a popup on the users' cursors.
///
/// The message to display.
/// Filter for the players that will see the popup.
public abstract void PopupCursor(string message, Filter filter);
///
/// Shows a popup at a world location.
///
/// The message to display.
/// The coordinates where to display the message.
/// Filter for the players that will see the popup.
public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter);
///
/// Shows a popup above an entity.
///
/// The message to display.
/// The UID of the entity.
/// Filter for the players that will see the popup.
public abstract void PopupEntity(string message, EntityUid uid, Filter filter);
}
///
/// Common base for all popup network events.
///
[Serializable, NetSerializable]
public abstract class PopupEvent : EntityEventArgs
{
public string Message { get; }
protected PopupEvent(string message)
{
Message = message;
}
}
///
/// Network event for displaying a popup on the user's cursor.
///
[Serializable, NetSerializable]
public sealed class PopupCursorEvent : PopupEvent
{
public PopupCursorEvent(string message) : base(message)
{
}
}
///
/// Network event for displaying a popup at a world location.
///
[Serializable, NetSerializable]
public sealed class PopupCoordinatesEvent : PopupEvent
{
public EntityCoordinates Coordinates { get; }
public PopupCoordinatesEvent(string message, EntityCoordinates coordinates) : base(message)
{
Coordinates = coordinates;
}
}
///
/// Network event for displaying a popup above an entity.
///
[Serializable, NetSerializable]
public sealed class PopupEntityEvent : PopupEvent
{
public EntityUid Uid { get; }
public PopupEntityEvent(string message, EntityUid uid) : base(message)
{
Uid = uid;
}
}
}