}\r
}\r
\r
- public class KancolleDbConfig\r
- {\r
- public bool On { get; set; }\r
- public string Token { get; set; } = "";\r
- }\r
-\r
public class PushbulletConfig\r
{\r
public bool On { get; set; }\r
All = (1 << 3) - 1,\r
Pushbullet = 1 << 3,\r
Push = 1 << 4,\r
- Repeat = 1 << 5\r
+ Repeat = 1 << 5,\r
+ Cont = 1 << 6,\r
+ Preliminary = 1 << 7\r
}\r
\r
\r
public string Name { get; set; }\r
public NotificationType Flags { get; set; }\r
public int RepeatInterval { get; set; }\r
+ public int PreliminaryPeriod { get; set; }\r
}\r
\r
public class NotificationConfig\r
public int[] RepeatIntervals =\r
Config.NotificationNames.Select(x => 0).ToArray();\r
\r
+ public int[] PreliminaryPeriods =\r
+ Config.NotificationNames.Select(x => 0).ToArray();\r
+\r
public NotificationSpec this[string name]\r
{\r
get => new NotificationSpec\r
{\r
Name = name,\r
Flags = Settings[Config.NotificationIndex[name]],\r
- RepeatInterval = RepeatIntervals[Config.NotificationIndex[name]]\r
+ RepeatInterval = RepeatIntervals[Config.NotificationIndex[name]],\r
+ PreliminaryPeriod = PreliminaryPeriods[Config.NotificationIndex[name]]\r
};\r
set\r
{\r
Settings[Config.NotificationIndex[name]] = value.Flags;\r
RepeatIntervals[Config.NotificationIndex[name]] = value.RepeatInterval;\r
+ PreliminaryPeriods[Config.NotificationIndex[name]] = value.PreliminaryPeriod;\r
}\r
}\r
}\r
public Size ListSize { get; set; }\r
}\r
\r
+ [Flags]\r
+ public enum Spoiler\r
+ {\r
+ ResultRank = 1,\r
+ AirBattleResult = 1 << 1,\r
+ BattleResult = 1 << 2,\r
+ All = (1 << 3) - 1\r
+ }\r
+\r
+ [Flags]\r
+ public enum TimerKind\r
+ {\r
+ Mission = 1,\r
+ NDock = 1 << 1\r
+ }\r
+\r
public class Config\r
{\r
- private readonly string _baseDir = AppDomain.CurrentDomain.BaseDirectory;\r
+ private readonly string _baseDir = AppDomain.CurrentDomain.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar);\r
private readonly string _configFileName;\r
\r
public Point Location { get; set; } = new Point(int.MinValue, int.MinValue);\r
public bool SaveLocationPerMachine { get; set; }\r
public List<LocationPerMachine> LocationList { get; set; } = new List<LocationPerMachine>();\r
public bool ShowHpInPercent { get; set; }\r
+ public TimerKind ShowEndTime { get; set; }\r
public bool FlashWindow { get; set; } = true;\r
public bool ShowBaloonTip { get; set; } = true;\r
public bool PlaySound { get; set; } = true;\r
public List<int> NotifyConditions { get; set; }\r
public List<int> ResetHours { get; set; }\r
public bool AlwaysShowResultRank { get; set; }\r
+ public Spoiler Spoilers { get; set; }\r
public bool UsePresetAkashi { get; set; }\r
public SoundConfig Sounds { get; set; } = new SoundConfig();\r
public bool DebugLogging { get; set; }\r
public ProxyConfig Proxy { get; set; } = new ProxyConfig();\r
public ShipListConfig ShipList { get; set; } = new ShipListConfig();\r
public LogConfig Log { get; set; } = new LogConfig();\r
- public KancolleDbConfig KancolleDb { get; set; } = new KancolleDbConfig();\r
public PushbulletConfig Pushbullet { get; set; } = new PushbulletConfig();\r
public PushoverConfig Pushover { get; set; } = new PushoverConfig();\r
\r
ns[i] = ns[i] ^ NotificationType.Pushbullet | NotificationType.Push;\r
}\r
ComposeNotificationFlags();\r
+ if (AlwaysShowResultRank)\r
+ {\r
+ Spoilers = Spoiler.All;\r
+ AlwaysShowResultRank = false;\r
+ }\r
if (SaveLocationPerMachine)\r
{\r
foreach (var l in LocationList)\r
if (!path.StartsWith(_baseDir))\r
return path;\r
path = path.Substring(_baseDir.Length);\r
- return path.StartsWith(Path.DirectorySeparatorChar.ToString()) ? path.Substring(1) : path;\r
+ return path.TrimStart(Path.DirectorySeparatorChar);\r
}\r
\r
private string PrependBaseDir(string path) => Path.IsPathRooted(path) ? path : Path.Combine(_baseDir, path);\r