1 // Copyright (C) 2013, 2014, 2015 Kazuhiro Fujieda <fujieda@users.sourceforge.jp>
\r
3 // This program is part of KancolleSniffer.
\r
5 // KancolleSniffer is free software: you can redistribute it and/or modify
\r
6 // it under the terms of the GNU General Public License as published by
\r
7 // the Free Software Foundation, either version 3 of the License, or
\r
8 // (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, see <http://www.gnu.org/licenses/>.
\r
19 using System.Collections.Generic;
\r
20 using System.Diagnostics;
\r
21 using System.Drawing;
\r
24 using System.Runtime.InteropServices;
\r
26 using System.Windows.Forms;
\r
27 using Codeplex.Data;
\r
30 namespace KancolleSniffer
\r
32 public partial class MainForm : Form
\r
34 private readonly Sniffer _sniffer = new Sniffer();
\r
35 private readonly Config _config = new Config();
\r
36 private readonly ConfigDialog _configDialog;
\r
37 private int _currentFleet;
\r
38 private readonly Label[] _labelCheckFleets;
\r
39 private readonly ShipLabels _shipLabels;
\r
40 private readonly ShipListForm _shipListForm;
\r
41 private readonly NoticeQueue _noticeQueue;
\r
42 private bool _started;
\r
43 private string _debugLogFile;
\r
44 private IEnumerator<string> _playLog;
\r
45 private LogServer _logServer;
\r
46 private readonly ProxyConfig _prevProxy = new ProxyConfig();
\r
50 InitializeComponent();
\r
51 FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest;
\r
52 FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
\r
53 _configDialog = new ConfigDialog(_config, this);
\r
54 _labelCheckFleets = new[] {labelCheckFleet1, labelCheckFleet2, labelCheckFleet3, labelCheckFleet4};
\r
56 // この時点でAutoScaleDimensions == CurrentAutoScaleDimensionsなので、
\r
57 // MainForm.Designer.csのAutoScaleDimensionsの6f,12fを使う。
\r
58 ShipLabel.ScaleFactor = new SizeF(CurrentAutoScaleDimensions.Width / 6f, CurrentAutoScaleDimensions.Height / 12f);
\r
61 _shipLabels = new ShipLabels();
\r
62 _shipLabels.CreateAkashiTimers(panelShipInfo);
\r
63 _shipLabels.CreateLabels(panelShipInfo, ShowShipOnShipList);
\r
64 _shipLabels.CreateDamagedShipList(panelDamagedShipList);
\r
65 _shipLabels.CreateNDockLabels(panelDock);
\r
66 _shipListForm = new ShipListForm(_sniffer, _config) {Owner = this};
\r
67 _noticeQueue = new NoticeQueue(Ring);
\r
70 private void FiddlerApplication_BeforeRequest(Session oSession)
\r
72 var path = oSession.PathAndQuery;
\r
73 var proxy = _config.Proxy;
\r
74 if (proxy.UseUpstream && (path.StartsWith("/kcsapi/api_") ||
\r
75 // この二つはMyFleetGirlsに必要
\r
76 path.StartsWith("/kcs/resources/") || path.StartsWith("/kcs/sound/")))
\r
77 oSession["x-overrideGateway"] = string.Format("localhost:{0:D}", proxy.UpstreamPort); // 上流プロキシを設定する
\r
78 if (!path.StartsWith("/kcsapi/api_")) // 艦これのAPI以外は無視する
\r
82 private void FiddlerApplication_AfterSessionComplete(Session oSession)
\r
84 if (!oSession.bHasResponse || !oSession.uriContains("/kcsapi/api_"))
\r
86 Invoke(new Action<Session>(ProcessRequest), oSession);
\r
89 private void ProcessRequest(Session session)
\r
91 var response = session.GetResponseBodyAsString();
\r
92 if (!response.StartsWith("svdata="))
\r
94 response = response.Remove(0, "svdata=".Length);
\r
95 var json = DynamicJson.Parse(response);
\r
96 var request = session.GetRequestBodyAsString();
\r
97 if (_debugLogFile != null)
\r
99 File.AppendAllText(_debugLogFile,
\r
100 string.Format("url: {0}\nrequest: {1}\nresponse: {2}\n", session.url, request, json.ToString()));
\r
102 UpdateInfo(_sniffer.Sniff(session.url, request, json));
\r
105 private void UpdateInfo(Sniffer.Update update)
\r
107 if (update == Sniffer.Update.Start)
\r
109 labelLogin.Visible = false;
\r
115 if ((update & Sniffer.Update.Item) != 0)
\r
117 if ((update & Sniffer.Update.Timer) != 0)
\r
119 if ((update & Sniffer.Update.NDock) != 0)
\r
120 UpdateNDocLabels();
\r
121 if ((update & Sniffer.Update.Mission) != 0)
\r
122 UpdateMissionLabels();
\r
123 if ((update & Sniffer.Update.QuestList) != 0)
\r
125 if ((update & Sniffer.Update.Ship) != 0)
\r
127 if ((update & Sniffer.Update.Battle) != 0)
\r
128 UpdateBattleInfo();
\r
131 private void MainForm_Load(object sender, EventArgs e)
\r
135 if (_config.HideOnMinimized && WindowState == FormWindowState.Minimized)
\r
136 ShowInTaskbar = false;
\r
138 ApplyDebugLogSetting();
\r
140 _sniffer.LoadState();
\r
144 private void StartProxy()
\r
146 if (_config.Proxy.Auto)
\r
147 FiddlerApplication.Startup(0, FiddlerCoreStartupFlags.RegisterAsSystemProxy);
\r
149 FiddlerApplication.Startup(_config.Proxy.Listen, FiddlerCoreStartupFlags.None);
\r
150 _prevProxy.Auto = _config.Proxy.Auto;
\r
151 _prevProxy.Listen = _config.Proxy.Listen;
\r
154 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
\r
157 _config.Location = (WindowState == FormWindowState.Normal ? Bounds : RestoreBounds).Location;
\r
159 _sniffer.SaveState();
\r
161 if (_logServer != null)
\r
165 private void ShutdownProxy()
\r
167 FiddlerApplication.Shutdown();
\r
170 private void MainForm_Resize(object sender, EventArgs e)
\r
172 ShowInTaskbar = !(_config.HideOnMinimized && WindowState == FormWindowState.Minimized);
\r
175 private void notifyIconMain_MouseDoubleClick(object sender, MouseEventArgs e)
\r
177 NotifyIconOpenToolStripMenuItem_Click(sender, e);
\r
180 private void NotifyIconOpenToolStripMenuItem_Click(object sender, EventArgs e)
\r
182 ShowInTaskbar = true;
\r
183 WindowState = FormWindowState.Normal;
\r
187 private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
\r
192 private void ConfigToolStripMenuItem_Click(object sender, EventArgs e)
\r
194 if (_configDialog.ShowDialog(this) == DialogResult.OK)
\r
198 private void RestoreLocation()
\r
200 if (_config.Location.X == int.MinValue)
\r
202 var newBounds = Bounds;
\r
203 newBounds.Location = _config.Location;
\r
204 if (IsVisibleOnAnyScreen(newBounds))
\r
205 Location = _config.Location;
\r
208 private void ApplyConfig()
\r
210 _shipListForm.TopMost = TopMost = _config.TopMost;
\r
211 _sniffer.Item.MarginShips = _config.MarginShips;
\r
212 _sniffer.Item.MarginEquips = _config.MarginEquips;
\r
213 _sniffer.Achievement.ResetHours = _config.ResetHours;
\r
216 public void ApplyDebugLogSetting()
\r
218 _debugLogFile = _config.DebugLogging ? _config.DebugLogFile : null;
\r
221 public void ApplyProxySetting()
\r
223 if (_config.Proxy.Auto == _prevProxy.Auto && _config.Proxy.Listen == _prevProxy.Listen)
\r
229 public void ApplyLogSetting()
\r
231 if (_logServer != null && (!_config.Log.ServerOn || _config.Log.Listen != _logServer.Port))
\r
236 if (_logServer == null && _config.Log.ServerOn)
\r
238 _logServer = new LogServer(_config.Log.Listen);
\r
239 _logServer.Start();
\r
241 if (_logServer != null)
\r
242 _logServer.OutputDir = _config.Log.OutputDir;
\r
243 _sniffer.EnableLog(_config.Log.On ? LogType.All : LogType.None);
\r
244 _sniffer.MaterialLogInterval = _config.Log.MaterialLogInterval;
\r
245 _sniffer.LogOutputDir = _config.Log.OutputDir;
\r
248 public static bool IsVisibleOnAnyScreen(Rectangle rect)
\r
250 return Screen.AllScreens.Any(screen => screen.WorkingArea.IntersectsWith(rect));
\r
253 private void timerMain_Tick(object sender, EventArgs e)
\r
257 if (_playLog == null || _configDialog.Visible)
\r
259 labelPlayLog.Visible = false;
\r
265 public void SetPlayLog(string file)
\r
267 _playLog = File.ReadLines(file).GetEnumerator();
\r
270 private void PlayLog()
\r
272 var lines = new List<string>();
\r
273 foreach (var s in new[] {"url: ", "request: ", "response: "})
\r
275 if (!_playLog.MoveNext() || !_playLog.Current.StartsWith(s))
\r
277 labelPlayLog.Visible = false;
\r
280 lines.Add(_playLog.Current.Substring(s.Count()));
\r
282 labelPlayLog.Visible = !labelPlayLog.Visible;
\r
283 var json = DynamicJson.Parse(lines[2]);
\r
284 UpdateInfo(_sniffer.Sniff(lines[0], lines[1], json));
\r
287 private void ShowShipOnShipList(object sender, EventArgs ev)
\r
289 if (!_shipListForm.Visible)
\r
291 var idx = (int)((Control)sender).Tag;
\r
292 var statuses = _sniffer.GetShipStatuses(_currentFleet);
\r
293 if (statuses.Length <= idx)
\r
295 _shipListForm.ShowShip(statuses[idx].Id);
\r
298 private void UpdateItemInfo()
\r
300 UpdateNumOfShips();
\r
301 UpdateNumOfEquips();
\r
302 labelNumOfBuckets.Text = _sniffer.Item.MaterialHistory[(int)Material.Bucket].Now.ToString("D");
\r
303 UpdateBucketHistory();
\r
304 var ac = _sniffer.Achievement.Value;
\r
307 labelAchievement.Text = ac >= 1000 ? ac.ToString("D") : ac.ToString("F1");
\r
308 UpdateMaterialHistry();
\r
309 if (_shipListForm.Visible)
\r
310 _shipListForm.UpdateList();
\r
313 private void UpdateNumOfShips()
\r
315 var item = _sniffer.Item;
\r
316 labelNumOfShips.Text = string.Format("{0:D}/{1:D}", item.NowShips, item.MaxShips);
\r
317 labelNumOfShips.ForeColor = item.TooManyShips ? Color.Red : Color.Black;
\r
318 if (item.RingShips)
\r
320 var message = string.Format("残り{0:D}隻", _sniffer.Item.MaxShips - _sniffer.Item.NowShips);
\r
321 _noticeQueue.Enqueue("艦娘が多すぎます", message, _config.MaxShipsSoundFile);
\r
322 item.RingShips = false;
\r
326 private void UpdateNumOfEquips()
\r
328 var item = _sniffer.Item;
\r
329 labelNumOfEquips.Text = string.Format("{0:D}/{1:D}", item.NowEquips, item.MaxEquips);
\r
330 labelNumOfEquips.ForeColor = item.TooManyEquips ? Color.Red : Color.Black;
\r
331 if (item.RingEquips)
\r
333 var message = string.Format("残り{0:D}個", _sniffer.Item.MaxEquips - _sniffer.Item.NowEquips);
\r
334 _noticeQueue.Enqueue("装備が多すぎます", message, _config.MaxEquipsSoundFile);
\r
335 item.RingEquips = false;
\r
339 private void UpdateBucketHistory()
\r
341 var count = _sniffer.Item.MaterialHistory[(int)Material.Bucket];
\r
342 var day = count.Now - count.BegOfDay;
\r
343 var week = count.Now - count.BegOfWeek;
\r
348 labelBucketHistory.Text = string.Format("{0:+#;-#;±0} 今日\n{1:+#;-#;±0} 今週", day, week);
\r
351 private void UpdateMaterialHistry()
\r
353 var labels = new[] {labelFuelHistory, labelBulletHistory, labelSteelHistory, labelBouxiteHistory};
\r
354 var text = new[] {"燃料", "弾薬", "鋼材", "ボーキ"};
\r
355 for (var i = 0; i < labels.Length; i++)
\r
357 var count = _sniffer.Item.MaterialHistory[i];
\r
358 var day = count.Now - count.BegOfDay;
\r
361 var week = count.Now - count.BegOfWeek;
\r
362 if (week >= 100000)
\r
364 labels[i].Text = string.Format("{0}\n{1:+#;-#;±0}\n{2:+#;-#;±0}", text[i], day, week);
\r
368 private void UpdateShipInfo()
\r
370 UpdatePanelShipInfo();
\r
371 NotifyDamagedShip();
\r
372 UpdateChargeInfo();
\r
373 UpdateDamagedShipList();
\r
374 if (_shipListForm.Visible)
\r
375 _shipListForm.UpdateList();
\r
378 private void UpdatePanelShipInfo()
\r
380 var statuses = _sniffer.GetShipStatuses(_currentFleet);
\r
381 _shipLabels.SetShipInfo(statuses);
\r
382 labelAirSuperiority.Text = _sniffer.GetAirSuperiority(_currentFleet).ToString("D");
\r
383 UpdateAkashiTimer();
\r
385 UpdateCondTimers();
\r
388 private void NotifyDamagedShip()
\r
390 if (_sniffer.Battle.HasDamagedShip)
\r
391 _noticeQueue.Enqueue("大破した艦娘がいます", string.Join(" ", _sniffer.Battle.DamagedShipNames),
\r
392 _config.DamagedShipSoundFile);
\r
395 private void NotifyAkashiTimer()
\r
397 var msgs = _sniffer.GetAkashiTimerNotice();
\r
398 if (msgs.Length == 0)
\r
400 if (msgs[0] == "20分経過しました。")
\r
402 _noticeQueue.Enqueue("泊地修理", msgs[0], _config.Akashi20MinSoundFile);
\r
405 var fn = new[] {"第一艦隊", "第二艦隊", "第三艦隊", "第四艦隊"};
\r
406 for (var i = 0; i < fn.Length; i++)
\r
410 _noticeQueue.Enqueue("泊地修理 " + fn[i], msgs[i], _config.AkashiProgressSoundFile);
\r
414 private void UpdateLoS()
\r
416 labelLoS.Text = _sniffer.GetFleetLineOfSights(_currentFleet).ToString("F1");
\r
419 private void UpdateBattleInfo()
\r
421 labelFormation.Text = "";
\r
422 labelEnemyAirSuperiority.Text = "";
\r
423 panelBattleInfo.Visible = _sniffer.Battle.InBattle;
\r
424 if (!_sniffer.Battle.InBattle)
\r
426 panelBattleInfo.BringToFront();
\r
427 var t = new Timer {Interval = 2000}; // 艦隊が表示されるまで遅延させる
\r
428 t.Tick += (sender, args) =>
\r
430 labelFormation.Text = _sniffer.Battle.Formation;
\r
431 labelEnemyAirSuperiority.Text = _sniffer.Battle.EnemyAirSuperiority.ToString("D");
\r
437 private void UpdateChargeInfo()
\r
439 var fuelSq = new[] {labelFuelSq1, labelFuelSq2, labelFuelSq3, labelFuelSq4};
\r
440 var bullSq = new[] {labelBullSq1, labelBullSq2, labelBullSq3, labelBullSq4};
\r
442 for (var i = 0; i < fuelSq.Length; i++)
\r
444 var stat = _sniffer.ChargeStatuses[i];
\r
445 fuelSq[i].ImageIndex = stat.Fuel;
\r
446 bullSq[i].ImageIndex = stat.Bull;
\r
450 private void UpdateNDocLabels()
\r
452 _shipLabels.SetNDockLabels(_sniffer.NDock);
\r
455 private void UpdateMissionLabels()
\r
457 foreach (var entry in
\r
458 new[] {labelMissionName1, labelMissionName2, labelMissionName3}.Zip(_sniffer.Missions,
\r
459 (label, mission) => new {label, mission.Name}))
\r
460 entry.label.Text = entry.Name;
\r
463 private void UpdateTimers()
\r
465 foreach (var entry in
\r
466 new[] {labelMission1, labelMission2, labelMission3}.Zip(_sniffer.Missions,
\r
467 (label, mission) => new {label, mission.Name, mission.Timer}))
\r
469 entry.Timer.Update();
\r
470 SetTimerColor(entry.label, entry.Timer);
\r
471 var rest = entry.Timer.Rest;
\r
472 entry.label.Text = rest.Days == 0 ? rest.ToString(@"hh\:mm\:ss") : rest.ToString(@"d\.hh\:mm");
\r
473 if (!entry.Timer.NeedRing)
\r
475 _noticeQueue.Enqueue("遠征が終わりました", entry.Name, _config.MissionSoundFile);
\r
476 entry.Timer.NeedRing = false;
\r
478 for (var i = 0; i < _sniffer.NDock.Length; i++)
\r
480 var entry = _sniffer.NDock[i];
\r
481 entry.Timer.Update();
\r
482 _shipLabels.SetNDockTimer(i, entry.Timer);
\r
483 if (!entry.Timer.NeedRing)
\r
485 _noticeQueue.Enqueue("入渠が終わりました", entry.Name, _config.NDockSoundFile);
\r
486 entry.Timer.NeedRing = false;
\r
488 var kdock = new[] {labelConstruct1, labelConstruct2, labelConstruct3, labelConstruct4};
\r
489 for (var i = 0; i < kdock.Length; i++)
\r
491 var timer = _sniffer.KDock[i];
\r
493 SetTimerColor(kdock[i], timer);
\r
494 kdock[i].Text = timer.Rest.ToString(@"hh\:mm\:ss");
\r
495 if (!timer.NeedRing)
\r
497 _noticeQueue.Enqueue("建造が終わりました", string.Format("第{0:D}ドック", i + 1), _config.KDockSoundFile);
\r
498 timer.NeedRing = false;
\r
500 UpdateCondTimers();
\r
501 UpdateAkashiTimer();
\r
504 private void SetTimerColor(Label label, RingTimer timer)
\r
506 label.ForeColor = timer.IsFinished ? Color.Red : Color.Black;
\r
509 private void UpdateCondTimers()
\r
511 var timer = _sniffer.GetConditionTimer(_currentFleet);
\r
512 var now = DateTime.Now;
\r
513 if (timer == DateTime.MinValue)
\r
515 labelCondTimerTitle.Text = "";
\r
516 labelCondTimer.Text = "";
\r
519 var span = TimeSpan.FromSeconds(Math.Ceiling((timer - now).TotalSeconds));
\r
520 if (span >= TimeSpan.FromMinutes(9))
\r
522 labelCondTimerTitle.Text = "cond40まで";
\r
523 labelCondTimer.Text = (span - TimeSpan.FromMinutes(9)).ToString(@"mm\:ss");
\r
527 labelCondTimerTitle.Text = "cond49まで";
\r
528 labelCondTimer.Text = (span >= TimeSpan.Zero ? span : TimeSpan.Zero).ToString(@"mm\:ss");
\r
530 var notice = _sniffer.GetConditionNotice();
\r
531 if (notice == null)
\r
533 var fn = new[] {"第一艦隊", "第二艦隊", "第三艦隊", "第四艦隊"};
\r
534 for (var i = 0; i < fn.Length; i++)
\r
536 if (!_config.NotifyConditions.Contains(notice[i]))
\r
538 _noticeQueue.Enqueue("疲労が回復しました", fn[i] + " cond" + notice[i].ToString("D"), _config.ConditionSoundFile);
\r
542 private void UpdateAkashiTimer()
\r
544 _shipLabels.SetAkashiTimer(_sniffer.GetShipStatuses(_currentFleet),
\r
545 _sniffer.GetAkashiTimers(_currentFleet));
\r
546 NotifyAkashiTimer();
\r
549 private void UpdateDamagedShipList()
\r
551 _shipLabels.SetDamagedShipList(_sniffer.DamagedShipList);
\r
554 private void UpdateQuestList()
\r
556 var name = new[] {labelQuest1, labelQuest2, labelQuest3, labelQuest4, labelQuest5};
\r
557 var progress = new[] {labelProgress1, labelProgress2, labelProgress3, labelProgress4, labelProgress5};
\r
559 for (var i = 0; i < name.Length; i++)
\r
561 if (i < _sniffer.Quests.Length)
\r
563 name[i].Text = _sniffer.Quests[i].Name;
\r
564 progress[i].Text = string.Format("{0:D}%", _sniffer.Quests[i].Progress);
\r
568 name[i].Text = progress[i].Text = "";
\r
573 private class NoticeQueue
\r
575 private readonly Action<string, string, string> _ring;
\r
576 private readonly Queue<Tuple<string, string, string>> _queue = new Queue<Tuple<string, string, string>>();
\r
577 private readonly Timer _timer = new Timer {Interval = 2000};
\r
579 public NoticeQueue(Action<string, string, string> ring)
\r
582 _timer.Tick += TimerOnTick;
\r
585 private void TimerOnTick(object obj, EventArgs e)
\r
587 if (_queue.Count == 0)
\r
592 var notice = _queue.Dequeue();
\r
593 _ring(notice.Item1, notice.Item2, notice.Item3);
\r
596 public void Enqueue(string title, string message, string soundFile)
\r
598 if (_timer.Enabled)
\r
600 _queue.Enqueue(new Tuple<string, string, string>(title, message, soundFile));
\r
604 _ring(title, message, soundFile);
\r
610 private void Ring(string baloonTitle, string baloonMessage, string soundFile)
\r
612 if (_config.FlashWindow)
\r
613 Win32API.FlashWindow(Handle);
\r
614 if (_config.ShowBaloonTip)
\r
615 notifyIconMain.ShowBalloonTip(20000, baloonTitle, baloonMessage, ToolTipIcon.Info);
\r
616 if (_config.PlaySound)
\r
617 PlaySound(soundFile, _config.SoundVolume);
\r
620 [DllImport("winmm.dll")]
\r
621 private static extern int mciSendString(String command,
\r
622 StringBuilder buffer, int bufferSize, IntPtr hwndCallback);
\r
624 // ReSharper disable InconsistentNaming
\r
625 private const int MM_MCINOTIFY = 0x3B9;
\r
626 private const int MCI_NOTIFY_SUCCESSFUL = 1;
\r
627 // ReSharper restore InconsistentNaming
\r
629 public void PlaySound(string file, int volume)
\r
631 if (!File.Exists(file))
\r
633 if (mciSendString("open \"" + file + "\" type mpegvideo alias sound", null, 0, IntPtr.Zero) != 0)
\r
635 mciSendString("setaudio sound volume to " + volume * 10, null, 0, IntPtr.Zero);
\r
636 mciSendString("play sound from 0 notify", null, 0, Handle);
\r
639 protected override void WndProc(ref Message m)
\r
641 if (m.Msg == MM_MCINOTIFY && (int)m.WParam == MCI_NOTIFY_SUCCESSFUL)
\r
642 mciSendString("close sound", null, 0, IntPtr.Zero);
\r
643 base.WndProc(ref m);
\r
646 private void SetupFleetClick()
\r
650 new[] {labelFleet1, labelFleet2, labelFleet3, labelFleet4},
\r
651 new[] {labelFuelSq1, labelFuelSq2, labelFuelSq3, labelFuelSq4},
\r
652 new[] {labelBullSq1, labelBullSq2, labelBullSq3, labelBullSq4}
\r
654 foreach (var a in labels)
\r
656 for (var fleet = 0; fleet < labels[0].Length; fleet++)
\r
658 a[fleet].Tag = fleet;
\r
659 a[fleet].Click += labelFleet_Click;
\r
664 private void labelFleet_Click(object sender, EventArgs e)
\r
666 var fleet = (int)((Label)sender).Tag;
\r
667 if (_currentFleet == fleet)
\r
669 _currentFleet = fleet;
\r
670 foreach (var label in _labelCheckFleets)
\r
671 label.Visible = false;
\r
672 _labelCheckFleets[fleet].Visible = true;
\r
675 UpdatePanelShipInfo();
\r
678 private void labelBucketHistoryButton_Click(object sender, EventArgs e)
\r
680 if (labelBucketHistory.Visible)
\r
682 labelBucketHistory.Visible = false;
\r
683 labelBucketHistoryButton.BackColor = DefaultBackColor;
\r
687 labelBucketHistory.Visible = true;
\r
688 labelBucketHistory.BringToFront();
\r
689 labelBucketHistoryButton.BackColor = SystemColors.ActiveCaption;
\r
693 private void labelMaterialHistoryButton_Click(object sender, EventArgs e)
\r
695 if (panelMaterialHistory.Visible)
\r
697 panelMaterialHistory.Visible = false;
\r
698 labelMaterialHistoryButton.BackColor = DefaultBackColor;
\r
702 panelMaterialHistory.Visible = true;
\r
703 panelMaterialHistory.BringToFront();
\r
704 labelMaterialHistoryButton.BackColor = SystemColors.ActiveCaption;
\r
708 public void ResetAchievemnt()
\r
710 _sniffer.Achievement.Reset();
\r
714 private void labelDamgedShipListButton_Click(object sender, EventArgs e)
\r
716 if (panelDamagedShipList.Visible)
\r
718 panelDamagedShipList.Visible = false;
\r
719 labelDamgedShipListButton.BackColor = DefaultBackColor;
\r
723 panelDamagedShipList.Visible = true;
\r
724 panelDamagedShipList.BringToFront();
\r
725 labelDamgedShipListButton.BackColor = SystemColors.ActiveCaption;
\r
729 private void ShipListToolStripMenuItem_Click(object sender, EventArgs e)
\r
731 _shipListForm.UpdateList();
\r
732 _shipListForm.Show();
\r
733 if (_shipListForm.WindowState == FormWindowState.Minimized)
\r
734 _shipListForm.WindowState = FormWindowState.Normal;
\r
735 _shipListForm.Activate();
\r
738 private void LogToolStripMenuItem_Click(object sender, EventArgs e)
\r
740 Process.Start("http://localhost:" + _config.Log.Listen + "/");
\r