OSDN Git Service

ラベルをクリックしたときだけ勝利判定を表示できるようにする
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Wed, 15 Apr 2015 13:11:20 +0000 (22:11 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Wed, 22 Apr 2015 10:44:19 +0000 (19:44 +0900)
KancolleSniffer/Config.cs
KancolleSniffer/ConfigDialog.Designer.cs
KancolleSniffer/ConfigDialog.cs
KancolleSniffer/MainForm.Designer.cs
KancolleSniffer/MainForm.cs

index e9c4d8d..6fb49a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Kazuhiro Fujieda <fujieda@users.sourceforge.jp>\r
+// Copyright (C) 2014, 2015 Kazuhiro Fujieda <fujieda@users.sourceforge.jp>\r
 // \r
 // This program is part of KancolleSniffer.\r
 //\r
@@ -75,7 +75,8 @@ namespace KancolleSniffer
 \r
     public class Config\r
     {\r
-        private readonly string _configFileName = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "config.json");\r
+        private readonly string _configFileName =\r
+            Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ?? "", "config.json");\r
 \r
         public Point Location { get; set; }\r
         public bool TopMost { get; set; }\r
@@ -87,6 +88,7 @@ namespace KancolleSniffer
         public int MarginEquips { get; set; }\r
         public List<int> NotifyConditions { get; set; }\r
         public List<int> ResetHours { get; set; }\r
+        public bool AlwaysShowResultRank { get; set; }\r
         public int SoundVolume { get; set; }\r
         public string MissionSoundFile { get; set; }\r
         public string NDockSoundFile { get; set; }\r
@@ -111,9 +113,9 @@ namespace KancolleSniffer
             MarginEquips = 10;\r
             NotifyConditions = new List<int>(new[] {40, 49});\r
             ResetHours = new List<int>();\r
+            AlwaysShowResultRank = true;\r
             SoundVolume = 100;\r
-            var dir = Path.GetDirectoryName(Application.ExecutablePath);\r
-// ReSharper disable AssignNullToNotNullAttribute\r
+            var dir = Path.GetDirectoryName(Application.ExecutablePath) ?? "";\r
             MissionSoundFile = Path.Combine(dir, "ensei.mp3");\r
             NDockSoundFile = Path.Combine(dir, "nyuukyo.mp3");\r
             KDockSoundFile = Path.Combine(dir, "kenzou.mp3");\r
@@ -124,7 +126,6 @@ namespace KancolleSniffer
             AkashiProgressSoundFile = Path.Combine(dir, "syuuri.mp3");\r
             ConditionSoundFile = Path.Combine(dir, "hirou.mp3");\r
             DebugLogFile = Path.Combine(dir, "log.txt");\r
-// ReSharper restore AssignNullToNotNullAttribute\r
             Proxy = new ProxyConfig();\r
             ShipList = new ShipListConfig();\r
             Log = new LogConfig();\r
index ef1e28b..69105d7 100644 (file)
@@ -65,7 +65,6 @@ namespace KancolleSniffer
             this.checkBoxFlash = new System.Windows.Forms.CheckBox();\r
             this.tabPageAchievement = new System.Windows.Forms.TabPage();\r
             this.buttonResetAchievement = new System.Windows.Forms.Button();\r
-            this.label8 = new System.Windows.Forms.Label();\r
             this.checkBoxReset14 = new System.Windows.Forms.CheckBox();\r
             this.checkBoxReset02 = new System.Windows.Forms.CheckBox();\r
             this.tabPageSound = new System.Windows.Forms.TabPage();\r
@@ -117,6 +116,10 @@ namespace KancolleSniffer
             this.toolTipError = new System.Windows.Forms.ToolTip(this.components);\r
             this.folderBrowserDialogOutputDir = new System.Windows.Forms.FolderBrowserDialog();\r
             this.openDebugLogDialog = new System.Windows.Forms.OpenFileDialog();\r
+            this.groupBox2 = new System.Windows.Forms.GroupBox();\r
+            this.groupBox3 = new System.Windows.Forms.GroupBox();\r
+            this.radioButtonResultRankAlways = new System.Windows.Forms.RadioButton();\r
+            this.radioButtonResultRankWhenClick = new System.Windows.Forms.RadioButton();\r
             this.tabControl.SuspendLayout();\r
             this.tabPageShow.SuspendLayout();\r
             this.tabPageNotification.SuspendLayout();\r
@@ -133,6 +136,8 @@ namespace KancolleSniffer
             this.groupBox1.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaterialLogInterval)).BeginInit();\r
             this.tabPageDebug.SuspendLayout();\r
+            this.groupBox2.SuspendLayout();\r
+            this.groupBox3.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
             // tabControl\r
@@ -161,7 +166,7 @@ namespace KancolleSniffer
             this.tabPageShow.Location = new System.Drawing.Point(4, 40);\r
             this.tabPageShow.Name = "tabPageShow";\r
             this.tabPageShow.Padding = new System.Windows.Forms.Padding(8);\r
-            this.tabPageShow.Size = new System.Drawing.Size(256, 166);\r
+            this.tabPageShow.Size = new System.Drawing.Size(256, 158);\r
             this.tabPageShow.TabIndex = 0;\r
             this.tabPageShow.Text = "表示";\r
             this.tabPageShow.UseVisualStyleBackColor = true;\r
@@ -203,7 +208,7 @@ namespace KancolleSniffer
             this.tabPageNotification.Location = new System.Drawing.Point(4, 40);\r
             this.tabPageNotification.Name = "tabPageNotification";\r
             this.tabPageNotification.Padding = new System.Windows.Forms.Padding(8);\r
-            this.tabPageNotification.Size = new System.Drawing.Size(256, 166);\r
+            this.tabPageNotification.Size = new System.Drawing.Size(256, 158);\r
             this.tabPageNotification.TabIndex = 1;\r
             this.tabPageNotification.Text = "通知";\r
             this.tabPageNotification.UseVisualStyleBackColor = true;\r
@@ -334,21 +339,19 @@ namespace KancolleSniffer
             // \r
             // tabPageAchievement\r
             // \r
-            this.tabPageAchievement.Controls.Add(this.buttonResetAchievement);\r
-            this.tabPageAchievement.Controls.Add(this.label8);\r
-            this.tabPageAchievement.Controls.Add(this.checkBoxReset14);\r
-            this.tabPageAchievement.Controls.Add(this.checkBoxReset02);\r
+            this.tabPageAchievement.Controls.Add(this.groupBox3);\r
+            this.tabPageAchievement.Controls.Add(this.groupBox2);\r
             this.tabPageAchievement.Location = new System.Drawing.Point(4, 40);\r
             this.tabPageAchievement.Name = "tabPageAchievement";\r
             this.tabPageAchievement.Padding = new System.Windows.Forms.Padding(8);\r
-            this.tabPageAchievement.Size = new System.Drawing.Size(256, 166);\r
+            this.tabPageAchievement.Size = new System.Drawing.Size(256, 158);\r
             this.tabPageAchievement.TabIndex = 2;\r
-            this.tabPageAchievement.Text = "æ\88¦æ\9e\9c";\r
+            this.tabPageAchievement.Text = "æ©\9fè\83½";\r
             this.tabPageAchievement.UseVisualStyleBackColor = true;\r
             // \r
             // buttonResetAchievement\r
             // \r
-            this.buttonResetAchievement.Location = new System.Drawing.Point(101, 8);\r
+            this.buttonResetAchievement.Location = new System.Drawing.Point(111, 18);\r
             this.buttonResetAchievement.Name = "buttonResetAchievement";\r
             this.buttonResetAchievement.Size = new System.Drawing.Size(44, 20);\r
             this.buttonResetAchievement.TabIndex = 16;\r
@@ -356,20 +359,10 @@ namespace KancolleSniffer
             this.buttonResetAchievement.UseVisualStyleBackColor = true;\r
             this.buttonResetAchievement.Click += new System.EventHandler(this.buttonResetAchievement_Click);\r
             // \r
-            // label8\r
-            // \r
-            this.label8.AutoSize = true;\r
-            this.label8.Location = new System.Drawing.Point(147, 12);\r
-            this.label8.Margin = new System.Windows.Forms.Padding(3);\r
-            this.label8.Name = "label8";\r
-            this.label8.Size = new System.Drawing.Size(65, 12);\r
-            this.label8.TabIndex = 15;\r
-            this.label8.Text = "にリセットする";\r
-            // \r
             // checkBoxReset14\r
             // \r
             this.checkBoxReset14.AutoSize = true;\r
-            this.checkBoxReset14.Location = new System.Drawing.Point(54, 11);\r
+            this.checkBoxReset14.Location = new System.Drawing.Point(57, 21);\r
             this.checkBoxReset14.Name = "checkBoxReset14";\r
             this.checkBoxReset14.Size = new System.Drawing.Size(48, 16);\r
             this.checkBoxReset14.TabIndex = 14;\r
@@ -379,7 +372,7 @@ namespace KancolleSniffer
             // checkBoxReset02\r
             // \r
             this.checkBoxReset02.AutoSize = true;\r
-            this.checkBoxReset02.Location = new System.Drawing.Point(11, 11);\r
+            this.checkBoxReset02.Location = new System.Drawing.Point(9, 21);\r
             this.checkBoxReset02.Name = "checkBoxReset02";\r
             this.checkBoxReset02.Size = new System.Drawing.Size(42, 16);\r
             this.checkBoxReset02.TabIndex = 13;\r
@@ -468,7 +461,7 @@ namespace KancolleSniffer
             this.tabPageVersion.Location = new System.Drawing.Point(4, 40);\r
             this.tabPageVersion.Name = "tabPageVersion";\r
             this.tabPageVersion.Padding = new System.Windows.Forms.Padding(8);\r
-            this.tabPageVersion.Size = new System.Drawing.Size(256, 166);\r
+            this.tabPageVersion.Size = new System.Drawing.Size(256, 158);\r
             this.tabPageVersion.TabIndex = 4;\r
             this.tabPageVersion.Text = "バージョン情報";\r
             this.tabPageVersion.UseVisualStyleBackColor = true;\r
@@ -529,7 +522,7 @@ namespace KancolleSniffer
             this.tabPageProxy.Location = new System.Drawing.Point(4, 40);\r
             this.tabPageProxy.Name = "tabPageProxy";\r
             this.tabPageProxy.Padding = new System.Windows.Forms.Padding(8);\r
-            this.tabPageProxy.Size = new System.Drawing.Size(256, 166);\r
+            this.tabPageProxy.Size = new System.Drawing.Size(256, 158);\r
             this.tabPageProxy.TabIndex = 5;\r
             this.tabPageProxy.Text = "プロキシ";\r
             this.tabPageProxy.UseVisualStyleBackColor = true;\r
@@ -778,7 +771,7 @@ namespace KancolleSniffer
             this.tabPageDebug.Location = new System.Drawing.Point(4, 40);\r
             this.tabPageDebug.Name = "tabPageDebug";\r
             this.tabPageDebug.Padding = new System.Windows.Forms.Padding(8);\r
-            this.tabPageDebug.Size = new System.Drawing.Size(256, 166);\r
+            this.tabPageDebug.Size = new System.Drawing.Size(256, 158);\r
             this.tabPageDebug.TabIndex = 7;\r
             this.tabPageDebug.Text = "デバッグ";\r
             this.tabPageDebug.UseVisualStyleBackColor = true;\r
@@ -875,6 +868,53 @@ namespace KancolleSniffer
             this.openDebugLogDialog.CheckFileExists = false;\r
             this.openDebugLogDialog.Title = "ログファイルの選択";\r
             // \r
+            // groupBox2\r
+            // \r
+            this.groupBox2.Controls.Add(this.checkBoxReset02);\r
+            this.groupBox2.Controls.Add(this.buttonResetAchievement);\r
+            this.groupBox2.Controls.Add(this.checkBoxReset14);\r
+            this.groupBox2.Location = new System.Drawing.Point(11, 11);\r
+            this.groupBox2.Name = "groupBox2";\r
+            this.groupBox2.Padding = new System.Windows.Forms.Padding(6);\r
+            this.groupBox2.Size = new System.Drawing.Size(234, 48);\r
+            this.groupBox2.TabIndex = 17;\r
+            this.groupBox2.TabStop = false;\r
+            this.groupBox2.Text = "戦果のリセット";\r
+            // \r
+            // groupBox3\r
+            // \r
+            this.groupBox3.Controls.Add(this.radioButtonResultRankWhenClick);\r
+            this.groupBox3.Controls.Add(this.radioButtonResultRankAlways);\r
+            this.groupBox3.Location = new System.Drawing.Point(11, 65);\r
+            this.groupBox3.Name = "groupBox3";\r
+            this.groupBox3.Padding = new System.Windows.Forms.Padding(6);\r
+            this.groupBox3.Size = new System.Drawing.Size(234, 48);\r
+            this.groupBox3.TabIndex = 18;\r
+            this.groupBox3.TabStop = false;\r
+            this.groupBox3.Text = "勝利判定の表示";\r
+            // \r
+            // radioButtonResultRankAlways\r
+            // \r
+            this.radioButtonResultRankAlways.AutoSize = true;\r
+            this.radioButtonResultRankAlways.Location = new System.Drawing.Point(9, 21);\r
+            this.radioButtonResultRankAlways.Name = "radioButtonResultRankAlways";\r
+            this.radioButtonResultRankAlways.Size = new System.Drawing.Size(44, 16);\r
+            this.radioButtonResultRankAlways.TabIndex = 0;\r
+            this.radioButtonResultRankAlways.TabStop = true;\r
+            this.radioButtonResultRankAlways.Text = "常に";\r
+            this.radioButtonResultRankAlways.UseVisualStyleBackColor = true;\r
+            // \r
+            // radioButtonResultRankWhenClick\r
+            // \r
+            this.radioButtonResultRankWhenClick.AutoSize = true;\r
+            this.radioButtonResultRankWhenClick.Location = new System.Drawing.Point(59, 21);\r
+            this.radioButtonResultRankWhenClick.Name = "radioButtonResultRankWhenClick";\r
+            this.radioButtonResultRankWhenClick.Size = new System.Drawing.Size(88, 16);\r
+            this.radioButtonResultRankWhenClick.TabIndex = 1;\r
+            this.radioButtonResultRankWhenClick.TabStop = true;\r
+            this.radioButtonResultRankWhenClick.Text = "クリックしたとき";\r
+            this.radioButtonResultRankWhenClick.UseVisualStyleBackColor = true;\r
+            // \r
             // ConfigDialog\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
@@ -898,7 +938,6 @@ namespace KancolleSniffer
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMarginEquips)).EndInit();\r
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMarginShips)).EndInit();\r
             this.tabPageAchievement.ResumeLayout(false);\r
-            this.tabPageAchievement.PerformLayout();\r
             this.tabPageSound.ResumeLayout(false);\r
             this.tabPageSound.PerformLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSoundVolume)).EndInit();\r
@@ -916,6 +955,10 @@ namespace KancolleSniffer
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaterialLogInterval)).EndInit();\r
             this.tabPageDebug.ResumeLayout(false);\r
             this.tabPageDebug.PerformLayout();\r
+            this.groupBox2.ResumeLayout(false);\r
+            this.groupBox2.PerformLayout();\r
+            this.groupBox3.ResumeLayout(false);\r
+            this.groupBox3.PerformLayout();\r
             this.ResumeLayout(false);\r
 \r
         }\r
@@ -945,7 +988,6 @@ namespace KancolleSniffer
         private System.Windows.Forms.CheckBox checkBoxBalloon;\r
         private System.Windows.Forms.CheckBox checkBoxFlash;\r
         private System.Windows.Forms.Button buttonResetAchievement;\r
-        private System.Windows.Forms.Label label8;\r
         private System.Windows.Forms.CheckBox checkBoxReset14;\r
         private System.Windows.Forms.CheckBox checkBoxReset02;\r
         private System.Windows.Forms.Button buttonPlay;\r
@@ -993,5 +1035,9 @@ namespace KancolleSniffer
         private System.Windows.Forms.Label label13;\r
         private System.Windows.Forms.CheckBox checkBoxDebugLog;\r
         private System.Windows.Forms.OpenFileDialog openDebugLogDialog;\r
+        private System.Windows.Forms.GroupBox groupBox3;\r
+        private System.Windows.Forms.GroupBox groupBox2;\r
+        private System.Windows.Forms.RadioButton radioButtonResultRankWhenClick;\r
+        private System.Windows.Forms.RadioButton radioButtonResultRankAlways;\r
     }\r
 }
\ No newline at end of file
index 9d01785..e55bb28 100644 (file)
@@ -62,6 +62,8 @@ namespace KancolleSniffer
             checkBoxCond49.Checked = _config.NotifyConditions.Contains(49);\r
             checkBoxReset02.Checked = _config.ResetHours.Contains(2);\r
             checkBoxReset14.Checked = _config.ResetHours.Contains(14);\r
+            radioButtonResultRankAlways.Checked = _config.AlwaysShowResultRank;\r
+            radioButtonResultRankWhenClick.Checked = !_config.AlwaysShowResultRank;\r
 \r
             numericUpDownSoundVolume.Value = _config.SoundVolume;\r
 \r
@@ -163,6 +165,8 @@ namespace KancolleSniffer
             if (checkBoxReset14.Checked)\r
                 _config.ResetHours.Add(14);\r
 \r
+            _config.AlwaysShowResultRank = radioButtonResultRankAlways.Checked;\r
+\r
             _config.SoundVolume = (int)numericUpDownSoundVolume.Value;\r
 \r
             _config.MissionSoundFile = _soundSetting["遠征終了"];\r
index b2715a2..163c88d 100644 (file)
@@ -350,6 +350,7 @@ namespace KancolleSniffer
             this.labelResultRank.Size = new System.Drawing.Size(41, 12);\r
             this.labelResultRank.TabIndex = 0;\r
             this.labelResultRank.Text = "判定";\r
+            this.labelResultRank.Click += new System.EventHandler(this.labelResultRank_Click);\r
             // \r
             // labelLoS\r
             // \r
index 1ad8ce7..3395969 100644 (file)
@@ -426,18 +426,24 @@ namespace KancolleSniffer
             if (!_sniffer.Battle.InBattle)\r
                 return;\r
             panelBattleInfo.BringToFront();\r
-            ShowBattleInfo();\r
-        }\r
-\r
-        private void ShowBattleInfo()\r
-        {\r
             var battle = _sniffer.Battle;\r
             var color = new[] { DefaultForeColor, DefaultForeColor, Color.Blue, Color.Green, Color.Orange, Color.Red };\r
             labelFormation.Text = battle.Formation;\r
             labelEnemyAirSuperiority.Text = battle.EnemyAirSuperiority.ToString("D");\r
             labelAirSuperiority.ForeColor = color[battle.AirControlLevel + 1];\r
+            if (_config.AlwaysShowResultRank)\r
+                ShowResultRank();\r
+        }\r
+\r
+        private void ShowResultRank()\r
+        {\r
             var result = new[] { "完全S", "勝利S", "勝利A", "勝利B", "敗北C", "敗北D", "敗北E" };\r
-            labelResultRank.Text = result[(int)battle.ResultRank];\r
+            labelResultRank.Text = result[(int)_sniffer.Battle.ResultRank];\r
+        }\r
+\r
+        private void labelResultRank_Click(object sender, EventArgs e)\r
+        {\r
+            ShowResultRank();\r
         }\r
 \r
         private void UpdateChargeInfo()\r