1 // Copyright (C) 2013, 2014 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.Drawing;
\r
23 using System.Windows.Forms;
\r
24 using Codeplex.Data;
\r
27 namespace KancolleSniffer
\r
29 public partial class MainForm : Form
\r
31 private readonly Sniffer _sniffer = new Sniffer();
\r
32 private readonly dynamic _wmp = Activator.CreateInstance(Type.GetTypeFromProgID("WMPlayer.OCX.7"));
\r
33 private readonly Config _config = new Config();
\r
34 private readonly ConfigDialog _configDialog;
\r
35 private int _currentFleet;
\r
36 private readonly Label[] _labelCheckFleets;
\r
37 private readonly ShipLabel[][] _damagedShipList = new ShipLabel[14][];
\r
38 private readonly Label[] _akashiTimers = new Label[ShipInfo.MemberCount];
\r
39 private readonly ShipLabel[][] _ndockLabels = new ShipLabel[DockInfo.DockCount][];
\r
40 private readonly ShipInfoLabels _shipInfoLabels;
\r
41 private readonly ShipListForm _shipListForm;
\r
42 private readonly NoticeQueue _noticeQueue;
\r
43 private bool _started;
\r
47 InitializeComponent();
\r
48 FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest;
\r
49 FiddlerApplication.BeforeResponse += FiddlerApplication_BeforeResponse;
\r
50 _wmp.PlayStateChange += new EventHandler(_wmp_PlayStateChange);
\r
51 _configDialog = new ConfigDialog(_config, this);
\r
52 _labelCheckFleets = new[] {labelCheckFleet1, labelCheckFleet2, labelCheckFleet3, labelCheckFleet4};
\r
54 var labels = new[] {labelFleet1, labelFleet2, labelFleet3, labelFleet4};
\r
55 for (var i = 0; i < labels.Length; i++)
\r
57 _shipInfoLabels = new ShipInfoLabels(panelShipInfo);
\r
58 for (var i = 0; i < ShipInfo.MemberCount; i++)
\r
60 var label = _shipInfoLabels.GetNameLabel(i);
\r
62 label.Click += (o, e) => ShowShipOnShipList(tmp);
\r
64 CreateDamagedShipList();
\r
65 CreateAkashiTimers();
\r
66 CreateNDockLabels();
\r
67 _shipListForm = new ShipListForm(_sniffer, _config);
\r
68 _noticeQueue = new NoticeQueue(Ring);
\r
71 private void FiddlerApplication_BeforeRequest(Session oSession)
\r
73 var path = oSession.PathAndQuery;
\r
74 var proxy = _config.Proxy;
\r
75 if (proxy.UseUpstream && (path.StartsWith("/kcsapi/api_") ||
\r
76 // この二つはMyFleetGirlsに必要
\r
77 path.StartsWith("/kcs/resources/") || path.StartsWith("/kcs/sound/")))
\r
78 oSession["x-overrideGateway"] = string.Format("localhost:{0:D}", proxy.UpstreamPort); // 上流プロキシを設定する
\r
79 if (!path.StartsWith("/kcsapi/api_")) // 艦これのAPI以外は無視する
\r
84 // 戦闘開始のタイミングのずれを防ぐためにバッファする
\r
85 if (_sniffer.IsBattleAPI(path))
\r
86 oSession.bBufferResponse = true;
\r
89 private void FiddlerApplication_BeforeResponse(Session oSession)
\r
91 if (!oSession.bHasResponse || !oSession.uriContains("/kcsapi/api_"))
\r
93 Invoke(new Action<Session>(ProcessRequest), oSession);
\r
96 private void ProcessRequest(Session session)
\r
98 var response = session.GetResponseBodyAsString();
\r
99 if (!response.StartsWith("svdata="))
\r
101 response = response.Remove(0, "svdata=".Length);
\r
102 var json = DynamicJson.Parse(response);
\r
103 var request = session.GetRequestBodyAsString();
\r
104 var update = (Sniffer.Update)_sniffer.Sniff(session.url, request, json);
\r
105 if (update == Sniffer.Update.Start)
\r
107 labelLogin.Visible = false;
\r
113 if ((update & Sniffer.Update.Item) != 0)
\r
115 if ((update & Sniffer.Update.Timer) != 0)
\r
117 if ((update & Sniffer.Update.NDock) != 0)
\r
118 UpdateNDocLabels();
\r
119 if ((update & Sniffer.Update.Mission) != 0)
\r
120 UpdateMissionLabels();
\r
121 if ((update & Sniffer.Update.QuestList) != 0)
\r
123 if ((update & Sniffer.Update.Ship) != 0)
\r
125 if ((update & Sniffer.Update.Battle) != 0)
\r
126 UpdateBattleInfo();
\r
129 private void MainForm_Load(object sender, EventArgs e)
\r
135 _sniffer.LoadState();
\r
139 private void StartProxy()
\r
141 if (_config.Proxy.Auto)
\r
142 FiddlerApplication.Startup(0, FiddlerCoreStartupFlags.RegisterAsSystemProxy);
\r
144 FiddlerApplication.Startup(_config.Proxy.Listen, FiddlerCoreStartupFlags.None);
\r
147 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
\r
149 _shipListForm.Close();
\r
150 _config.Location = (WindowState == FormWindowState.Normal ? Bounds : RestoreBounds).Location;
\r
152 _sniffer.SaveState();
\r
156 private void ShutdownProxy()
\r
158 FiddlerApplication.Shutdown();
\r
161 private void MainForm_Resize(object sender, EventArgs e)
\r
163 if (_config.HideOnMinimized && WindowState == FormWindowState.Minimized)
\r
164 ShowInTaskbar = false;
\r
167 private void notifyIconMain_MouseDoubleClick(object sender, MouseEventArgs e)
\r
169 NotifyIconOpenToolStripMenuItem_Click(sender, e);
\r
172 private void NotifyIconOpenToolStripMenuItem_Click(object sender, EventArgs e)
\r
174 ShowInTaskbar = true;
\r
175 WindowState = FormWindowState.Normal;
\r
179 private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
\r
181 Application.Exit();
\r
184 private void ConfigToolStripMenuItem_Click(object sender, EventArgs e)
\r
186 if (_configDialog.ShowDialog(this) == DialogResult.OK)
\r
190 private void RestoreLocation()
\r
192 if (_config.Location.X == int.MinValue)
\r
194 var newBounds = Bounds;
\r
195 newBounds.Location = _config.Location;
\r
196 if (IsVisibleOnAnyScreen(newBounds))
\r
197 Location = _config.Location;
\r
200 private void ApplyConfig()
\r
202 TopMost = _config.TopMost;
\r
203 _sniffer.Item.MarginShips = _config.MarginShips;
\r
204 _sniffer.Item.MarginEquips = _config.MarginEquips;
\r
205 _sniffer.Achievement.ResetHours = _config.ResetHours;
\r
208 public void ApplyLogSetting()
\r
210 _sniffer.LogFile = _config.Logging ? _config.LogFile : null;
\r
213 public void ApplyProxySetting()
\r
219 public static bool IsVisibleOnAnyScreen(Rectangle rect)
\r
221 return Screen.AllScreens.Any(screen => screen.WorkingArea.IntersectsWith(rect));
\r
224 private void timerMain_Tick(object sender, EventArgs e)
\r
230 private void ShowShipOnShipList(int idx)
\r
232 if (!_shipListForm.Visible)
\r
234 var statuses = _sniffer.GetShipStatuses(_currentFleet);
\r
235 if (statuses.Length <= idx)
\r
237 _shipListForm.ShowShip(statuses[idx].Id);
\r
240 private void UpdateItemInfo()
\r
242 UpdateNumOfShips();
\r
243 UpdateNumOfEquips();
\r
244 labelNumOfBuckets.Text = _sniffer.Item.MaterialHistory[(int)Material.Bucket].Now.ToString("D");
\r
245 UpdateBucketHistory();
\r
246 var ac = _sniffer.Achievement.Value;
\r
249 labelAchievement.Text = ac >= 1000 ? ac.ToString("D") : ac.ToString("F1");
\r
250 UpdateMaterialHistry();
\r
253 private void UpdateNumOfShips()
\r
255 var item = _sniffer.Item;
\r
256 labelNumOfShips.Text = string.Format("{0:D}/{1:D}", item.NowShips, item.MaxShips);
\r
257 labelNumOfShips.ForeColor = item.TooManyShips ? Color.Red : Color.Black;
\r
258 if (item.RingShips)
\r
260 var message = string.Format("残り{0:D}隻", _sniffer.Item.MaxShips - _sniffer.Item.NowShips);
\r
261 _noticeQueue.Enqueue("艦娘が多すぎます", message, _config.MaxShipsSoundFile);
\r
262 item.RingShips = false;
\r
266 private void UpdateNumOfEquips()
\r
268 var item = _sniffer.Item;
\r
269 labelNumOfEquips.Text = string.Format("{0:D}/{1:D}", item.NowEquips, item.MaxEquips);
\r
270 labelNumOfEquips.ForeColor = item.TooManyEquips ? Color.Red : Color.Black;
\r
271 if (item.RingEquips)
\r
273 var message = string.Format("残り{0:D}個", _sniffer.Item.MaxEquips - _sniffer.Item.NowEquips);
\r
274 _noticeQueue.Enqueue("装備が多すぎます", message, _config.MaxEquipsSoundFile);
\r
275 item.RingEquips = false;
\r
279 private void UpdateBucketHistory()
\r
281 var count = _sniffer.Item.MaterialHistory[(int)Material.Bucket];
\r
282 var day = count.Now - count.BegOfDay;
\r
283 var week = count.Now - count.BegOfWeek;
\r
288 labelBucketHistory.Text = string.Format("{0:+#;-#;±0} 今日\n{1:+#;-#;±0} 今週", day, week);
\r
291 private void UpdateMaterialHistry()
\r
293 var labels = new[] {labelFuelHistory, labelBulletHistory, labelSteelHistory, labelBouxiteHistory};
\r
294 var text = new[] {"燃料", "弾薬", "鋼材", "ボーキ"};
\r
295 for (var i = 0; i < labels.Length; i++)
\r
297 var count = _sniffer.Item.MaterialHistory[i];
\r
298 var day = count.Now - count.BegOfDay;
\r
301 var week = count.Now - count.BegOfWeek;
\r
302 if (week >= 100000)
\r
304 labels[i].Text = string.Format("{0}\n{1:+#;-#;±0}\n{2:+#;-#;±0}", text[i], day, week);
\r
308 private void UpdateShipInfo()
\r
310 var statuses = _sniffer.GetShipStatuses(_currentFleet);
\r
311 _shipInfoLabels.SetShipInfo(statuses);
\r
312 if (_sniffer.Battle.HasDamagedShip)
\r
313 _noticeQueue.Enqueue("大破した艦娘がいます", string.Join(" ", _sniffer.Battle.DamagedShipNames),
\r
314 _config.DamagedShipSoundFile);
\r
315 labelAirSuperiority.Text = _sniffer.GetAirSuperiority(_currentFleet).ToString("D");
\r
316 UpdateChargeInfo();
\r
317 UpdateCondTimers();
\r
318 UpdateAkashiTimer();
\r
319 UpdateDamagedShipList();
\r
320 _shipListForm.UpdateList();
\r
323 private void UpdateBattleInfo()
\r
325 labelFormation.Text = "";
\r
326 labelEnemyAirSuperiority.Text = "";
\r
327 panelBattleInfo.Visible = _sniffer.Battle.InBattle;
\r
328 if (!_sniffer.Battle.InBattle)
\r
330 var t = new Timer {Interval = 2000}; // 艦隊が表示されるまで遅延させる
\r
331 t.Tick += (sender, args) =>
\r
333 labelFormation.Text = _sniffer.Battle.Formation;
\r
334 labelEnemyAirSuperiority.Text = _sniffer.Battle.EnemyAirSuperiority.ToString("D");
\r
340 private void UpdateChargeInfo()
\r
342 var fuel = new[] {labelFuel1, labelFuel2, labelFuel3, labelFuel4};
\r
343 var bull = new[] {labelBull1, labelBull2, labelBull3, labelBull4};
\r
345 for (var i = 0; i < fuel.Length; i++)
\r
347 var stat = _sniffer.ChargeStatuses[i];
\r
348 fuel[i].ImageIndex = stat.Fuel;
\r
349 bull[i].ImageIndex = stat.Bull;
\r
353 private void CreateNDockLabels()
\r
355 var parent = panelDock;
\r
356 for (var i = 0; i < _ndockLabels.Length; i++)
\r
358 var y = 3 + i * 15;
\r
359 parent.Controls.AddRange(
\r
360 _ndockLabels[i] = new[]
\r
362 new ShipLabel {Location = new Point(106, y), AutoSize = true, Text = "00:00:00"},
\r
363 new ShipLabel {Location = new Point(30, y), AutoSize = true} // 名前のZ-orderを下に
\r
368 private void UpdateNDocLabels()
\r
370 for (var i = 0; i < _ndockLabels.Length; i++)
\r
371 _ndockLabels[i][1].SetName(_sniffer.NDock[i].Name);
\r
374 private void UpdateMissionLabels()
\r
376 foreach (var entry in
\r
377 new[] {labelMissionName1, labelMissionName2, labelMissionName3}.Zip(_sniffer.Missions,
\r
378 (label, mission) => new {label, mission.Name}))
\r
379 entry.label.Text = entry.Name;
\r
382 private void UpdateTimers()
\r
384 foreach (var entry in
\r
385 new[] {labelMission1, labelMission2, labelMission3}.Zip(_sniffer.Missions,
\r
386 (label, mission) => new {label, mission.Name, mission.Timer}))
\r
388 entry.Timer.Update();
\r
389 SetTimerLabel(entry.label, entry.Timer);
\r
390 if (!entry.Timer.NeedRing)
\r
392 _noticeQueue.Enqueue("遠征が終わりました", entry.Name, _config.MissionSoundFile);
\r
393 entry.Timer.NeedRing = false;
\r
395 for (var i = 0; i < _ndockLabels.Length; i++)
\r
397 var entry = _sniffer.NDock[i];
\r
398 entry.Timer.Update();
\r
399 SetTimerLabel(_ndockLabels[i][0], entry.Timer);
\r
400 if (!entry.Timer.NeedRing)
\r
402 _noticeQueue.Enqueue("入渠が終わりました", entry.Name, _config.NDockSoundFile);
\r
403 entry.Timer.NeedRing = false;
\r
405 var kdock = new[] {labelConstruct1, labelConstruct2, labelConstruct3, labelConstruct4};
\r
406 for (var i = 0; i < kdock.Length; i++)
\r
408 var timer = _sniffer.KDock[i];
\r
410 SetTimerLabel(kdock[i], timer);
\r
411 if (!timer.NeedRing)
\r
413 _noticeQueue.Enqueue("建造が終わりました", string.Format("第{0:D}ドック", i + 1), _config.KDockSoundFile);
\r
414 timer.NeedRing = false;
\r
416 UpdateCondTimers();
\r
417 UpdateAkashiTimer();
\r
420 private void SetTimerLabel(Label label, RingTimer timer)
\r
422 label.ForeColor = timer.IsFinished ? Color.Red : Color.Black;
\r
423 label.Text = timer.ToString();
\r
426 private void UpdateCondTimers()
\r
428 var timer = _sniffer.GetConditionTimer(_currentFleet);
\r
429 var now = DateTime.Now;
\r
430 if (timer == DateTime.MinValue)
\r
432 labelCondTimerTitle.Text = "";
\r
433 labelCondTimer.Text = "";
\r
436 var span = TimeSpan.FromSeconds(Math.Ceiling((timer - now).TotalSeconds));
\r
437 if (span >= TimeSpan.FromMinutes(9))
\r
439 labelCondTimerTitle.Text = "cond40まで";
\r
440 labelCondTimer.Text = (span - TimeSpan.FromMinutes(9)).ToString(@"mm\:ss");
\r
444 labelCondTimerTitle.Text = "cond49まで";
\r
445 labelCondTimer.Text = (span >= TimeSpan.Zero ? span : TimeSpan.Zero).ToString(@"mm\:ss");
\r
447 var notice = _sniffer.GetConditionNotice();
\r
448 if (notice == null)
\r
450 var fn = new[] {"第一艦隊", "第二艦隊", "第三艦隊", "第四艦隊"};
\r
451 for (var i = 0; i < fn.Length; i++)
\r
453 if (!_config.NotifyConditions.Contains(notice[i]))
\r
455 _noticeQueue.Enqueue("疲労が回復しました", fn[i] + " cond" + notice[i].ToString("D"), _config.ConditionSoundFile);
\r
459 private void CreateAkashiTimers()
\r
461 var parent = panelShipInfo;
\r
462 parent.SuspendLayout();
\r
463 for (var i = 0; i < _akashiTimers.Length; i++)
\r
465 const int width = 31, height = 12;
\r
467 var y = 20 + 16 * i;
\r
468 parent.Controls.Add(
\r
470 new Label {Location = new Point(x, y), Size = new Size(width, height), Visible = false});
\r
471 parent.Controls.SetChildIndex(_akashiTimers[i], 0);
\r
473 parent.ResumeLayout();
\r
476 private void UpdateAkashiTimer()
\r
478 var timers = _sniffer.GetAkashiTimers(_currentFleet);
\r
479 var statuses = _sniffer.GetShipStatuses(_currentFleet);
\r
480 for (var i = 0; i < _akashiTimers.Length; i++)
\r
482 var label = _akashiTimers[i];
\r
483 var labelHp = _shipInfoLabels.GetHpLabel(i);
\r
484 if (timers == null || i >= timers.Length || timers[i].Span == TimeSpan.MinValue)
\r
486 label.Visible = false;
\r
487 labelHp.ForeColor = DefaultForeColor;
\r
490 var timer = timers[i];
\r
491 var stat = statuses[i];
\r
492 label.Visible = true;
\r
493 label.Text = timer.Span.ToString(@"mm\:ss");
\r
494 if (timer.Diff == 0)
\r
496 labelHp.ForeColor = DefaultForeColor;
\r
499 labelHp.ForeColor = Color.DimGray;
\r
500 labelHp.SetHp(stat.NowHp + timer.Diff, stat.MaxHp);
\r
502 var msgs = _sniffer.GetAkashiTimerNotice();
\r
503 var fn = new[] {"第一艦隊", "第二艦隊", "第三艦隊", "第四艦隊"};
\r
504 for (var i = 0; i < fn.Length; i++)
\r
508 var sound = msgs[i] == "20分経過しました。" ? _config.Akashi20MinSoundFile : _config.AkashiProgressSoundFile;
\r
509 _noticeQueue.Enqueue("泊地修理 " + fn[i], msgs[i], sound);
\r
513 public void CreateDamagedShipList()
\r
515 var parent = panelDamagedShipList;
\r
516 parent.SuspendLayout();
\r
517 for (var i = 0; i < _damagedShipList.Length; i++)
\r
519 var y = 3 + i * 16;
\r
520 const int height = 12;
\r
521 parent.Controls.AddRange(_damagedShipList[i] = new[]
\r
523 new ShipLabel {Location = new Point(1, y), Size = new Size(11, height)},
\r
524 new ShipLabel {Location = new Point(79, y), Size = new Size(45, height)},
\r
525 new ShipLabel {Location = new Point(123, y), Size = new Size(5, height - 1)},
\r
526 new ShipLabel {Location = new Point(10, y), AutoSize = true}
\r
529 parent.ResumeLayout();
\r
532 private void UpdateDamagedShipList()
\r
534 const int fleet = 0, name = 3, time = 1, damage = 2;
\r
535 var parent = panelDamagedShipList;
\r
536 var list = _sniffer.DamagedShipList;
\r
537 var num = Math.Min(list.Length, _damagedShipList.Length);
\r
538 const int width = 134;
\r
541 parent.Size = new Size(width, 19);
\r
542 var labels = _damagedShipList[0];
\r
543 labels[fleet].Text = "";
\r
544 labels[name].SetName("なし");
\r
545 labels[time].Text = "";
\r
546 labels[damage].BackColor = DefaultBackColor;
\r
549 parent.Size = new Size(width, num * 16 + 3);
\r
550 var fn = new[] {"", "1", "2", "3", "4"};
\r
551 var colors = new[] {DefaultBackColor, Color.FromArgb(255, 225, 225, 21), Color.Orange, Color.Red};
\r
552 for (var i = 0; i < num; i++)
\r
555 var labels = _damagedShipList[i];
\r
556 labels[fleet].Text = fn[e.Fleet + 1];
\r
557 labels[name].SetName(e.Name);
\r
558 var t = e.RepairTime;
\r
559 labels[time].Text = string.Format(@"{0:d2}:{1:mm\:ss}", (int)t.TotalHours, t);
\r
560 labels[damage].BackColor = colors[(int)e.DamageLevel];
\r
564 private void UpdateQuestList()
\r
566 var name = new[] {labelQuest1, labelQuest2, labelQuest3, labelQuest4, labelQuest5};
\r
567 var progress = new[] {labelProgress1, labelProgress2, labelProgress3, labelProgress4, labelProgress5};
\r
569 for (var i = 0; i < name.Length; i++)
\r
571 if (i < _sniffer.Quests.Length)
\r
573 name[i].Text = _sniffer.Quests[i].Name;
\r
574 progress[i].Text = string.Format("{0:D}%", _sniffer.Quests[i].Progress);
\r
578 name[i].Text = progress[i].Text = "";
\r
583 private class NoticeQueue
\r
585 private readonly Action<string, string, string> _ring;
\r
586 private readonly Queue<Tuple<string, string, string>> _queue = new Queue<Tuple<string, string, string>>();
\r
587 private readonly Timer _timer = new Timer {Interval = 2000};
\r
589 public NoticeQueue(Action<string, string, string> ring)
\r
592 _timer.Tick += TimerOnTick;
\r
595 private void TimerOnTick(object obj, EventArgs e)
\r
597 if (_queue.Count == 0)
\r
602 var notice = _queue.Dequeue();
\r
603 _ring(notice.Item1, notice.Item2, notice.Item3);
\r
606 public void Enqueue(string title, string message, string soundFile)
\r
608 if (_timer.Enabled)
\r
610 _queue.Enqueue(new Tuple<string, string, string>(title, message, soundFile));
\r
614 _ring(title, message, soundFile);
\r
620 private void Ring(string baloonTitle, string baloonMessage, string soundFile)
\r
622 if (_config.FlashWindow)
\r
623 Win32API.FlashWindow(Handle);
\r
624 if (_config.ShowBaloonTip)
\r
625 notifyIconMain.ShowBalloonTip(20000, baloonTitle, baloonMessage, ToolTipIcon.Info);
\r
626 if (_config.PlaySound)
\r
627 PlaySound(soundFile, _config.SoundVolume);
\r
630 public void PlaySound(string file, int volume)
\r
632 if (!File.Exists(file))
\r
634 _wmp.settings.volume = volume;
\r
636 _wmp.controls.play();
\r
639 private void _wmp_PlayStateChange(object sender, EventArgs e)
\r
641 if (_wmp.playState == 8) // MediaEnded
\r
642 _wmp.URL = ""; // 再生したファイルが差し替えできなくなるのを防ぐ。
\r
645 private void labelFleet_Click(object sender, EventArgs e)
\r
647 var fleet = (int)((Label)sender).Tag;
\r
648 if (_currentFleet == fleet)
\r
650 _currentFleet = fleet;
\r
651 foreach (var label in _labelCheckFleets)
\r
652 label.Visible = false;
\r
653 _labelCheckFleets[fleet].Visible = true;
\r
659 private void labelBucketHistoryButton_Click(object sender, EventArgs e)
\r
661 if (labelBucketHistory.Visible)
\r
663 labelBucketHistory.Visible = false;
\r
664 labelBucketHistoryButton.BackColor = DefaultBackColor;
\r
668 labelBucketHistory.Visible = true;
\r
669 labelBucketHistoryButton.BackColor = SystemColors.ActiveCaption;
\r
673 private void labelMaterialHistoryButton_Click(object sender, EventArgs e)
\r
675 if (panelMaterialHistory.Visible)
\r
677 panelMaterialHistory.Visible = false;
\r
678 labelMaterialHistoryButton.BackColor = DefaultBackColor;
\r
682 panelMaterialHistory.Visible = true;
\r
683 labelMaterialHistoryButton.BackColor = SystemColors.ActiveCaption;
\r
687 public void ResetAchievemnt()
\r
689 _sniffer.Achievement.Reset();
\r
693 private void labelDamgedShipListButton_Click(object sender, EventArgs e)
\r
695 if (panelDamagedShipList.Visible)
\r
697 panelDamagedShipList.Visible = false;
\r
698 labelDamgedShipListButton.BackColor = DefaultBackColor;
\r
702 panelDamagedShipList.Visible = true;
\r
703 labelDamgedShipListButton.BackColor = SystemColors.ActiveCaption;
\r
707 private void ShipListToolStripMenuItem_Click(object sender, EventArgs e)
\r
709 _shipListForm.Show();
\r
710 _shipListForm.UpdateList();
\r
711 _shipListForm.Activate();
\r