X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=KancolleSniffer%2FConfig.cs;h=7175ad024fa49a409a8e8fa8b5714848958feeef;hb=9d2db977a3dbcc08c6976dc14f739a12286913b5;hp=1309d8ecb0da6f515749a6454826caabb63b5b6d;hpb=2a6f793fa23b9d09ba50a1baf9056359f25ad3e6;p=kancollesniffer%2FKancolleSniffer.git diff --git a/KancolleSniffer/Config.cs b/KancolleSniffer/Config.cs index 1309d8e..7175ad0 100644 --- a/KancolleSniffer/Config.cs +++ b/KancolleSniffer/Config.cs @@ -70,12 +70,6 @@ namespace KancolleSniffer } } - public class KancolleDbConfig - { - public bool On { get; set; } - public string Token { get; set; } = ""; - } - public class PushbulletConfig { public bool On { get; set; } @@ -124,7 +118,8 @@ namespace KancolleSniffer Pushbullet = 1 << 3, Push = 1 << 4, Repeat = 1 << 5, - Cont = 1 << 6 + Cont = 1 << 6, + Preliminary = 1 << 7 } @@ -133,6 +128,7 @@ namespace KancolleSniffer public string Name { get; set; } public NotificationType Flags { get; set; } public int RepeatInterval { get; set; } + public int PreliminaryPeriod { get; set; } } public class NotificationConfig @@ -143,18 +139,23 @@ namespace KancolleSniffer public int[] RepeatIntervals = Config.NotificationNames.Select(x => 0).ToArray(); + public int[] PreliminaryPeriods = + Config.NotificationNames.Select(x => 0).ToArray(); + public NotificationSpec this[string name] { get => new NotificationSpec { Name = name, Flags = Settings[Config.NotificationIndex[name]], - RepeatInterval = RepeatIntervals[Config.NotificationIndex[name]] + RepeatInterval = RepeatIntervals[Config.NotificationIndex[name]], + PreliminaryPeriod = PreliminaryPeriods[Config.NotificationIndex[name]] }; set { Settings[Config.NotificationIndex[name]] = value.Flags; RepeatIntervals[Config.NotificationIndex[name]] = value.RepeatInterval; + PreliminaryPeriods[Config.NotificationIndex[name]] = value.PreliminaryPeriod; } } } @@ -168,6 +169,22 @@ namespace KancolleSniffer public Size ListSize { get; set; } } + [Flags] + public enum Spoiler + { + ResultRank = 1, + AirBattleResult = 1 << 1, + BattleResult = 1 << 2, + All = (1 << 3) - 1 + } + + [Flags] + public enum TimerKind + { + Mission = 1, + NDock = 1 << 1 + } + public class Config { private readonly string _baseDir = AppDomain.CurrentDomain.BaseDirectory; @@ -181,6 +198,7 @@ namespace KancolleSniffer public bool SaveLocationPerMachine { get; set; } public List LocationList { get; set; } = new List(); public bool ShowHpInPercent { get; set; } + public TimerKind ShowEndTime { get; set; } public bool FlashWindow { get; set; } = true; public bool ShowBaloonTip { get; set; } = true; public bool PlaySound { get; set; } = true; @@ -191,6 +209,7 @@ namespace KancolleSniffer public List NotifyConditions { get; set; } public List ResetHours { get; set; } public bool AlwaysShowResultRank { get; set; } + public Spoiler Spoilers { get; set; } public bool UsePresetAkashi { get; set; } public SoundConfig Sounds { get; set; } = new SoundConfig(); public bool DebugLogging { get; set; } @@ -198,7 +217,6 @@ namespace KancolleSniffer public ProxyConfig Proxy { get; set; } = new ProxyConfig(); public ShipListConfig ShipList { get; set; } = new ShipListConfig(); public LogConfig Log { get; set; } = new LogConfig(); - public KancolleDbConfig KancolleDb { get; set; } = new KancolleDbConfig(); public PushbulletConfig Pushbullet { get; set; } = new PushbulletConfig(); public PushoverConfig Pushover { get; set; } = new PushoverConfig(); @@ -240,6 +258,11 @@ namespace KancolleSniffer ns[i] = ns[i] ^ NotificationType.Pushbullet | NotificationType.Push; } ComposeNotificationFlags(); + if (AlwaysShowResultRank) + { + Spoilers = Spoiler.All; + AlwaysShowResultRank = false; + } if (SaveLocationPerMachine) { foreach (var l in LocationList)