using Robust.Shared.Map;
using Robust.Shared.Player;
namespace Content.Shared.Popups
{
public static class SharedPopupExtensions
{
///
/// Pops up a message at the location of for
/// alone to see.
///
/// The entity above which the message will appear.
/// The entity that will see the message.
/// The message to show.
public static void PopupMessage(this EntityUid source, EntityUid viewer, string message)
{
var popupSystem = EntitySystem.Get();
popupSystem.PopupEntity(message, source, Filter.Entities(viewer));
}
///
/// Pops up a message at the given entity's location for it alone to see.
///
/// The entity that will see the message.
/// The message to be seen.
public static void PopupMessage(this EntityUid viewer, string message)
{
viewer.PopupMessage(viewer, message);
}
///
/// Makes a string of text float up from a location on a grid.
///
/// Location on a grid that the message floats up from.
/// The client attached entity that the message is being sent to.
/// Text contents of the message.
public static void PopupMessage(this EntityCoordinates coordinates, EntityUid viewer, string message)
{
var popupSystem = EntitySystem.Get();
popupSystem.PopupCoordinates(message, coordinates, Filter.Entities(viewer));
}
///
/// Makes a string of text float up from a client's cursor.
///
///
/// The client attached entity that the message is being sent to.
///
/// Text contents of the message.
public static void PopupMessageCursor(this EntityUid viewer, string message)
{
var popupSystem = EntitySystem.Get();
popupSystem.PopupCursor(message, Filter.Entities(viewer));
}
}
}