using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel; using System.Runtime.Serialization; namespace NewHorizons.External.Volumes { [JsonObject] public class NotificationVolumeInfo : VolumeInfo { /// /// What the notification will show for. /// [DefaultValue("all")] public NotificationTarget target = NotificationTarget.All; /// /// The notification that will play when you enter this volume. /// public NotificationInfo entryNotification; /// /// The notification that will play when you exit this volume. /// public NotificationInfo exitNotification; [JsonObject] public class NotificationInfo { /// /// The message that will be displayed. /// public string displayMessage; /// /// The duration this notification will be displayed. /// [DefaultValue(5f)] public float duration = 5f; } [JsonConverter(typeof(StringEnumConverter))] public enum NotificationTarget { [EnumMember(Value = @"all")] All = 0, [EnumMember(Value = @"ship")] Ship = 1, [EnumMember(Value = @"player")] Player = 2, } } }