"hirou.mp3"\r
};\r
\r
- public readonly string[] SoundNames =\r
+ public string this[string name]\r
{\r
- "遠征終了", "入渠終了", "建造完了", "艦娘数超過", "装備数超過",\r
- "大破警告", "泊地修理20分経過", "泊地修理進行", "泊地修理完了", "疲労回復"\r
- };\r
+ get { return Files[Config.NotificationIndex[name]]; }\r
+ set { Files[Config.NotificationIndex[name]] = value; }\r
+ }\r
+ }\r
\r
- private readonly Dictionary<string, int> _names = new Dictionary<string, int>();\r
+ [Flags]\r
+ public enum NotificationType\r
+ {\r
+ FlashWindow = 1,\r
+ ShowBaloonTip = 1 << 1,\r
+ PlaySound = 1 << 2,\r
+ All = (1 << 3) - 1\r
+ }\r
\r
- public SoundConfig()\r
- {\r
- var idx = 0;\r
- foreach (var name in SoundNames)\r
- _names[name] = idx++;\r
- }\r
+ public class NotificationConfig\r
+ {\r
+ public NotificationType[] Settings =\r
+ Config.NotificationNames.Select(x => NotificationType.All).ToArray();\r
\r
- public string this[string name]\r
+ public NotificationType this[string name]\r
{\r
- get { return Files[_names[name]]; }\r
- set { Files[_names[name]] = value; }\r
+ get { return Settings[Config.NotificationIndex[name]]; }\r
+ set { Settings[Config.NotificationIndex[name]] = value; }\r
}\r
}\r
\r
public bool FlashWindow { get; set; } = true;\r
public bool ShowBaloonTip { get; set; }\r
public bool PlaySound { get; set; } = true;\r
+ public NotificationConfig Notifications { get; set; } = new NotificationConfig();\r
public int MarginShips { get; set; } = 4;\r
public int MarginEquips { get; set; } = 10;\r
public List<int> NotifyConditions { get; set; }\r
public LogConfig Log { get; set; } = new LogConfig();\r
public KancolleDbConfig KancolleDb { get; set; } = new KancolleDbConfig();\r
\r
+ public static readonly string[] NotificationNames =\r
+ {\r
+ "遠征終了", "入渠終了", "建造完了", "艦娘数超過", "装備数超過",\r
+ "大破警告", "泊地修理20分経過", "泊地修理進行", "泊地修理完了", "疲労回復"\r
+ };\r
+\r
+ public static readonly Dictionary<string, int> NotificationIndex =\r
+ NotificationNames.Select((name, i) => new {name, i}).ToDictionary(entry => entry.name, entry => entry.i);\r
+\r
public Config()\r
{\r
_configFileName = Path.Combine(_baseDir, "config.xml");\r