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