OSDN Git Service

設定でダメコン装備でも大破警告を出せるようにする
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Sat, 17 Aug 2019 11:06:08 +0000 (20:06 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Sat, 17 Aug 2019 13:29:02 +0000 (22:29 +0900)
KancolleSniffer/Config.cs
KancolleSniffer/ConfigDialog.Designer.cs
KancolleSniffer/ConfigDialog.cs
KancolleSniffer/MainForm.cs
KancolleSniffer/Model/ShipInfo.cs
KancolleSniffer/Sniffer.cs

index 68ffc7a..aa5ca31 100644 (file)
@@ -272,6 +272,7 @@ namespace KancolleSniffer
         public bool AlwaysShowResultRank { get; set; }\r
         public Spoiler Spoilers { get; set; }\r
         public bool UsePresetAkashi { get; set; }\r
+        public bool WarnBadDamageWithDameCon { get; set; }\r
         public SoundConfig Sounds { get; set; } = new SoundConfig();\r
         public bool DebugLogging { get; set; }\r
         public string DebugLogFile { get; set; } = "log.txt";\r
index f91ed76..39e48f8 100644 (file)
@@ -44,6 +44,10 @@ namespace KancolleSniffer
         {\r
             this.tabControl = new System.Windows.Forms.TabControl();\r
             this.tabPageWindow = new System.Windows.Forms.TabPage();\r
+            this.label18 = new System.Windows.Forms.Label();\r
+            this.label17 = new System.Windows.Forms.Label();\r
+            this.label8 = new System.Windows.Forms.Label();\r
+            this.numericUpDownQuest = new System.Windows.Forms.NumericUpDown();\r
             this.checkBoxLocationPerMachine = new System.Windows.Forms.CheckBox();\r
             this.checkBoxExitSilently = new System.Windows.Forms.CheckBox();\r
             this.label15 = new System.Windows.Forms.Label();\r
@@ -67,6 +71,7 @@ namespace KancolleSniffer
             this.checkBoxBalloon = new System.Windows.Forms.CheckBox();\r
             this.checkBoxFlash = new System.Windows.Forms.CheckBox();\r
             this.tabPageAchievement = new System.Windows.Forms.TabPage();\r
+            this.checkBoxWarnBadDamageWithDamecon = new System.Windows.Forms.CheckBox();\r
             this.checkBoxPresetAkashi = new System.Windows.Forms.CheckBox();\r
             this.groupBox3 = new System.Windows.Forms.GroupBox();\r
             this.checkBoxNextCell = new System.Windows.Forms.CheckBox();\r
@@ -133,12 +138,9 @@ namespace KancolleSniffer
             this.openSoundFileDialog = new System.Windows.Forms.OpenFileDialog();\r
             this.folderBrowserDialogOutputDir = new System.Windows.Forms.FolderBrowserDialog();\r
             this.openDebugLogDialog = new System.Windows.Forms.OpenFileDialog();\r
-            this.numericUpDownQuest = new System.Windows.Forms.NumericUpDown();\r
-            this.label8 = new System.Windows.Forms.Label();\r
-            this.label17 = new System.Windows.Forms.Label();\r
-            this.label18 = new System.Windows.Forms.Label();\r
             this.tabControl.SuspendLayout();\r
             this.tabPageWindow.SuspendLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDownQuest)).BeginInit();\r
             this.tabPageNotification.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMarginEquips)).BeginInit();\r
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMarginShips)).BeginInit();\r
@@ -157,7 +159,6 @@ namespace KancolleSniffer
             this.groupBoxPushover.SuspendLayout();\r
             this.groupBoxPushbullet.SuspendLayout();\r
             this.tabPageDebug.SuspendLayout();\r
-            ((System.ComponentModel.ISupportInitialize)(this.numericUpDownQuest)).BeginInit();\r
             this.SuspendLayout();\r
             // \r
             // tabControl\r
@@ -201,6 +202,56 @@ namespace KancolleSniffer
             this.tabPageWindow.Text = "ウィンドウ";\r
             this.tabPageWindow.UseVisualStyleBackColor = true;\r
             // \r
+            // label18\r
+            // \r
+            this.label18.AutoSize = true;\r
+            this.label18.Location = new System.Drawing.Point(121, 127);\r
+            this.label18.Name = "label18";\r
+            this.label18.Size = new System.Drawing.Size(11, 12);\r
+            this.label18.TabIndex = 12;\r
+            this.label18.Text = "*";\r
+            // \r
+            // label17\r
+            // \r
+            this.label17.AutoSize = true;\r
+            this.label17.Location = new System.Drawing.Point(186, 138);\r
+            this.label17.Name = "label17";\r
+            this.label17.Size = new System.Drawing.Size(59, 12);\r
+            this.label17.TabIndex = 11;\r
+            this.label17.Text = "*要再起動";\r
+            // \r
+            // label8\r
+            // \r
+            this.label8.AutoSize = true;\r
+            this.label8.Location = new System.Drawing.Point(11, 130);\r
+            this.label8.Name = "label8";\r
+            this.label8.Size = new System.Drawing.Size(75, 12);\r
+            this.label8.TabIndex = 10;\r
+            this.label8.Text = "任務欄の行数";\r
+            // \r
+            // numericUpDownQuest\r
+            // \r
+            this.numericUpDownQuest.Location = new System.Drawing.Point(87, 127);\r
+            this.numericUpDownQuest.Maximum = new decimal(new int[] {\r
+            7,\r
+            0,\r
+            0,\r
+            0});\r
+            this.numericUpDownQuest.Minimum = new decimal(new int[] {\r
+            4,\r
+            0,\r
+            0,\r
+            0});\r
+            this.numericUpDownQuest.Name = "numericUpDownQuest";\r
+            this.numericUpDownQuest.Size = new System.Drawing.Size(32, 19);\r
+            this.numericUpDownQuest.TabIndex = 9;\r
+            this.numericUpDownQuest.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;\r
+            this.numericUpDownQuest.Value = new decimal(new int[] {\r
+            6,\r
+            0,\r
+            0,\r
+            0});\r
+            // \r
             // checkBoxLocationPerMachine\r
             // \r
             this.checkBoxLocationPerMachine.AutoSize = true;\r
@@ -442,6 +493,7 @@ namespace KancolleSniffer
             // \r
             // tabPageAchievement\r
             // \r
+            this.tabPageAchievement.Controls.Add(this.checkBoxWarnBadDamageWithDamecon);\r
             this.tabPageAchievement.Controls.Add(this.checkBoxPresetAkashi);\r
             this.tabPageAchievement.Controls.Add(this.groupBox3);\r
             this.tabPageAchievement.Controls.Add(this.groupBox2);\r
@@ -453,10 +505,20 @@ namespace KancolleSniffer
             this.tabPageAchievement.Text = "機能";\r
             this.tabPageAchievement.UseVisualStyleBackColor = true;\r
             // \r
+            // checkBoxWarnBadDamageWithDamecon\r
+            // \r
+            this.checkBoxWarnBadDamageWithDamecon.AutoSize = true;\r
+            this.checkBoxWarnBadDamageWithDamecon.Location = new System.Drawing.Point(20, 114);\r
+            this.checkBoxWarnBadDamageWithDamecon.Name = "checkBoxWarnBadDamageWithDamecon";\r
+            this.checkBoxWarnBadDamageWithDamecon.Size = new System.Drawing.Size(168, 16);\r
+            this.checkBoxWarnBadDamageWithDamecon.TabIndex = 20;\r
+            this.checkBoxWarnBadDamageWithDamecon.Text = "ダメコン装備でも大破警告する";\r
+            this.checkBoxWarnBadDamageWithDamecon.UseVisualStyleBackColor = true;\r
+            // \r
             // checkBoxPresetAkashi\r
             // \r
             this.checkBoxPresetAkashi.AutoSize = true;\r
-            this.checkBoxPresetAkashi.Location = new System.Drawing.Point(20, 124);\r
+            this.checkBoxPresetAkashi.Location = new System.Drawing.Point(20, 135);\r
             this.checkBoxPresetAkashi.Name = "checkBoxPresetAkashi";\r
             this.checkBoxPresetAkashi.Size = new System.Drawing.Size(141, 16);\r
             this.checkBoxPresetAkashi.TabIndex = 19;\r
@@ -469,10 +531,10 @@ namespace KancolleSniffer
             this.groupBox3.Controls.Add(this.checkBoxBattleResult);\r
             this.groupBox3.Controls.Add(this.checkBoxAirBattleResult);\r
             this.groupBox3.Controls.Add(this.checkBoxResultRank);\r
-            this.groupBox3.Location = new System.Drawing.Point(11, 65);\r
+            this.groupBox3.Location = new System.Drawing.Point(11, 59);\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.Size = new System.Drawing.Size(234, 44);\r
             this.groupBox3.TabIndex = 18;\r
             this.groupBox3.TabStop = false;\r
             this.groupBox3.Text = "ネタバレ";\r
@@ -480,7 +542,7 @@ namespace KancolleSniffer
             // checkBoxNextCell\r
             // \r
             this.checkBoxNextCell.AutoSize = true;\r
-            this.checkBoxNextCell.Location = new System.Drawing.Point(174, 21);\r
+            this.checkBoxNextCell.Location = new System.Drawing.Point(174, 18);\r
             this.checkBoxNextCell.Name = "checkBoxNextCell";\r
             this.checkBoxNextCell.Size = new System.Drawing.Size(48, 16);\r
             this.checkBoxNextCell.TabIndex = 3;\r
@@ -490,7 +552,7 @@ namespace KancolleSniffer
             // checkBoxBattleResult\r
             // \r
             this.checkBoxBattleResult.AutoSize = true;\r
-            this.checkBoxBattleResult.Location = new System.Drawing.Point(123, 21);\r
+            this.checkBoxBattleResult.Location = new System.Drawing.Point(123, 18);\r
             this.checkBoxBattleResult.Name = "checkBoxBattleResult";\r
             this.checkBoxBattleResult.Size = new System.Drawing.Size(48, 16);\r
             this.checkBoxBattleResult.TabIndex = 2;\r
@@ -500,7 +562,7 @@ namespace KancolleSniffer
             // checkBoxAirBattleResult\r
             // \r
             this.checkBoxAirBattleResult.AutoSize = true;\r
-            this.checkBoxAirBattleResult.Location = new System.Drawing.Point(60, 21);\r
+            this.checkBoxAirBattleResult.Location = new System.Drawing.Point(60, 18);\r
             this.checkBoxAirBattleResult.Name = "checkBoxAirBattleResult";\r
             this.checkBoxAirBattleResult.Size = new System.Drawing.Size(60, 16);\r
             this.checkBoxAirBattleResult.TabIndex = 1;\r
@@ -510,7 +572,7 @@ namespace KancolleSniffer
             // checkBoxResultRank\r
             // \r
             this.checkBoxResultRank.AutoSize = true;\r
-            this.checkBoxResultRank.Location = new System.Drawing.Point(9, 21);\r
+            this.checkBoxResultRank.Location = new System.Drawing.Point(9, 18);\r
             this.checkBoxResultRank.Name = "checkBoxResultRank";\r
             this.checkBoxResultRank.Size = new System.Drawing.Size(48, 16);\r
             this.checkBoxResultRank.TabIndex = 0;\r
@@ -522,10 +584,10 @@ namespace KancolleSniffer
             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.Location = new System.Drawing.Point(11, 10);\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.Size = new System.Drawing.Size(234, 44);\r
             this.groupBox2.TabIndex = 17;\r
             this.groupBox2.TabStop = false;\r
             this.groupBox2.Text = "戦果のリセット";\r
@@ -533,7 +595,7 @@ namespace KancolleSniffer
             // checkBoxReset02\r
             // \r
             this.checkBoxReset02.AutoSize = true;\r
-            this.checkBoxReset02.Location = new System.Drawing.Point(9, 21);\r
+            this.checkBoxReset02.Location = new System.Drawing.Point(9, 18);\r
             this.checkBoxReset02.Name = "checkBoxReset02";\r
             this.checkBoxReset02.Size = new System.Drawing.Size(42, 16);\r
             this.checkBoxReset02.TabIndex = 13;\r
@@ -542,7 +604,7 @@ namespace KancolleSniffer
             // \r
             // buttonResetAchievement\r
             // \r
-            this.buttonResetAchievement.Location = new System.Drawing.Point(111, 18);\r
+            this.buttonResetAchievement.Location = new System.Drawing.Point(111, 15);\r
             this.buttonResetAchievement.Name = "buttonResetAchievement";\r
             this.buttonResetAchievement.Size = new System.Drawing.Size(44, 20);\r
             this.buttonResetAchievement.TabIndex = 16;\r
@@ -553,7 +615,7 @@ namespace KancolleSniffer
             // checkBoxReset14\r
             // \r
             this.checkBoxReset14.AutoSize = true;\r
-            this.checkBoxReset14.Location = new System.Drawing.Point(57, 21);\r
+            this.checkBoxReset14.Location = new System.Drawing.Point(57, 18);\r
             this.checkBoxReset14.Name = "checkBoxReset14";\r
             this.checkBoxReset14.Size = new System.Drawing.Size(48, 16);\r
             this.checkBoxReset14.TabIndex = 14;\r
@@ -1116,56 +1178,6 @@ namespace KancolleSniffer
             this.openDebugLogDialog.CheckFileExists = false;\r
             this.openDebugLogDialog.Title = "ログファイルの選択";\r
             // \r
-            // numericUpDownQuest\r
-            // \r
-            this.numericUpDownQuest.Location = new System.Drawing.Point(87, 127);\r
-            this.numericUpDownQuest.Maximum = new decimal(new int[] {\r
-            7,\r
-            0,\r
-            0,\r
-            0});\r
-            this.numericUpDownQuest.Minimum = new decimal(new int[] {\r
-            4,\r
-            0,\r
-            0,\r
-            0});\r
-            this.numericUpDownQuest.Name = "numericUpDownQuest";\r
-            this.numericUpDownQuest.Size = new System.Drawing.Size(32, 19);\r
-            this.numericUpDownQuest.TabIndex = 9;\r
-            this.numericUpDownQuest.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;\r
-            this.numericUpDownQuest.Value = new decimal(new int[] {\r
-            6,\r
-            0,\r
-            0,\r
-            0});\r
-            // \r
-            // label8\r
-            // \r
-            this.label8.AutoSize = true;\r
-            this.label8.Location = new System.Drawing.Point(11, 130);\r
-            this.label8.Name = "label8";\r
-            this.label8.Size = new System.Drawing.Size(75, 12);\r
-            this.label8.TabIndex = 10;\r
-            this.label8.Text = "任務欄の行数";\r
-            // \r
-            // label17\r
-            // \r
-            this.label17.AutoSize = true;\r
-            this.label17.Location = new System.Drawing.Point(186, 138);\r
-            this.label17.Name = "label17";\r
-            this.label17.Size = new System.Drawing.Size(59, 12);\r
-            this.label17.TabIndex = 11;\r
-            this.label17.Text = "*要再起動";\r
-            // \r
-            // label18\r
-            // \r
-            this.label18.AutoSize = true;\r
-            this.label18.Location = new System.Drawing.Point(121, 127);\r
-            this.label18.Name = "label18";\r
-            this.label18.Size = new System.Drawing.Size(11, 12);\r
-            this.label18.TabIndex = 12;\r
-            this.label18.Text = "*";\r
-            // \r
             // ConfigDialog\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
@@ -1185,6 +1197,7 @@ namespace KancolleSniffer
             this.tabControl.ResumeLayout(false);\r
             this.tabPageWindow.ResumeLayout(false);\r
             this.tabPageWindow.PerformLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDownQuest)).EndInit();\r
             this.tabPageNotification.ResumeLayout(false);\r
             this.tabPageNotification.PerformLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMarginEquips)).EndInit();\r
@@ -1215,7 +1228,6 @@ namespace KancolleSniffer
             this.groupBoxPushbullet.PerformLayout();\r
             this.tabPageDebug.ResumeLayout(false);\r
             this.tabPageDebug.PerformLayout();\r
-            ((System.ComponentModel.ISupportInitialize)(this.numericUpDownQuest)).EndInit();\r
             this.ResumeLayout(false);\r
 \r
         }\r
@@ -1317,5 +1329,6 @@ namespace KancolleSniffer
         private System.Windows.Forms.NumericUpDown numericUpDownQuest;\r
         private System.Windows.Forms.Label label17;\r
         private System.Windows.Forms.Label label18;\r
+        private System.Windows.Forms.CheckBox checkBoxWarnBadDamageWithDamecon;\r
     }\r
 }
\ No newline at end of file
index 07f0ffc..961de2f 100644 (file)
@@ -93,6 +93,7 @@ namespace KancolleSniffer
             checkBoxBattleResult.Checked = (_config.Spoilers & Spoiler.BattleResult) != 0;\r
             checkBoxNextCell.Checked = (_config.Spoilers & Spoiler.NextCell) != 0;\r
             checkBoxPresetAkashi.Checked = _config.UsePresetAkashi;\r
+            checkBoxWarnBadDamageWithDamecon.Checked = _config.WarnBadDamageWithDameCon;\r
 \r
             numericUpDownSoundVolume.Value = _config.Sounds.Volume;\r
             foreach (var name in Config.NotificationNames)\r
@@ -198,6 +199,7 @@ namespace KancolleSniffer
                                (checkBoxBattleResult.Checked ? Spoiler.BattleResult : 0) |\r
                                (checkBoxNextCell.Checked ? Spoiler.NextCell : 0);\r
             _config.UsePresetAkashi = checkBoxPresetAkashi.Checked;\r
+            _config.WarnBadDamageWithDameCon = checkBoxWarnBadDamageWithDamecon.Checked;\r
 \r
             _config.Sounds.Volume = (int)numericUpDownSoundVolume.Value;\r
             foreach (var name in Config.NotificationNames)\r
index 44a2b08..445512a 100644 (file)
@@ -557,6 +557,7 @@ namespace KancolleSniffer
             Sniffer.Achievement.ResetHours = Config.ResetHours;\r
             labelAkashiRepair.Visible = labelAkashiRepairTimer.Visible =\r
                 labelPresetAkashiTimer.Visible = Config.UsePresetAkashi;\r
+            Sniffer.WarnBadDamageWithDameCon = Config.WarnBadDamageWithDameCon;\r
         }\r
 \r
         public void ApplyDebugLogSetting()\r
index 7d00338..a455767 100644 (file)
@@ -34,6 +34,7 @@ namespace KancolleSniffer.Model
         public ShipStatusPair[] BattleResultDiff { get; private set; } = new ShipStatusPair[0];\r
         public bool IsBattleResultError => BattleResultDiff.Length > 0;\r
         public ShipStatus[] BattleStartStatus { get; private set; } = new ShipStatus[0];\r
+        public bool WarnBadDamageWithDameCon;\r
         public int DropShipId { private get; set; } = -1;\r
 \r
         private class NumEquipsChecker\r
@@ -405,7 +406,8 @@ namespace KancolleSniffer.Model
         {\r
             BadlyDamagedShips =\r
                 (from s in ShipsInSortie\r
-                    where !s.Escaped && s.PreparedDamageControl == -1 && s.DamageLevel == ShipStatus.Damage.Badly\r
+                    where !s.Escaped && (s.PreparedDamageControl == -1 || WarnBadDamageWithDameCon) &&\r
+                          s.DamageLevel == ShipStatus.Damage.Badly\r
                     select s.Name).ToArray();\r
         }\r
 \r
index 3234db9..41a3ee5 100644 (file)
@@ -636,6 +636,11 @@ namespace KancolleSniffer
 \r
         public string[] BadlyDamagedShips => _shipInfo.BadlyDamagedShips;\r
 \r
+        public bool WarnBadDamageWithDameCon\r
+        {\r
+            set => _shipInfo.WarnBadDamageWithDameCon = value;\r
+        }\r
+\r
         public ItemStatus[] ItemList\r
         {\r
             get\r