Class Notifications
This class holds information about the current and past notifications that are displayed in the top center of the screen. To create custom notifications, use Add(MapObject, string, NotifType, bool) or Add(string, string, NotifType, bool).
public static class Notifications
- Inheritance
-
Notifications
- Inherited Members
Fields
AchievementIcon
public static readonly string AchievementIcon
Field Value
BillsIcon
public static readonly string BillsIcon
Field Value
CheatsIcon
public static readonly string CheatsIcon
Field Value
DeathIcon
public static readonly string DeathIcon
Field Value
DebugIcon
public static readonly string DebugIcon
Field Value
ErrorIcon
public static readonly string ErrorIcon
Field Value
JobIcon
public static readonly string JobIcon
Field Value
MailIcon
public static readonly string MailIcon
Field Value
MaxHistoryLength
The maximum amount of entries that can be in the notification history before the oldest entries start being deleted.
public const int MaxHistoryLength = 1024
Field Value
NewspaperIcon
public static readonly string NewspaperIcon
Field Value
RestoreIcon
public static readonly string RestoreIcon
Field Value
SpeechIcon
public static readonly string SpeechIcon
Field Value
SteamIcon
public static readonly string SteamIcon
Field Value
UpgradeIcon
public static readonly string UpgradeIcon
Field Value
WrenchIcon
public static readonly string WrenchIcon
Field Value
Methods
Add(string, string, NotifType, bool)
Adds a new notification related to nothing. The passed icon is displayed instead of an object.
public static void Add(string icon, string content, NotifType type = NotifType.Info, bool center = false)
Parameters
icon
stringThe icon that should be displayed in the notification
content
stringThe content of the notification. Should be localized using Localization
type
NotifTypeThe type that this notification should have, which determines the color of its background
center
boolWhether the notification should be displayed as a splash notification in the center of the screen, rather than in the notification area on the side.
Add(MapObject, string, NotifType, bool)
Adds a new notification related to the given map object. The passed object is also the one that will be displayed in the notification.
public static void Add(MapObject obj, string content, NotifType type = NotifType.Info, bool center = false)
Parameters
obj
MapObjectThe map object that this notification relates to
content
stringThe content of the notification. Should be localized using Localization
type
NotifTypeThe type that this notification should have, which determines the color of its background
center
boolWhether the notification should be displayed as a splash notification in the center of the screen, rather than in the notification area on the side.
RegisterIcon(string, TextureRegion)
Registers an icon that can be used as a notification icon in Add(string, string, NotifType, bool). Icons are registered so that notification instances remember them when the game is closed and loaded again.
public static string RegisterIcon(string name, TextureRegion texture)
Parameters
name
stringThe name of the icon to register.
texture
TextureRegionThe texture that the icon should display.
Returns
- string
The
name
, for registering and immediately storing in a variable.