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(Icon, string, NotifType, bool).
public static class Notifications
- Inheritance
-
Notifications
- Inherited Members
Fields
AchievementIcon
public static readonly Notifications.Icon AchievementIcon
Field Value
BillsIcon
public static readonly Notifications.Icon BillsIcon
Field Value
CheatsIcon
public static readonly Notifications.Icon CheatsIcon
Field Value
DeathIcon
public static readonly Notifications.Icon DeathIcon
Field Value
DebugIcon
public static readonly Notifications.Icon DebugIcon
Field Value
ErrorIcon
public static readonly Notifications.Icon ErrorIcon
Field Value
Icons
The registry of icons registered using RegisterIcon(string, TextureRegion). Can be used to gather modded icons for display in Add(Icon, string, NotifType, bool).
public static readonly ReadOnlyDictionary<string, Notifications.Icon> Icons
Field Value
JobIcon
public static readonly Notifications.Icon JobIcon
Field Value
MailIcon
public static readonly Notifications.Icon 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 = 512
Field Value
NewspaperIcon
public static readonly Notifications.Icon NewspaperIcon
Field Value
PredictionIcon
public static readonly Notifications.Icon PredictionIcon
Field Value
RestoreIcon
public static readonly Notifications.Icon RestoreIcon
Field Value
SpeechIcon
public static readonly Notifications.Icon SpeechIcon
Field Value
SteamIcon
public static readonly Notifications.Icon SteamIcon
Field Value
UpgradeIcon
public static readonly Notifications.Icon UpgradeIcon
Field Value
WrenchIcon
public static readonly Notifications.Icon WrenchIcon
Field Value
Properties
SkillIcons
public static IReadOnlyDictionary<SkillType, Notifications.Icon> SkillIcons { get; }
Property Value
Methods
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
objMapObjectThe map object that this notification relates to
contentstringThe content of the notification. Should be localized using Localization
typeNotifTypeThe type that this notification should have, which determines the color of its background
centerboolWhether 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(Icon, string, NotifType, bool)
Adds a new notification related to nothing. The passed icon is displayed instead of an object.
public static void Add(Notifications.Icon icon, string content, NotifType type = NotifType.Info, bool center = false)
Parameters
iconNotifications.IconThe icon that should be displayed in the notification
contentstringThe content of the notification. Should be localized using Localization
typeNotifTypeThe type that this notification should have, which determines the color of its background
centerboolWhether 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(Icon, string, NotifType, bool). Icons are registered so that notification instances remember them when the game is closed and loaded again.
public static Notifications.Icon RegisterIcon(string name, TextureRegion texture)
Parameters
namestringThe name of the icon to register.
textureTextureRegionThe texture that the icon should display.
Returns
- Notifications.Icon
The
name, for registering and immediately storing in a variable.