private readonly Config _config = new Config();\r
private readonly ConfigDialog _configDialog;\r
private readonly ProxyManager _proxyManager;\r
+ private readonly ToolTip _toolTip = new ToolTip {ShowAlways = true};\r
private int _currentFleet;\r
private bool _combinedFleet;\r
private readonly Label[] _labelCheckFleets;\r
private bool _timerEnabled;\r
private string _debugLogFile;\r
private IEnumerator<string> _playLog;\r
+ private DateTime _prev, _now;\r
\r
private readonly ErrorDialog _errorDialog = new ErrorDialog();\r
- private bool _missionFinishTimeMode;\r
- private bool _ndockFinishTimeMode;\r
private readonly KancolleDb _kancolleDb = new KancolleDb();\r
private readonly ErrorLog _errorLog;\r
\r
}\r
if (!_started)\r
return;\r
+ if (_now == DateTime.MinValue)\r
+ _now = DateTime.Now;\r
if ((update & Sniffer.Update.Item) != 0)\r
UpdateItemInfo();\r
if ((update & Sniffer.Update.Timer) != 0)\r
foreach (var control in new Control[]\r
{\r
this, _listForm, labelLogin, linkLabelGuide,\r
- _configDialog, contextMenuStripMain, _errorDialog\r
+ _configDialog, _configDialog.NotificationConfigDialog,\r
+ contextMenuStripMain, _errorDialog\r
})\r
{\r
control.Font = new Font(control.Font.FontFamily, control.Font.Size * _config.Zoom / 100);\r
{\r
try\r
{\r
+ _now = DateTime.Now;\r
UpdateTimers();\r
+ NotifyTimers();\r
+ _prev = _now;\r
}\r
catch (Exception ex)\r
{\r
return;\r
panelBattleInfo.BringToFront();\r
var battle = _sniffer.Battle;\r
- labelFormation.Text = battle.Formation;\r
+ labelFormation.Text = new[] {"同航戦", "反航戦", "T字有利", "T字不利"}[battle.Formation[2] - 1];\r
UpdateBattleFighterPower();\r
if ((_config.Spoilers & Spoiler.ResultRank) != 0)\r
ShowResultRank();\r
\r
private void labelNDock_Click(object sender, EventArgs e)\r
{\r
- _ndockFinishTimeMode = !_ndockFinishTimeMode;\r
+ _config.ShowEndTime ^= TimerKind.NDock;\r
UpdateTimers();\r
}\r
\r
\r
private void labelMission_Click(object sender, EventArgs e)\r
{\r
- _missionFinishTimeMode = !_missionFinishTimeMode;\r
+ _config.ShowEndTime ^= TimerKind.Mission;\r
UpdateTimers();\r
}\r
\r
- private DateTime _prev, _now;\r
-\r
private void UpdateTimers()\r
{\r
- _prev = _now;\r
- _now = DateTime.Now;\r
var mission = new[] {labelMission1, labelMission2, labelMission3};\r
for (var i = 0; i < mission.Length; i++)\r
{\r
var entry = _sniffer.Missions[i];\r
SetTimerColor(mission[i], entry.Timer, _now);\r
- mission[i].Text = entry.Timer.ToString(_now, _missionFinishTimeMode);\r
- CheckAlarm("遠征終了", entry.Timer, i + 1, entry.Name);\r
+ mission[i].Text = entry.Timer.ToString(_now, (_config.ShowEndTime & TimerKind.Mission) != 0);\r
}\r
for (var i = 0; i < _sniffer.NDock.Length; i++)\r
{\r
var entry = _sniffer.NDock[i];\r
- _shipLabels.SetNDockTimer(i, entry.Timer, _now, _ndockFinishTimeMode);\r
- CheckAlarm("入渠終了", entry.Timer, i, entry.Name);\r
+ _shipLabels.SetNDockTimer(i, entry.Timer, _now, (_config.ShowEndTime & TimerKind.NDock) != 0);\r
}\r
var kdock = new[] {labelConstruct1, labelConstruct2, labelConstruct3, labelConstruct4};\r
for (var i = 0; i < kdock.Length; i++)\r
var timer = _sniffer.KDock[i];\r
SetTimerColor(kdock[i], timer, _now);\r
kdock[i].Text = timer.ToString(_now);\r
- CheckAlarm("建造完了", timer, 0, $"第{i + 1:D}ドック");\r
}\r
UpdateCondTimers();\r
UpdateAkashiTimer();\r
- _notificationManager.Flash();\r
_timerEnabled = true;\r
}\r
\r
+ private void NotifyTimers()\r
+ {\r
+ for (var i = 0; i < _sniffer.Missions.Length; i++)\r
+ {\r
+ var entry = _sniffer.Missions[i];\r
+ CheckAlarm("遠征終了", entry.Timer, i + 1, entry.Name);\r
+ }\r
+ for (var i = 0; i < _sniffer.NDock.Length; i++)\r
+ {\r
+ var entry = _sniffer.NDock[i];\r
+ CheckAlarm("入渠終了", entry.Timer, i, entry.Name);\r
+ }\r
+ for (var i = 0; i < _sniffer.KDock.Length; i++)\r
+ {\r
+ var timer = _sniffer.KDock[i];\r
+ CheckAlarm("建造完了", timer, 0, $"第{i + 1:D}ドック");\r
+ }\r
+ NotifyCondTimers();\r
+ NotifyAkashiTimer();\r
+ _notificationManager.Flash();\r
+ }\r
+\r
private void CheckAlarm(string key, AlarmTimer timer, int fleet, string subject)\r
{\r
if (timer.CheckAlarm(_prev, _now))\r
labelCondTimer.Text = (span >= TimeSpan.Zero ? span : TimeSpan.Zero).ToString(@"mm\:ss");\r
labelCondTimer.ForeColor = span <= TimeSpan.Zero ? CUDColor.Red : DefaultForeColor;\r
}\r
+ }\r
+\r
+ private void NotifyCondTimers()\r
+ {\r
var notice = _sniffer.GetConditionNotice(_prev, _now);\r
var pre = TimeSpan.FromSeconds(_config.Notifications["疲労回復"].PreliminaryPeriod);\r
var preNotice = pre == TimeSpan.Zero\r
var statuses = _sniffer.GetShipStatuses(_currentFleet);\r
_shipLabels.SetAkashiTimer(statuses,\r
_sniffer.AkashiTimer.GetTimers(_currentFleet));\r
- NotifyAkashiTimer();\r
}\r
\r
private void UpdatePresetAkashiTimer()\r
\r
private void SetPreNotification(string key, int fleet, string subject)\r
{\r
- _notificationManager.Enqueue(key, fleet, subject, 0, true);\r
+ var spec = _config.Notifications[_notificationManager.KeyToName(key)];\r
+ if ((spec.Flags & NotificationType.Preliminary) != 0)\r
+ _notificationManager.Enqueue(key, fleet, subject, 0, true);\r
}\r
\r
private void UpdateRepairList()\r
{\r
count[i].Text = "";\r
count[i].ForeColor = Color.Black;\r
+ _toolTip.SetToolTip(count[i], "");\r
continue;\r
}\r
- count[i].Text = c.NowArray != null ? $"{string.Join("|", c.NowArray)}" : $"{c.Now}/{c.Max}";\r
- count[i].ForeColor =\r
- (c.NowArray?.Zip(c.Spec.MaxArray, (n, m) => n >= m).All(x => x) ?? c.Now >= c.Spec.Max)\r
- ? CUDColor.Green\r
- : Color.Black;\r
+ count[i].Text = " " + c;\r
+ count[i].ForeColor = c.Cleared ? CUDColor.Green : Color.Black;\r
+ _toolTip.SetToolTip(count[i], c.ToToolTip());\r
}\r
else\r
{\r
category[i].BackColor = DefaultBackColor;\r
name[i].Text = count[i].Text = progress[i].Text = "";\r
+ _toolTip.SetToolTip(count[i], "");\r
}\r
}\r
}\r
Process.Start("http://localhost:" + _config.Proxy.Listen + "/");\r
}\r
\r
+ private void labelClearQuest_Click(object sender, EventArgs e)\r
+ {\r
+ _sniffer.ClearQuests();\r
+ UpdateQuestList();\r
+ }\r
+\r
private void CaptureToolStripMenuItem_Click(object sender, EventArgs e)\r
{\r
try\r