using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; namespace Content.Shared.Interfaces { /// /// Allows the ability to create floating text messages at locations in the world. /// public interface ISharedNotifyManager { /// /// Makes a string of text float up from an entity. /// /// The entity that the message is floating up from. /// The client attached entity that the message is being sent to. /// Text contents of the message. void PopupMessage(IEntity source, IEntity viewer, string 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. void PopupMessage(EntityCoordinates coordinates, IEntity viewer, string message); /// /// 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. void PopupMessageCursor(IEntity viewer, string message); } public static class SharedNotifyExtensions { /// /// 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 IEntity source, IEntity viewer, string message) { var notifyManager = IoCManager.Resolve(); notifyManager.PopupMessage(source, viewer, message); } /// /// 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 IEntity 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, IEntity viewer, string message) { var notifyManager = IoCManager.Resolve(); notifyManager.PopupMessage(coordinates, viewer, message); } /// /// 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 IEntity viewer, string message) { var notifyManager = IoCManager.Resolve(); notifyManager.PopupMessageCursor(viewer, message); } } }