From b2b90bc92f89e1260295a8688383738943889641 Mon Sep 17 00:00:00 2001 From: andanteyk Date: Tue, 10 Mar 2015 00:12:20 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・戦闘窓のレイアウトが間違っていたのを修正 ・通知窓のアクティベーション設定が働かない不具合を修正 --- .../Notifier/NotifierManager.cs | 2 +- .../Window/Dialog/DialogNotifier.cs | 29 +++++++++++++------ .../Window/FormBattle.Designer.cs | 1 + README.md | 3 ++ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/ElectronicObserver/Notifier/NotifierManager.cs b/ElectronicObserver/Notifier/NotifierManager.cs index 780a11d17..0fd2d949a 100644 --- a/ElectronicObserver/Notifier/NotifierManager.cs +++ b/ElectronicObserver/Notifier/NotifierManager.cs @@ -56,7 +56,7 @@ public void ApplyToConfiguration() { } - public void ShowNotifier( Form form ) { + public void ShowNotifier( ElectronicObserver.Window.Dialog.DialogNotifier form ) { _parentForm.Invoke( (MethodInvoker)( () => form.Show() ) ); } diff --git a/ElectronicObserver/Window/Dialog/DialogNotifier.cs b/ElectronicObserver/Window/Dialog/DialogNotifier.cs index 8886d9497..3353d8c9c 100644 --- a/ElectronicObserver/Window/Dialog/DialogNotifier.cs +++ b/ElectronicObserver/Window/Dialog/DialogNotifier.cs @@ -12,18 +12,19 @@ namespace ElectronicObserver.Window.Dialog { public partial class DialogNotifier : Form { - + public NotifierDialogData DialogData { get; set; } protected override bool ShowWithoutActivation { get { return !DialogData.ShowWithActivation; } } - + public DialogNotifier( NotifierDialogData data ) { - InitializeComponent(); DialogData = data.Clone(); + InitializeComponent(); + Text = DialogData.Title; Font = Utility.Configuration.Config.UI.MainFont; Icon = Resource.ResourceManager.Instance.AppIcon; @@ -46,7 +47,7 @@ private void DialogNotifier_Load( object sender, EventArgs e ) { if ( !DialogData.HasFormBorder ) FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - TopMost = DialogData.TopMost; + //TopMost = DialogData.TopMost; Rectangle screen = System.Windows.Forms.Screen.PrimaryScreen.Bounds; @@ -92,19 +93,29 @@ private void DialogNotifier_Load( object sender, EventArgs e ) { } + protected override CreateParams CreateParams { + get { + var cp = base.CreateParams; + if ( DialogData != null && DialogData.TopMost ) + cp.ExStyle |= 0x8; //set topmost flag + return cp; + } + } + + private void DialogNotifier_Paint( object sender, PaintEventArgs e ) { - + Graphics g = e.Graphics; g.Clear( BackColor ); try { - + if ( DialogData.DrawsImage && DialogData.Image != null ) { g.DrawImage( DialogData.Image, new Rectangle( 0, 0, DialogData.Image.Width, DialogData.Image.Height ) ); - } - + } + if ( DialogData.DrawsMessage ) { TextRenderer.DrawText( g, DialogData.Message, Font, new Rectangle( Padding.Left, Padding.Right, ClientSize.Width - Padding.Horizontal, ClientSize.Height - Padding.Vertical ), ForeColor, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.WordBreak ); @@ -136,7 +147,7 @@ private void DialogNotifier_MouseMove( object sender, MouseEventArgs e ) { private void CloseTimer_Tick( object sender, EventArgs e ) { Close(); } - + } } diff --git a/ElectronicObserver/Window/FormBattle.Designer.cs b/ElectronicObserver/Window/FormBattle.Designer.cs index fdfcf1de3..8d13e43a6 100644 --- a/ElectronicObserver/Window/FormBattle.Designer.cs +++ b/ElectronicObserver/Window/FormBattle.Designer.cs @@ -168,6 +168,7 @@ private void InitializeComponent() { this.BaseLayoutPanel.Controls.Add(this.TableTop); this.BaseLayoutPanel.Controls.Add(this.TableBottom); this.BaseLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.BaseLayoutPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.BaseLayoutPanel.Location = new System.Drawing.Point(0, 0); this.BaseLayoutPanel.Margin = new System.Windows.Forms.Padding(0); this.BaseLayoutPanel.Name = "BaseLayoutPanel"; diff --git a/README.md b/README.md index 500f92480..bea2eeea7 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ * 情報(中破絵未回収艦一覧, 海域ゲージ残量など) * 任務(達成回数/最大値表示) * 図鑑(艦船/装備図鑑) +* 装備一覧 +* 通知(遠征・入渠完了, 大破進撃警告など) +* レコード(開発・建造・ドロップ艦の記録など) なお、全ての機能において艦これ本体の送受信する情報に干渉する操作は行っていません。 From e92dbd95cbdd33d025b7827a15ca23a89b0efee5 Mon Sep 17 00:00:00 2001 From: Nekopanda Date: Tue, 10 Mar 2015 01:29:36 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=E8=88=AA=E6=B5=B7=E6=97=A5=E8=AA=8C?= =?UTF-8?q?=E6=8B=A1=E5=BC=B5=E7=89=88=E3=81=AE=E5=8B=9D=E5=88=A9=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E3=82=92=E6=8C=81=E3=81=A3=E3=81=A6=E3=81=8D=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Window/FormBattle.cs | 127 ++++++++++++++---------- 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/ElectronicObserver/Window/FormBattle.cs b/ElectronicObserver/Window/FormBattle.cs index 40010effa..3e2c7f5c5 100644 --- a/ElectronicObserver/Window/FormBattle.cs +++ b/ElectronicObserver/Window/FormBattle.cs @@ -738,6 +738,76 @@ private void SetHPCombined( int[] hp, BattleData bd ) { } } + /// + /// 勝利ランクを計算します。連合艦隊は情報が少ないので正確ではありません。 + /// + private static int CalcRank( + int countFriend, int countEnemy, + int sunkFriend, int sunkEnemy, + double friendrate, double enemyrate, + bool defeatFlagship) + { + int rifriend = (int)(friendrate * 100); + int rienemy = (int)(enemyrate * 100); + bool equalOrMore = (rienemy > (0.9 * rifriend)); + bool superior = (rienemy > (2.5 * rifriend)); + + if (sunkFriend == 0) + { // 味方轟沈数ゼロ + if (enemyrate >= 1.0) + { // 敵を殲滅した + if (friendrate <= 0.0) + { // 味方ダメージゼロ + return 7; // SS + } + return 6; // S + } + else if (sunkEnemy >= (int)Math.Round(countEnemy * 0.6)) + { // 半数以上撃破 + return 5; // A + } + else if (defeatFlagship || (rienemy > (rifriend * 2.5))) + { // 敵旗艦を撃沈 or 戦果ゲージが2.5倍以上 + return 4; // B + } + } + else + { + if (enemyrate >= 1.0) + { // 敵を殲滅した + return 4; // B + } + // 敵旗艦を撃沈 and 味方轟沈数 < 敵撃沈数 + if (defeatFlagship && (sunkFriend < sunkEnemy)) + { + return 4; // B + } + // 戦果ゲージが2.5倍以上 + if (rienemy > (rifriend * 2.5)) + { + return 4; // B + } + // 敵旗艦を撃沈 + // TODO: 味方の轟沈艦が2隻以上ある場合、敵旗艦を撃沈してもDになる場合がある + if (defeatFlagship) + { + return 3; // C + } + } + // 戦果ゲージが0.9倍以上 + if (rienemy > (0.9 * rifriend)) + { + return 3; // C + } + // 轟沈艦があり かつ 残った艦が1隻のみ + if ((sunkFriend > 0) && ((countFriend - sunkFriend) == 1)) + { + return 1; // E + } + // 残りはD + return 2; // D + } + /// /// 損害率と戦績予測を設定します。 @@ -770,37 +840,10 @@ private void SetDamageRateNormal( int[] hp, BattleData bd ) { int countEnemy = ( bd.EnemyFleetMembers.Skip( 1 ).Count( v => v != -1 ) ); int sunkFriend = hp.Take( countFriend ).Count( v => v <= 0 ); int sunkEnemy = hp.Skip( 6 ).Take( countEnemy ).Count( v => v <= 0 ); - int rifriend = (int)( friendrate * 100 ); - int rienemy = (int)( enemyrate * 100 ); - int rank; + int rank = CalcRank(countFriend, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, (hp[6] <= 0)); Color colorWin = SystemColors.WindowText; Color colorLose = Color.Red; - if ( enemyrate >= 1.0 ) { - if ( friendrate <= 0.0 ) { - rank = 7; - } else { - rank = 6; - } - - } else if ( sunkEnemy >= (int)Math.Round( countEnemy * 0.6 ) ) { - rank = 5; - - } else if ( hp[6] <= 0 || rienemy > rifriend * 2.5 ) { - rank = 4; - - } else if ( rienemy > rifriend || rienemy >= 50 ) { - rank = 3; - - } else { - rank = 2; - } - - if ( sunkFriend > 0 ) - rank = Math.Min( rank, 5 ) - 1; - - - DamageRate.Text = Constants.GetWinRank( rank ); DamageRate.ForeColor = rank >= 4 ? colorWin : colorLose; @@ -844,36 +887,10 @@ private void SetDamageRateCombined( int[] hp, BattleData bd ) { int countEnemy = ( bdc.EnemyFleetMembers.Skip( 1 ).Count( v => v != -1 ) ); int sunkFriend = hp.Take( countFriend ).Count( v => v <= 0 ) + hp.Skip( 12 ).Take( countFriendCombined ).Count( v => v <= 0 ); int sunkEnemy = hp.Skip( 6 ).Take( countEnemy ).Count( v => v <= 0 ); - int rifriend = (int)( friendrate * 100 ); - int rienemy = (int)( enemyrate * 100 ); - int rank; + int rank = CalcRank(countFriend + countFriendCombined, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, (hp[6] <= 0)); Color colorWin = SystemColors.WindowText; Color colorLose = Color.Red; - if ( enemyrate >= 1.0 ) { - if ( friendrate <= 0.0 ) { - rank = 7; - } else { - rank = 6; - } - - } else if ( sunkEnemy >= (int)Math.Round( countEnemy * 0.6 ) ) { - rank = 5; - - } else if ( hp[6] <= 0 || rienemy > rifriend * 2.5 ) { - rank = 4; - - } else if ( rienemy > rifriend || rienemy >= 50 ) { - rank = 3; - - } else { - rank = 2; - } - - if ( sunkFriend > 0 ) - rank = Math.Min( rank, 5 ) - 1; - - DamageRate.Text = Constants.GetWinRank( rank ); DamageRate.ForeColor = rank >= 4 ? colorWin : colorLose; From eaa510d562fbaf8a6172396ab5f994366acb2326 Mon Sep 17 00:00:00 2001 From: andanteyk Date: Tue, 10 Mar 2015 15:04:40 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E6=88=A6=E7=B8=BE=E5=88=A4=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Window/FormBattle.cs | 146 ++++++++++++------------ 1 file changed, 75 insertions(+), 71 deletions(-) diff --git a/ElectronicObserver/Window/FormBattle.cs b/ElectronicObserver/Window/FormBattle.cs index 3e2c7f5c5..07562f5dd 100644 --- a/ElectronicObserver/Window/FormBattle.cs +++ b/ElectronicObserver/Window/FormBattle.cs @@ -63,7 +63,7 @@ public FormBattle( FormMain parent ) { SearchingFriend.ImageList = SearchingEnemy.ImageList = - AACutin.ImageList = + AACutin.ImageList = AirStage1Friend.ImageList = AirStage1Enemy.ImageList = AirStage2Friend.ImageList = @@ -71,7 +71,7 @@ public FormBattle( FormMain parent ) { ResourceManager.Instance.Equipments; BaseLayoutPanel.Visible = false; - + Icon = ResourceManager.ImageToIcon( ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormBattle] ); @@ -116,7 +116,7 @@ private void Updated( string apiname, dynamic data ) { TableTop.SuspendLayout(); TableBottom.SuspendLayout(); switch ( apiname ) { - + case "api_req_map/start": case "api_req_map/next": case "api_port/port": @@ -246,7 +246,7 @@ private void SetSearchingResult( BattleData bd ) { SearchingEnemy.ImageAlign = ContentAlignment.MiddleLeft; SearchingEnemy.ImageIndex = (int)( searchEnemy < 4 ? ResourceManager.EquipmentContent.Seaplane : ResourceManager.EquipmentContent.Radar ); ToolTipInfo.SetToolTip( SearchingEnemy, null ); - + } /// @@ -274,12 +274,12 @@ private void SetAerialWarfare( BattleData bd ) { //空対空戦闘 if ( (int)bd.Data.api_stage_flag[0] != 0 ) { - + AirSuperiority.Text = Constants.GetAirSuperiority( (int)bd.Data.api_kouku.api_stage1.api_disp_seiku ); - + int[] planeFriend = { (int)bd.Data.api_kouku.api_stage1.api_f_lostcount, (int)bd.Data.api_kouku.api_stage1.api_f_count }; AirStage1Friend.Text = string.Format( "-{0}/{1}", planeFriend[0], planeFriend[1] ); - + if ( planeFriend[1] > 0 && planeFriend[0] == planeFriend[1] ) AirStage1Friend.ForeColor = Color.Red; else @@ -287,7 +287,7 @@ private void SetAerialWarfare( BattleData bd ) { int[] planeEnemy = { (int)bd.Data.api_kouku.api_stage1.api_e_lostcount, (int)bd.Data.api_kouku.api_stage1.api_e_count }; AirStage1Enemy.Text = string.Format( "-{0}/{1}", planeEnemy[0], planeEnemy[1] ); - + if ( planeEnemy[1] > 0 && planeEnemy[0] == planeEnemy[1] ) AirStage1Enemy.ForeColor = Color.Red; else @@ -320,15 +320,15 @@ private void SetAerialWarfare( BattleData bd ) { } else { //空対空戦闘発生せず AirSuperiority.Text = Constants.GetAirSuperiority( -1 ); - + AirStage1Friend.Text = "-"; AirStage1Friend.ImageAlign = ContentAlignment.MiddleCenter; AirStage1Friend.ImageIndex = -1; ToolTipInfo.SetToolTip( AirStage1Friend, null ); - + AirStage1Enemy.Text = "-"; AirStage1Enemy.ImageAlign = ContentAlignment.MiddleCenter; - AirStage1Enemy.ImageIndex = -1; + AirStage1Enemy.ImageIndex = -1; ToolTipInfo.SetToolTip( AirStage1Enemy, null ); } @@ -356,7 +356,7 @@ private void SetAerialWarfare( BattleData bd ) { if ( bd.Data.api_kouku.api_stage2.api_air_fire() ) { int cutinID = (int)bd.Data.api_kouku.api_stage2.api_air_fire.api_kind; int cutinIndex = (int)bd.Data.api_kouku.api_stage2.api_air_fire.api_idx; - + AACutin.Text = "#" + ( cutinIndex + 1 ); AACutin.ImageAlign = ContentAlignment.MiddleLeft; AACutin.ImageIndex = (int)ResourceManager.EquipmentContent.HighAngleGun; @@ -365,7 +365,7 @@ private void SetAerialWarfare( BattleData bd ) { KCDatabase.Instance.Fleet[cutinIndex >= 6 ? 2 : bd.FleetIDFriend].MembersInstance[cutinIndex % 6].NameWithLevel, cutinID, Constants.GetAACutinKind( cutinID ) ) ); - + } else { AACutin.Text = "対空砲火"; AACutin.ImageAlign = ContentAlignment.MiddleCenter; @@ -440,7 +440,7 @@ private void SetAerialWarfareAirBattle( BattleData bd ) { AirStage1Friend.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane; EquipmentDataMaster[] planes = { KCDatabase.Instance.MasterEquipments[touchFriend[0]], KCDatabase.Instance.MasterEquipments[touchFriend[1]] }; - ToolTipInfo.SetToolTip( AirStage1Friend, string.Format( + ToolTipInfo.SetToolTip( AirStage1Friend, string.Format( "触接中\r\n1回目: {0}\r\n2回目: {1}", planes[0] != null ? planes[0].Name : "(なし)", planes[1] != null ? planes[1].Name : "(なし)" @@ -525,16 +525,16 @@ private void SetAerialWarfareAirBattle( BattleData bd ) { } else { AACutin.Text = "対空砲火"; AACutin.ImageAlign = ContentAlignment.MiddleCenter; - AACutin.ImageIndex = -1; + AACutin.ImageIndex = -1; ToolTipInfo.SetToolTip( AACutin, null ); } - + } else { AirStage2Friend.Text = "-"; AirStage2Enemy.Text = "-"; AACutin.Text = "対空砲火"; AACutin.ImageAlign = ContentAlignment.MiddleCenter; - AACutin.ImageIndex = -1; + AACutin.ImageIndex = -1; ToolTipInfo.SetToolTip( AACutin, null ); } @@ -542,7 +542,7 @@ private void SetAerialWarfareAirBattle( BattleData bd ) { AirStage2Friend.ImageIndex = -1; AirStage2Enemy.ImageAlign = ContentAlignment.MiddleCenter; AirStage2Enemy.ImageIndex = -1; - + } @@ -585,7 +585,7 @@ private void ClearAerialWarfare() { private void SetHPNormal( int[] hp, BattleData bd ) { KCDatabase db = KCDatabase.Instance; - bool isPractice = ( bd.BattleType & BattleData.BattleTypeFlag.Practice ) != 0; + bool isPractice = ( bd.BattleType & BattleData.BattleTypeFlag.Practice ) != 0; for ( int i = 0; i < 12; i++ ) { if ( (int)bd.Data.api_nowhps[i + 1] != -1 ) { @@ -738,74 +738,74 @@ private void SetHPCombined( int[] hp, BattleData bd ) { } } + /// /// 勝利ランクを計算します。連合艦隊は情報が少ないので正確ではありません。 /// - private static int CalcRank( + /// 戦闘に参加した自軍艦数。 + /// 戦闘に参加した敵軍艦数。 + /// 撃沈された自軍艦数。 + /// 撃沈した敵軍艦数。 + /// 自軍損害率。 + /// 敵軍損害率。 + /// 敵旗艦を撃沈しているか。 + /// thanks: nekopanda + private static int GetWinRank( int countFriend, int countEnemy, int sunkFriend, int sunkEnemy, double friendrate, double enemyrate, - bool defeatFlagship) - { - int rifriend = (int)(friendrate * 100); - int rienemy = (int)(enemyrate * 100); - bool equalOrMore = (rienemy > (0.9 * rifriend)); - bool superior = (rienemy > (2.5 * rifriend)); - - if (sunkFriend == 0) - { // 味方轟沈数ゼロ - if (enemyrate >= 1.0) - { // 敵を殲滅した - if (friendrate <= 0.0) - { // 味方ダメージゼロ - return 7; // SS + bool defeatFlagship ) { + + int rifriend = (int)( friendrate * 100 ); + int rienemy = (int)( enemyrate * 100 ); + + bool borderC = rienemy > ( 0.9 * rifriend ); + bool borderB = rienemy > ( 2.5 * rifriend ); + + if ( sunkFriend == 0 ) { // 味方轟沈数ゼロ + if ( enemyrate >= 1.0 ) { // 敵を殲滅した + if ( friendrate <= 0.0 ) { // 味方ダメージゼロ + return 7; // SS } - return 6; // S - } - else if (sunkEnemy >= (int)Math.Round(countEnemy * 0.6)) - { // 半数以上撃破 - return 5; // A - } - else if (defeatFlagship || (rienemy > (rifriend * 2.5))) - { // 敵旗艦を撃沈 or 戦果ゲージが2.5倍以上 - return 4; // B + return 6; // S + + } else if ( sunkEnemy >= (int)Math.Round( countEnemy * 0.6 ) ) { // 半数以上撃破 + return 5; // A + + } else if ( defeatFlagship || borderB ) { // 敵旗艦を撃沈 or 戦果ゲージが2.5倍以上 + return 4; // B } - } - else - { - if (enemyrate >= 1.0) - { // 敵を殲滅した - return 4; // B + + } else { + if ( enemyrate >= 1.0 ) { // 敵を殲滅した + return 4; // B } // 敵旗艦を撃沈 and 味方轟沈数 < 敵撃沈数 - if (defeatFlagship && (sunkFriend < sunkEnemy)) - { - return 4; // B + if ( defeatFlagship && ( sunkFriend < sunkEnemy ) ) { + return 4; // B } // 戦果ゲージが2.5倍以上 - if (rienemy > (rifriend * 2.5)) - { - return 4; // B + if ( borderB ) { + return 4; // B } // 敵旗艦を撃沈 // TODO: 味方の轟沈艦が2隻以上ある場合、敵旗艦を撃沈してもDになる場合がある - if (defeatFlagship) - { - return 3; // C + if ( defeatFlagship ) { + return 3; // C } } + // 戦果ゲージが0.9倍以上 - if (rienemy > (0.9 * rifriend)) - { - return 3; // C + if ( borderC ) { + return 3; // C } // 轟沈艦があり かつ 残った艦が1隻のみ - if ((sunkFriend > 0) && ((countFriend - sunkFriend) == 1)) - { - return 1; // E + if ( ( sunkFriend > 0 ) && ( ( countFriend - sunkFriend ) == 1 ) ) { + return 1; // E } + // 残りはD - return 2; // D + return 2; // D } @@ -840,13 +840,15 @@ private void SetDamageRateNormal( int[] hp, BattleData bd ) { int countEnemy = ( bd.EnemyFleetMembers.Skip( 1 ).Count( v => v != -1 ) ); int sunkFriend = hp.Take( countFriend ).Count( v => v <= 0 ); int sunkEnemy = hp.Skip( 6 ).Take( countEnemy ).Count( v => v <= 0 ); - int rank = CalcRank(countFriend, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, (hp[6] <= 0)); + + int rank = GetWinRank( countFriend, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, hp[6] <= 0 ); + Color colorWin = SystemColors.WindowText; Color colorLose = Color.Red; + DamageRate.Text = Constants.GetWinRank( rank ); DamageRate.ForeColor = rank >= 4 ? colorWin : colorLose; - } } @@ -887,13 +889,15 @@ private void SetDamageRateCombined( int[] hp, BattleData bd ) { int countEnemy = ( bdc.EnemyFleetMembers.Skip( 1 ).Count( v => v != -1 ) ); int sunkFriend = hp.Take( countFriend ).Count( v => v <= 0 ) + hp.Skip( 12 ).Take( countFriendCombined ).Count( v => v <= 0 ); int sunkEnemy = hp.Skip( 6 ).Take( countEnemy ).Count( v => v <= 0 ); - int rank = CalcRank(countFriend + countFriendCombined, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, (hp[6] <= 0)); + + int rank = GetWinRank( countFriend + countFriendCombined, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, hp[6] <= 0 ); + Color colorWin = SystemColors.WindowText; Color colorLose = Color.Red; + DamageRate.Text = Constants.GetWinRank( rank ); DamageRate.ForeColor = rank >= 4 ? colorWin : colorLose; - } } @@ -1024,12 +1028,12 @@ private void TableBottom_CellPaint( object sender, TableLayoutCellPaintEventArgs e.Graphics.DrawLine( Pens.Silver, e.CellBounds.X, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1 ); } - + protected override string GetPersistString() { return "Battle"; } - + } } From 986c4a2f55314dd188d7f416365daf8ffdebb8db Mon Sep 17 00:00:00 2001 From: andanteyk Date: Wed, 11 Mar 2015 00:01:28 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E5=90=84=E7=A8=AE=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=E3=83=BB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・グループ窓「ステータスバーを表示」設定追加 ・グループ窓「自動更新」設定が保存されない不具合修正 ・羅針盤窓:夜戦時に色が変わるよう変更 --- .../Other/Information/apilist.txt | 4 +- .../Other/Information/kcmemo.md | 20 +- ElectronicObserver/Utility/Configuration.cs | 6 + .../Utility/SoftwareInformation.cs | 6 +- .../Dialog/DialogConfiguration.Designer.cs | 336 ++++++++++-------- .../Window/Dialog/DialogConfiguration.cs | 12 + .../Window/Dialog/DialogConfiguration.resx | 3 - .../Window/Dialog/DialogNotifier.cs | 4 +- .../Window/FormBattle.Designer.cs | 160 ++++----- ElectronicObserver/Window/FormBattle.cs | 26 +- ElectronicObserver/Window/FormCompass.cs | 19 +- .../Window/FormShipGroup.Designer.cs | 87 +++-- ElectronicObserver/Window/FormShipGroup.cs | 27 +- 13 files changed, 400 insertions(+), 310 deletions(-) diff --git a/ElectronicObserver/Other/Information/apilist.txt b/ElectronicObserver/Other/Information/apilist.txt index 3b34daf6e..46927f300 100644 --- a/ElectronicObserver/Other/Information/apilist.txt +++ b/ElectronicObserver/Other/Information/apilist.txt @@ -331,7 +331,7 @@ api_start2 :艦娘・装備固有データその他 (夏イベ時)通常海域, MI海域は[ 0, 1 ], AL海域, 本土防衛は[ 1, 0 ] (2014/09現在)すべて[ 1, 0 ] (秋イベ時)通常海域/E-2は[ 1, 0 ]、E-1/3は[ 0, 2 ], E-4は[ 0, 3 ] - { 通常艦隊出撃フラグ, 連合機動部隊出撃フラグ } と予想(それぞれビットフラグ) + { 通常艦隊出撃フラグ, 連合艦隊出撃フラグ } と予想(それぞれビットフラグ) api_mst_mapbgm :海域BGMデータ api_id :海域ID @@ -1531,7 +1531,7 @@ api_req_furniture/set_portbgm :母港BGM設定 Request.api_req_member/itemuse_cond :給糧艦使用 - api_use_type :使用する給糧艦 1=間宮, 2=伊良湖 + api_use_type :使用する給糧艦 1=間宮, 2=伊良湖, 3=間宮&伊良湖 api_deck_id :艦隊番号 api_req_member/itemuse_cond :給糧艦使用 diff --git a/ElectronicObserver/Other/Information/kcmemo.md b/ElectronicObserver/Other/Information/kcmemo.md index a688c1ba0..f5b254863 100644 --- a/ElectronicObserver/Other/Information/kcmemo.md +++ b/ElectronicObserver/Other/Information/kcmemo.md @@ -5,7 +5,6 @@ 2000≦price<20000 とくに特別なフラグはない。 - #### ケッコンカッコカリ後の耐久値 ケッコン前の最大耐久値及び「最大耐久値の最大値」にのみ依存する。艦種や艦型、ケッコンのタイミングなどの影響は受けない。 @@ -33,10 +32,10 @@ value = min + int( ( max - min ) * Lv / 99 ) なお、改装時の4種パラメータは、 ``` -value = min + ceil( ( max - min ) * 0.8 * Lv / 99 / ( 1 or 2 ) ) +value = min + ceil( ( max - min ) * ( 0.4 or 0.8 ) * Lv / 99 ) ``` -で求められる(1 or 2はランダム)。 +で求められる(0.4 or 0.8 はランダム)。 #### 季節の衣替え艦娘 クリスマス・年末・正月に衣装替えした艦娘のデータは ID 901 以降に保存されており、図鑑からのみ参照できる。 @@ -78,8 +77,9 @@ value = min + ceil( ( max - min ) * 0.8 * Lv / 99 / ( 1 or 2 ) ) #### ダメージ処理 実際の状態にかかわらず、15未満だと常に非クリティカル, 40以上だと常にクリティカルとして表示される。 +ちなみに、「命中したが0ダメージ」という状況も存在する。 実際に出せるかはさておき、表示上の最大値は9999。 -また、「かばう」が発動した場合は 0.1 がフラグとして加算される。 +また、「かばう」が発動した場合は 0.1 がフラグとして加算される(もちろん実ダメージには影響しない)。 #### ダメコン処理の優先度 ダメコンの種類にかかわらず、スロットの上にあるほうから使われる。   @@ -154,7 +154,9 @@ else if ( 攻撃側 == ( 軽空母 | 正規空母 | 装甲空母 ) ) 攻撃種 else if ( 防御側 == ( 潜水艦 | 潜水空母 ) ) { if ( 攻撃側 == ( 航空巡洋艦 | 航空戦艦 | 水上機母艦 | 揚陸艦 ) ) 攻撃種別 = 7(空撃); else 攻撃種別 = 8(爆雷攻撃); -} else if ( 最初の表示装備(api_si_list)のカテゴリ == 魚雷 ) 攻撃種別 = 9(雷撃); +} +else if ( 最初の表示装備(api_si_list)のカテゴリ == 魚雷 ) 攻撃種別 = 9(雷撃); +else 攻撃種別 = 0(砲撃); ``` ``` @@ -183,7 +185,7 @@ else 攻撃種別 = 0(砲撃); * 8:高角砲+高射装置/電探 * 9:高角砲/高射装置 -この優先度で判定される?なお、1-3は秋月(改)専用。 +(個艦については)この優先度で判定される?なお、1-3は秋月(改)専用。 #### 敵ボイス `areaID` `mapNo` `index` `shipID` @@ -328,8 +330,8 @@ C敗北判定の 敵損害率 >= 50 は試験実装。 #### 猫った時のAPIレスポンス 練習巡洋艦旗艦で開発すると落ちる不具合を利用したもの。(2015/02/08) -* api_result : 100 -* api_result_msg : "申し訳ありませんがブラウザを再起動し再ログインしてください。" +* `api_result` : 100 +* `api_result_msg` : "申し訳ありませんがブラウザを再起動し再ログインしてください。" #### 特殊な装備判定 Bismarck dreiに対する魚雷装備・試製51cm連装砲の装備判定は、改装UIシステムの中で*例外的に決め打ち*されている。 @@ -404,5 +406,5 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲の装備判定は、 * デイリー開発・建造任務はカウンタが共用。2回目の操作(3回任務の1回目)を行った時点で50%になる * 東京急行遠征任務も共用。7回とあるが6回でok * 輸送船5隻の変則デイリーと輸送船3隻のデイリーはカウンタが干渉。1隻撃沈で2増える -* あ号作戦の「出撃」は文字通りであり、戦闘を行う必要はない(ex. 6-1) +* あ号作戦の「出撃」は文字通りであり、戦闘を行う必要はない(ex. 6-1で戦艦2を含めて即帰投しても増える) diff --git a/ElectronicObserver/Utility/Configuration.cs b/ElectronicObserver/Utility/Configuration.cs index 7177fe5c1..aa9a3a17e 100644 --- a/ElectronicObserver/Utility/Configuration.cs +++ b/ElectronicObserver/Utility/Configuration.cs @@ -410,8 +410,14 @@ public class ConfigFormShipGroup : ConfigPartBase { public int SplitterDistance { get; set; } + public bool AutoUpdate { get; set; } + + public bool ShowStatusBar { get; set; } + public ConfigFormShipGroup() { SplitterDistance = 40; + AutoUpdate = true; + ShowStatusBar = true; } } /// [艦船グループ]ウィンドウ diff --git a/ElectronicObserver/Utility/SoftwareInformation.cs b/ElectronicObserver/Utility/SoftwareInformation.cs index c77971490..c7e486073 100644 --- a/ElectronicObserver/Utility/SoftwareInformation.cs +++ b/ElectronicObserver/Utility/SoftwareInformation.cs @@ -35,7 +35,7 @@ public static string SoftwareNameEnglish { /// public static string VersionJapanese { get { - return SoftwareNameJapanese + "一〇型"; + return SoftwareNameJapanese + "一〇型改"; } } @@ -44,7 +44,7 @@ public static string VersionJapanese { /// public static string VersionEnglish { get { - return "1.0.0"; + return "1.0.1"; } } @@ -54,7 +54,7 @@ public static string VersionEnglish { /// public static DateTime UpdateTime { get { - return DateTimeHelper.CSVStringToTime( "2015/03/04 20:00:00" ); + return DateTimeHelper.CSVStringToTime( "2015/03/10 00:00:00" ); } } diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs index e5161918d..7dcdb12a0 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs @@ -94,6 +94,16 @@ private void InitializeComponent() { this.FormQuest_ShowDaily = new System.Windows.Forms.CheckBox(); this.FormQuest_ShowOnce = new System.Windows.Forms.CheckBox(); this.FormQuest_ShowRunningOnly = new System.Windows.Forms.CheckBox(); + this.tabPage12 = new System.Windows.Forms.TabPage(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.FormBrowser_ScreenShotFormat_PNG = new System.Windows.Forms.RadioButton(); + this.FormBrowser_ScreenShotFormat_JPEG = new System.Windows.Forms.RadioButton(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.FormBrowser_IsEnabled = new System.Windows.Forms.CheckBox(); + this.FormBrowser_LogInPageURL = new System.Windows.Forms.TextBox(); + this.FormBrowser_ZoomRate = new System.Windows.Forms.NumericUpDown(); + this.label15 = new System.Windows.Forms.Label(); this.tabPage11 = new System.Windows.Forms.TabPage(); this.label10 = new System.Windows.Forms.Label(); this.Notification_Damage = new System.Windows.Forms.Button(); @@ -108,16 +118,9 @@ private void InitializeComponent() { this.FontSelector = new System.Windows.Forms.FontDialog(); this.LayoutFileBrowser = new System.Windows.Forms.OpenFileDialog(); this.APIListBrowser = new System.Windows.Forms.OpenFileDialog(); - this.tabPage12 = new System.Windows.Forms.TabPage(); - this.label15 = new System.Windows.Forms.Label(); - this.FormBrowser_ZoomRate = new System.Windows.Forms.NumericUpDown(); - this.FormBrowser_LogInPageURL = new System.Windows.Forms.TextBox(); - this.FormBrowser_IsEnabled = new System.Windows.Forms.CheckBox(); - this.label16 = new System.Windows.Forms.Label(); - this.label17 = new System.Windows.Forms.Label(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.FormBrowser_ScreenShotFormat_JPEG = new System.Windows.Forms.RadioButton(); - this.FormBrowser_ScreenShotFormat_PNG = new System.Windows.Forms.RadioButton(); + this.tabPage13 = new System.Windows.Forms.TabPage(); + this.FormShipGroup_AutoUpdate = new System.Windows.Forms.CheckBox(); + this.FormShipGroup_ShowStatusBar = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Connection_UpstreamProxyPort)).BeginInit(); @@ -137,10 +140,11 @@ private void InitializeComponent() { this.tabPage9.SuspendLayout(); this.tabPage10.SuspendLayout(); this.groupBox1.SuspendLayout(); - this.tabPage11.SuspendLayout(); this.tabPage12.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.FormBrowser_ZoomRate)).BeginInit(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.FormBrowser_ZoomRate)).BeginInit(); + this.tabPage11.SuspendLayout(); + this.tabPage13.SuspendLayout(); this.SuspendLayout(); // // tabControl1 @@ -413,10 +417,10 @@ private void InitializeComponent() { this.tabPage2.Controls.Add(this.UI_MainFontSelect); this.tabPage2.Controls.Add(this.UI_MainFont); this.tabPage2.Controls.Add(this.label5); - this.tabPage2.Location = new System.Drawing.Point(4, 44); + this.tabPage2.Location = new System.Drawing.Point(4, 24); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(392, 211); + this.tabPage2.Size = new System.Drawing.Size(392, 231); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "UI"; this.tabPage2.UseVisualStyleBackColor = true; @@ -449,7 +453,7 @@ private void InitializeComponent() { // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(3, 171); + this.label9.Location = new System.Drawing.Point(3, 169); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(146, 15); this.label9.TabIndex = 8; @@ -614,10 +618,10 @@ private void InitializeComponent() { // this.tabPage4.Controls.Add(this.Control_ConditionBorder); this.tabPage4.Controls.Add(this.label7); - this.tabPage4.Location = new System.Drawing.Point(4, 44); + this.tabPage4.Location = new System.Drawing.Point(4, 24); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(3); - this.tabPage4.Size = new System.Drawing.Size(392, 211); + this.tabPage4.Size = new System.Drawing.Size(392, 231); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "動作"; this.tabPage4.UseVisualStyleBackColor = true; @@ -649,10 +653,10 @@ private void InitializeComponent() { // this.tabPage5.Controls.Add(this.Debug_SealingPanel); this.tabPage5.Controls.Add(this.Debug_EnableDebugMenu); - this.tabPage5.Location = new System.Drawing.Point(4, 44); + this.tabPage5.Location = new System.Drawing.Point(4, 24); this.tabPage5.Name = "tabPage5"; this.tabPage5.Padding = new System.Windows.Forms.Padding(3); - this.tabPage5.Size = new System.Drawing.Size(392, 211); + this.tabPage5.Size = new System.Drawing.Size(392, 231); this.tabPage5.TabIndex = 4; this.tabPage5.Text = "デバッグ"; this.tabPage5.UseVisualStyleBackColor = true; @@ -667,7 +671,7 @@ private void InitializeComponent() { this.Debug_SealingPanel.Controls.Add(this.Debug_APIListPathSearch); this.Debug_SealingPanel.Location = new System.Drawing.Point(0, 31); this.Debug_SealingPanel.Name = "Debug_SealingPanel"; - this.Debug_SealingPanel.Size = new System.Drawing.Size(392, 136); + this.Debug_SealingPanel.Size = new System.Drawing.Size(392, 134); this.Debug_SealingPanel.TabIndex = 7; // // Debug_APIListPath @@ -723,10 +727,10 @@ private void InitializeComponent() { this.tabPage6.Controls.Add(this.label14); this.tabPage6.Controls.Add(this.Life_TopMost); this.tabPage6.Controls.Add(this.Life_ConfirmOnClosing); - this.tabPage6.Location = new System.Drawing.Point(4, 44); + this.tabPage6.Location = new System.Drawing.Point(4, 24); this.tabPage6.Name = "tabPage6"; this.tabPage6.Padding = new System.Windows.Forms.Padding(3); - this.tabPage6.Size = new System.Drawing.Size(392, 211); + this.tabPage6.Size = new System.Drawing.Size(392, 231); this.tabPage6.TabIndex = 5; this.tabPage6.Text = "ウィンドウ"; this.tabPage6.UseVisualStyleBackColor = true; @@ -803,6 +807,7 @@ private void InitializeComponent() { this.tabControl2.Controls.Add(this.tabPage8); this.tabControl2.Controls.Add(this.tabPage9); this.tabControl2.Controls.Add(this.tabPage10); + this.tabControl2.Controls.Add(this.tabPage13); this.tabControl2.Controls.Add(this.tabPage12); this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl2.Location = new System.Drawing.Point(3, 3); @@ -858,10 +863,10 @@ private void InitializeComponent() { // tabPage9 // this.tabPage9.Controls.Add(this.FormArsenal_ShowShipName); - this.tabPage9.Location = new System.Drawing.Point(4, 22); + this.tabPage9.Location = new System.Drawing.Point(4, 24); this.tabPage9.Name = "tabPage9"; this.tabPage9.Padding = new System.Windows.Forms.Padding(3); - this.tabPage9.Size = new System.Drawing.Size(378, 179); + this.tabPage9.Size = new System.Drawing.Size(378, 177); this.tabPage9.TabIndex = 1; this.tabPage9.Text = "工廠"; this.tabPage9.UseVisualStyleBackColor = true; @@ -951,6 +956,125 @@ private void InitializeComponent() { this.FormQuest_ShowRunningOnly.Text = "遂行中のみ表示する"; this.FormQuest_ShowRunningOnly.UseVisualStyleBackColor = true; // + // tabPage12 + // + this.tabPage12.Controls.Add(this.groupBox2); + this.tabPage12.Controls.Add(this.label17); + this.tabPage12.Controls.Add(this.label16); + this.tabPage12.Controls.Add(this.FormBrowser_IsEnabled); + this.tabPage12.Controls.Add(this.FormBrowser_LogInPageURL); + this.tabPage12.Controls.Add(this.FormBrowser_ZoomRate); + this.tabPage12.Controls.Add(this.label15); + this.tabPage12.Location = new System.Drawing.Point(4, 24); + this.tabPage12.Name = "tabPage12"; + this.tabPage12.Padding = new System.Windows.Forms.Padding(3); + this.tabPage12.Size = new System.Drawing.Size(378, 177); + this.tabPage12.TabIndex = 3; + this.tabPage12.Text = "ブラウザ"; + this.tabPage12.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.FormBrowser_ScreenShotFormat_PNG); + this.groupBox2.Controls.Add(this.FormBrowser_ScreenShotFormat_JPEG); + this.groupBox2.Location = new System.Drawing.Point(6, 88); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(136, 51); + this.groupBox2.TabIndex = 6; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "スクリーンショットの形式"; + // + // FormBrowser_ScreenShotFormat_PNG + // + this.FormBrowser_ScreenShotFormat_PNG.AutoSize = true; + this.FormBrowser_ScreenShotFormat_PNG.Location = new System.Drawing.Point(65, 22); + this.FormBrowser_ScreenShotFormat_PNG.Name = "FormBrowser_ScreenShotFormat_PNG"; + this.FormBrowser_ScreenShotFormat_PNG.Size = new System.Drawing.Size(50, 19); + this.FormBrowser_ScreenShotFormat_PNG.TabIndex = 1; + this.FormBrowser_ScreenShotFormat_PNG.TabStop = true; + this.FormBrowser_ScreenShotFormat_PNG.Text = "PNG"; + this.FormBrowser_ScreenShotFormat_PNG.UseVisualStyleBackColor = true; + // + // FormBrowser_ScreenShotFormat_JPEG + // + this.FormBrowser_ScreenShotFormat_JPEG.AutoSize = true; + this.FormBrowser_ScreenShotFormat_JPEG.Location = new System.Drawing.Point(6, 22); + this.FormBrowser_ScreenShotFormat_JPEG.Name = "FormBrowser_ScreenShotFormat_JPEG"; + this.FormBrowser_ScreenShotFormat_JPEG.Size = new System.Drawing.Size(53, 19); + this.FormBrowser_ScreenShotFormat_JPEG.TabIndex = 0; + this.FormBrowser_ScreenShotFormat_JPEG.TabStop = true; + this.FormBrowser_ScreenShotFormat_JPEG.Text = "JPEG"; + this.FormBrowser_ScreenShotFormat_JPEG.UseVisualStyleBackColor = true; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(6, 62); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(72, 15); + this.label17.TabIndex = 5; + this.label17.Text = "ログインURL:"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(148, 32); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(19, 15); + this.label16.TabIndex = 4; + this.label16.Text = "%"; + // + // FormBrowser_IsEnabled + // + this.FormBrowser_IsEnabled.AutoSize = true; + this.FormBrowser_IsEnabled.Location = new System.Drawing.Point(6, 6); + this.FormBrowser_IsEnabled.Name = "FormBrowser_IsEnabled"; + this.FormBrowser_IsEnabled.Size = new System.Drawing.Size(78, 19); + this.FormBrowser_IsEnabled.TabIndex = 3; + this.FormBrowser_IsEnabled.Text = "有効にする"; + this.FormBrowser_IsEnabled.UseVisualStyleBackColor = true; + // + // FormBrowser_LogInPageURL + // + this.FormBrowser_LogInPageURL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.FormBrowser_LogInPageURL.Location = new System.Drawing.Point(82, 59); + this.FormBrowser_LogInPageURL.Name = "FormBrowser_LogInPageURL"; + this.FormBrowser_LogInPageURL.Size = new System.Drawing.Size(290, 23); + this.FormBrowser_LogInPageURL.TabIndex = 2; + // + // FormBrowser_ZoomRate + // + this.FormBrowser_ZoomRate.Location = new System.Drawing.Point(82, 30); + this.FormBrowser_ZoomRate.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.FormBrowser_ZoomRate.Minimum = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.FormBrowser_ZoomRate.Name = "FormBrowser_ZoomRate"; + this.FormBrowser_ZoomRate.Size = new System.Drawing.Size(60, 23); + this.FormBrowser_ZoomRate.TabIndex = 1; + this.FormBrowser_ZoomRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.FormBrowser_ZoomRate.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(6, 32); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(73, 15); + this.label15.TabIndex = 0; + this.label15.Text = "ズーム倍率:"; + // // tabPage11 // this.tabPage11.Controls.Add(this.label10); @@ -971,7 +1095,7 @@ private void InitializeComponent() { // this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(3, 171); + this.label10.Location = new System.Drawing.Point(3, 149); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(238, 15); this.label10.TabIndex = 5; @@ -1074,124 +1198,39 @@ private void InitializeComponent() { this.APIListBrowser.Filter = "Text File|*.txt|File|*"; this.APIListBrowser.Title = "API リストを開く"; // - // tabPage12 - // - this.tabPage12.Controls.Add(this.groupBox2); - this.tabPage12.Controls.Add(this.label17); - this.tabPage12.Controls.Add(this.label16); - this.tabPage12.Controls.Add(this.FormBrowser_IsEnabled); - this.tabPage12.Controls.Add(this.FormBrowser_LogInPageURL); - this.tabPage12.Controls.Add(this.FormBrowser_ZoomRate); - this.tabPage12.Controls.Add(this.label15); - this.tabPage12.Location = new System.Drawing.Point(4, 24); - this.tabPage12.Name = "tabPage12"; - this.tabPage12.Padding = new System.Windows.Forms.Padding(3); - this.tabPage12.Size = new System.Drawing.Size(378, 177); - this.tabPage12.TabIndex = 3; - this.tabPage12.Text = "ブラウザ"; - this.tabPage12.UseVisualStyleBackColor = true; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(6, 32); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(73, 15); - this.label15.TabIndex = 0; - this.label15.Text = "ズーム倍率:"; - // - // FormBrowser_ZoomRate - // - this.FormBrowser_ZoomRate.Location = new System.Drawing.Point(82, 30); - this.FormBrowser_ZoomRate.Maximum = new decimal(new int[] { - 1000, - 0, - 0, - 0}); - this.FormBrowser_ZoomRate.Minimum = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.FormBrowser_ZoomRate.Name = "FormBrowser_ZoomRate"; - this.FormBrowser_ZoomRate.Size = new System.Drawing.Size(60, 23); - this.FormBrowser_ZoomRate.TabIndex = 1; - this.FormBrowser_ZoomRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.FormBrowser_ZoomRate.Value = new decimal(new int[] { - 10, - 0, - 0, - 0}); - // - // FormBrowser_LogInPageURL - // - this.FormBrowser_LogInPageURL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.FormBrowser_LogInPageURL.Location = new System.Drawing.Point(82, 59); - this.FormBrowser_LogInPageURL.Name = "FormBrowser_LogInPageURL"; - this.FormBrowser_LogInPageURL.Size = new System.Drawing.Size(290, 23); - this.FormBrowser_LogInPageURL.TabIndex = 2; - // - // FormBrowser_IsEnabled - // - this.FormBrowser_IsEnabled.AutoSize = true; - this.FormBrowser_IsEnabled.Location = new System.Drawing.Point(6, 6); - this.FormBrowser_IsEnabled.Name = "FormBrowser_IsEnabled"; - this.FormBrowser_IsEnabled.Size = new System.Drawing.Size(78, 19); - this.FormBrowser_IsEnabled.TabIndex = 3; - this.FormBrowser_IsEnabled.Text = "有効にする"; - this.FormBrowser_IsEnabled.UseVisualStyleBackColor = true; - // - // label16 - // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(148, 32); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(19, 15); - this.label16.TabIndex = 4; - this.label16.Text = "%"; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(6, 62); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(72, 15); - this.label17.TabIndex = 5; - this.label17.Text = "ログインURL:"; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.FormBrowser_ScreenShotFormat_PNG); - this.groupBox2.Controls.Add(this.FormBrowser_ScreenShotFormat_JPEG); - this.groupBox2.Location = new System.Drawing.Point(6, 88); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(136, 51); - this.groupBox2.TabIndex = 6; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "スクリーンショットの形式"; - // - // FormBrowser_ScreenShotFormat_JPEG - // - this.FormBrowser_ScreenShotFormat_JPEG.AutoSize = true; - this.FormBrowser_ScreenShotFormat_JPEG.Location = new System.Drawing.Point(6, 22); - this.FormBrowser_ScreenShotFormat_JPEG.Name = "FormBrowser_ScreenShotFormat_JPEG"; - this.FormBrowser_ScreenShotFormat_JPEG.Size = new System.Drawing.Size(53, 19); - this.FormBrowser_ScreenShotFormat_JPEG.TabIndex = 0; - this.FormBrowser_ScreenShotFormat_JPEG.TabStop = true; - this.FormBrowser_ScreenShotFormat_JPEG.Text = "JPEG"; - this.FormBrowser_ScreenShotFormat_JPEG.UseVisualStyleBackColor = true; - // - // FormBrowser_ScreenShotFormat_PNG - // - this.FormBrowser_ScreenShotFormat_PNG.AutoSize = true; - this.FormBrowser_ScreenShotFormat_PNG.Location = new System.Drawing.Point(65, 22); - this.FormBrowser_ScreenShotFormat_PNG.Name = "FormBrowser_ScreenShotFormat_PNG"; - this.FormBrowser_ScreenShotFormat_PNG.Size = new System.Drawing.Size(50, 19); - this.FormBrowser_ScreenShotFormat_PNG.TabIndex = 1; - this.FormBrowser_ScreenShotFormat_PNG.TabStop = true; - this.FormBrowser_ScreenShotFormat_PNG.Text = "PNG"; - this.FormBrowser_ScreenShotFormat_PNG.UseVisualStyleBackColor = true; + // tabPage13 + // + this.tabPage13.Controls.Add(this.FormShipGroup_ShowStatusBar); + this.tabPage13.Controls.Add(this.FormShipGroup_AutoUpdate); + this.tabPage13.Location = new System.Drawing.Point(4, 24); + this.tabPage13.Name = "tabPage13"; + this.tabPage13.Padding = new System.Windows.Forms.Padding(3); + this.tabPage13.Size = new System.Drawing.Size(378, 177); + this.tabPage13.TabIndex = 4; + this.tabPage13.Text = "グループ"; + this.tabPage13.UseVisualStyleBackColor = true; + // + // FormShipGroup_AutoUpdate + // + this.FormShipGroup_AutoUpdate.AutoSize = true; + this.FormShipGroup_AutoUpdate.Location = new System.Drawing.Point(6, 6); + this.FormShipGroup_AutoUpdate.Name = "FormShipGroup_AutoUpdate"; + this.FormShipGroup_AutoUpdate.Size = new System.Drawing.Size(93, 19); + this.FormShipGroup_AutoUpdate.TabIndex = 1; + this.FormShipGroup_AutoUpdate.Text = "自動更新する"; + this.ToolTipInfo.SetToolTip(this.FormShipGroup_AutoUpdate, "艦船データを自動更新するかを指定します。\r\n"); + this.FormShipGroup_AutoUpdate.UseVisualStyleBackColor = true; + // + // FormShipGroup_ShowStatusBar + // + this.FormShipGroup_ShowStatusBar.AutoSize = true; + this.FormShipGroup_ShowStatusBar.Location = new System.Drawing.Point(6, 31); + this.FormShipGroup_ShowStatusBar.Name = "FormShipGroup_ShowStatusBar"; + this.FormShipGroup_ShowStatusBar.Size = new System.Drawing.Size(143, 19); + this.FormShipGroup_ShowStatusBar.TabIndex = 2; + this.FormShipGroup_ShowStatusBar.Text = "ステータスバーを表示する"; + this.ToolTipInfo.SetToolTip(this.FormShipGroup_ShowStatusBar, "下部のステータスバー(所属艦数など)を表示するかを指定します。\r\nわずかですが表示行数を増やすことができます。"); + this.FormShipGroup_ShowStatusBar.UseVisualStyleBackColor = true; // // DialogConfiguration // @@ -1242,13 +1281,15 @@ private void InitializeComponent() { this.tabPage10.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); - this.tabPage11.ResumeLayout(false); - this.tabPage11.PerformLayout(); this.tabPage12.ResumeLayout(false); this.tabPage12.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.FormBrowser_ZoomRate)).EndInit(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.FormBrowser_ZoomRate)).EndInit(); + this.tabPage11.ResumeLayout(false); + this.tabPage11.PerformLayout(); + this.tabPage13.ResumeLayout(false); + this.tabPage13.PerformLayout(); this.ResumeLayout(false); } @@ -1349,5 +1390,8 @@ private void InitializeComponent() { private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.RadioButton FormBrowser_ScreenShotFormat_PNG; private System.Windows.Forms.RadioButton FormBrowser_ScreenShotFormat_JPEG; + private System.Windows.Forms.TabPage tabPage13; + private System.Windows.Forms.CheckBox FormShipGroup_AutoUpdate; + private System.Windows.Forms.CheckBox FormShipGroup_ShowStatusBar; } } \ No newline at end of file diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs index 7bcc5e001..02dfaaa47 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs @@ -281,13 +281,19 @@ public void FromConfiguration( Configuration.ConfigurationData config ) { //[サブウィンドウ] FormArsenal_ShowShipName.Checked = config.FormArsenal.ShowShipName; + FormFleet_ShowAircraft.Checked = config.FormFleet.ShowAircraft; FormFleet_SearchingAbilityMethod.SelectedIndex = config.FormFleet.SearchingAbilityMethod; + FormQuest_ShowRunningOnly.Checked = config.FormQuest.ShowRunningOnly; FormQuest_ShowOnce.Checked = config.FormQuest.ShowOnce; FormQuest_ShowDaily.Checked = config.FormQuest.ShowDaily; FormQuest_ShowWeekly.Checked = config.FormQuest.ShowWeekly; FormQuest_ShowMonthly.Checked = config.FormQuest.ShowMonthly; + + FormShipGroup_AutoUpdate.Checked = config.FormShipGroup.AutoUpdate; + FormShipGroup_ShowStatusBar.Checked = config.FormShipGroup.ShowStatusBar; + FormBrowser_IsEnabled.Checked = config.FormBrowser.IsEnabled; FormBrowser_ZoomRate.Value = config.FormBrowser.ZoomRate; FormBrowser_LogInPageURL.Text = config.FormBrowser.LogInPageURL; @@ -359,13 +365,19 @@ public void ToConfiguration( Configuration.ConfigurationData config ) { //[サブウィンドウ] config.FormArsenal.ShowShipName = FormArsenal_ShowShipName.Checked; + config.FormFleet.ShowAircraft = FormFleet_ShowAircraft.Checked; config.FormFleet.SearchingAbilityMethod = FormFleet_SearchingAbilityMethod.SelectedIndex; + config.FormQuest.ShowRunningOnly = FormQuest_ShowRunningOnly.Checked; config.FormQuest.ShowOnce = FormQuest_ShowOnce.Checked; config.FormQuest.ShowDaily = FormQuest_ShowDaily.Checked; config.FormQuest.ShowWeekly = FormQuest_ShowWeekly.Checked; config.FormQuest.ShowMonthly = FormQuest_ShowMonthly.Checked; + + config.FormShipGroup.AutoUpdate = FormShipGroup_AutoUpdate.Checked; + config.FormShipGroup.ShowStatusBar = FormShipGroup_ShowStatusBar.Checked; + config.FormBrowser.IsEnabled = FormBrowser_IsEnabled.Checked; config.FormBrowser.ZoomRate = (int)FormBrowser_ZoomRate.Value; config.FormBrowser.LogInPageURL = FormBrowser_LogInPageURL.Text; diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.resx b/ElectronicObserver/Window/Dialog/DialogConfiguration.resx index 6e1d76b01..89dfd48da 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.resx +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.resx @@ -120,9 +120,6 @@ 17, 17 - - 17, 17 - 137, 17 diff --git a/ElectronicObserver/Window/Dialog/DialogNotifier.cs b/ElectronicObserver/Window/Dialog/DialogNotifier.cs index 3353d8c9c..fc9bcae39 100644 --- a/ElectronicObserver/Window/Dialog/DialogNotifier.cs +++ b/ElectronicObserver/Window/Dialog/DialogNotifier.cs @@ -21,10 +21,10 @@ public partial class DialogNotifier : Form { public DialogNotifier( NotifierDialogData data ) { - DialogData = data.Clone(); - InitializeComponent(); + DialogData = data.Clone(); + Text = DialogData.Title; Font = Utility.Configuration.Config.UI.MainFont; Icon = Resource.ResourceManager.Instance.AppIcon; diff --git a/ElectronicObserver/Window/FormBattle.Designer.cs b/ElectronicObserver/Window/FormBattle.Designer.cs index 8d13e43a6..17a8fd6ad 100644 --- a/ElectronicObserver/Window/FormBattle.Designer.cs +++ b/ElectronicObserver/Window/FormBattle.Designer.cs @@ -25,12 +25,6 @@ protected override void Dispose( bool disposing ) { private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.TableBottom = new System.Windows.Forms.TableLayoutPanel(); - this.FleetFriend = new ElectronicObserver.Window.Control.ImageLabel(); - this.DamageFriend = new ElectronicObserver.Window.Control.ImageLabel(); - this.DamageRate = new ElectronicObserver.Window.Control.ImageLabel(); - this.DamageEnemy = new ElectronicObserver.Window.Control.ImageLabel(); - this.FleetCombined = new ElectronicObserver.Window.Control.ImageLabel(); - this.FleetEnemy = new ElectronicObserver.Window.Control.ImageLabel(); this.ToolTipInfo = new System.Windows.Forms.ToolTip(this.components); this.BaseLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); this.TableTop = new System.Windows.Forms.TableLayoutPanel(); @@ -46,6 +40,12 @@ private void InitializeComponent() { this.AirStage1Friend = new ElectronicObserver.Window.Control.ImageLabel(); this.SearchingEnemy = new ElectronicObserver.Window.Control.ImageLabel(); this.AirSuperiority = new ElectronicObserver.Window.Control.ImageLabel(); + this.FleetFriend = new ElectronicObserver.Window.Control.ImageLabel(); + this.DamageFriend = new ElectronicObserver.Window.Control.ImageLabel(); + this.WinRank = new ElectronicObserver.Window.Control.ImageLabel(); + this.DamageEnemy = new ElectronicObserver.Window.Control.ImageLabel(); + this.FleetCombined = new ElectronicObserver.Window.Control.ImageLabel(); + this.FleetEnemy = new ElectronicObserver.Window.Control.ImageLabel(); this.TableBottom.SuspendLayout(); this.BaseLayoutPanel.SuspendLayout(); this.TableTop.SuspendLayout(); @@ -60,7 +60,7 @@ private void InitializeComponent() { this.TableBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 84F)); this.TableBottom.Controls.Add(this.FleetFriend, 0, 0); this.TableBottom.Controls.Add(this.DamageFriend, 0, 7); - this.TableBottom.Controls.Add(this.DamageRate, 1, 7); + this.TableBottom.Controls.Add(this.WinRank, 1, 7); this.TableBottom.Controls.Add(this.DamageEnemy, 2, 7); this.TableBottom.Controls.Add(this.FleetCombined, 1, 0); this.TableBottom.Controls.Add(this.FleetEnemy, 2, 0); @@ -84,78 +84,6 @@ private void InitializeComponent() { this.TableBottom.TabIndex = 1; this.TableBottom.CellPaint += new System.Windows.Forms.TableLayoutCellPaintEventHandler(this.TableBottom_CellPaint); // - // FleetFriend - // - this.FleetFriend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.FleetFriend.BackColor = System.Drawing.Color.Transparent; - this.FleetFriend.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.FleetFriend.Location = new System.Drawing.Point(3, 3); - this.FleetFriend.Name = "FleetFriend"; - this.FleetFriend.Size = new System.Drawing.Size(78, 15); - this.FleetFriend.TabIndex = 5; - this.FleetFriend.Text = "自軍艦隊"; - this.FleetFriend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // DamageFriend - // - this.DamageFriend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.DamageFriend.BackColor = System.Drawing.Color.Transparent; - this.DamageFriend.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.DamageFriend.Location = new System.Drawing.Point(3, 150); - this.DamageFriend.Name = "DamageFriend"; - this.DamageFriend.Size = new System.Drawing.Size(78, 15); - this.DamageFriend.TabIndex = 5; - this.DamageFriend.Text = "損害率"; - this.DamageFriend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // DamageRate - // - this.DamageRate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.DamageRate.BackColor = System.Drawing.Color.Transparent; - this.DamageRate.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.DamageRate.Location = new System.Drawing.Point(87, 150); - this.DamageRate.Name = "DamageRate"; - this.DamageRate.Size = new System.Drawing.Size(78, 15); - this.DamageRate.TabIndex = 14; - this.DamageRate.Text = "戦績判定"; - this.DamageRate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // DamageEnemy - // - this.DamageEnemy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.DamageEnemy.BackColor = System.Drawing.Color.Transparent; - this.DamageEnemy.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.DamageEnemy.Location = new System.Drawing.Point(171, 150); - this.DamageEnemy.Name = "DamageEnemy"; - this.DamageEnemy.Size = new System.Drawing.Size(78, 15); - this.DamageEnemy.TabIndex = 15; - this.DamageEnemy.Text = "損害率"; - this.DamageEnemy.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // FleetCombined - // - this.FleetCombined.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.FleetCombined.BackColor = System.Drawing.Color.Transparent; - this.FleetCombined.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.FleetCombined.Location = new System.Drawing.Point(87, 3); - this.FleetCombined.Name = "FleetCombined"; - this.FleetCombined.Size = new System.Drawing.Size(78, 15); - this.FleetCombined.TabIndex = 16; - this.FleetCombined.Text = "随伴艦隊"; - this.FleetCombined.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // FleetEnemy - // - this.FleetEnemy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.FleetEnemy.BackColor = System.Drawing.Color.Transparent; - this.FleetEnemy.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.FleetEnemy.Location = new System.Drawing.Point(171, 3); - this.FleetEnemy.Name = "FleetEnemy"; - this.FleetEnemy.Size = new System.Drawing.Size(78, 15); - this.FleetEnemy.TabIndex = 17; - this.FleetEnemy.Text = "敵軍艦隊"; - this.FleetEnemy.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // // ToolTipInfo // this.ToolTipInfo.AutoPopDelay = 30000; @@ -357,6 +285,78 @@ private void InitializeComponent() { this.AirSuperiority.Text = "制空権"; this.AirSuperiority.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // + // FleetFriend + // + this.FleetFriend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.FleetFriend.BackColor = System.Drawing.Color.Transparent; + this.FleetFriend.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.FleetFriend.Location = new System.Drawing.Point(3, 3); + this.FleetFriend.Name = "FleetFriend"; + this.FleetFriend.Size = new System.Drawing.Size(78, 15); + this.FleetFriend.TabIndex = 5; + this.FleetFriend.Text = "自軍艦隊"; + this.FleetFriend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // DamageFriend + // + this.DamageFriend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.DamageFriend.BackColor = System.Drawing.Color.Transparent; + this.DamageFriend.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.DamageFriend.Location = new System.Drawing.Point(3, 150); + this.DamageFriend.Name = "DamageFriend"; + this.DamageFriend.Size = new System.Drawing.Size(78, 15); + this.DamageFriend.TabIndex = 5; + this.DamageFriend.Text = "損害率"; + this.DamageFriend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // WinRank + // + this.WinRank.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.WinRank.BackColor = System.Drawing.Color.Transparent; + this.WinRank.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.WinRank.Location = new System.Drawing.Point(87, 150); + this.WinRank.Name = "WinRank"; + this.WinRank.Size = new System.Drawing.Size(78, 15); + this.WinRank.TabIndex = 14; + this.WinRank.Text = "戦績判定"; + this.WinRank.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // DamageEnemy + // + this.DamageEnemy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.DamageEnemy.BackColor = System.Drawing.Color.Transparent; + this.DamageEnemy.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.DamageEnemy.Location = new System.Drawing.Point(171, 150); + this.DamageEnemy.Name = "DamageEnemy"; + this.DamageEnemy.Size = new System.Drawing.Size(78, 15); + this.DamageEnemy.TabIndex = 15; + this.DamageEnemy.Text = "損害率"; + this.DamageEnemy.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FleetCombined + // + this.FleetCombined.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.FleetCombined.BackColor = System.Drawing.Color.Transparent; + this.FleetCombined.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.FleetCombined.Location = new System.Drawing.Point(87, 3); + this.FleetCombined.Name = "FleetCombined"; + this.FleetCombined.Size = new System.Drawing.Size(78, 15); + this.FleetCombined.TabIndex = 16; + this.FleetCombined.Text = "随伴艦隊"; + this.FleetCombined.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FleetEnemy + // + this.FleetEnemy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.FleetEnemy.BackColor = System.Drawing.Color.Transparent; + this.FleetEnemy.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.FleetEnemy.Location = new System.Drawing.Point(171, 3); + this.FleetEnemy.Name = "FleetEnemy"; + this.FleetEnemy.Size = new System.Drawing.Size(78, 15); + this.FleetEnemy.TabIndex = 17; + this.FleetEnemy.Text = "敵軍艦隊"; + this.FleetEnemy.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // FormBattle // this.AutoHidePortion = 150D; @@ -396,7 +396,7 @@ private void InitializeComponent() { private Control.ImageLabel AirStage2Enemy; private Control.ImageLabel FleetFriend; private Control.ImageLabel DamageFriend; - private Control.ImageLabel DamageRate; + private Control.ImageLabel WinRank; private Control.ImageLabel DamageEnemy; private Control.ImageLabel FleetCombined; private Control.ImageLabel FleetEnemy; diff --git a/ElectronicObserver/Window/FormBattle.cs b/ElectronicObserver/Window/FormBattle.cs index 07562f5dd..c29ad507a 100644 --- a/ElectronicObserver/Window/FormBattle.cs +++ b/ElectronicObserver/Window/FormBattle.cs @@ -19,6 +19,10 @@ namespace ElectronicObserver.Window { public partial class FormBattle : DockContent { + private readonly Color WinRankColor_Win = SystemColors.ControlText; + private readonly Color WinRankColor_Lose = Color.Red; + + private List HPBars; public Font MainFont { get; set; } @@ -750,7 +754,7 @@ private void SetHPCombined( int[] hp, BattleData bd ) { /// 敵軍損害率。 /// 敵旗艦を撃沈しているか。 /// thanks: nekopanda - private static int GetWinRank( + private static int GetWinRank( int countFriend, int countEnemy, int sunkFriend, int sunkEnemy, double friendrate, double enemyrate, @@ -758,7 +762,7 @@ private static int GetWinRank( int rifriend = (int)( friendrate * 100 ); int rienemy = (int)( enemyrate * 100 ); - + bool borderC = rienemy > ( 0.9 * rifriend ); bool borderB = rienemy > ( 2.5 * rifriend ); @@ -771,7 +775,7 @@ private static int GetWinRank( } else if ( sunkEnemy >= (int)Math.Round( countEnemy * 0.6 ) ) { // 半数以上撃破 return 5; // A - + } else if ( defeatFlagship || borderB ) { // 敵旗艦を撃沈 or 戦果ゲージが2.5倍以上 return 4; // B } @@ -842,13 +846,10 @@ private void SetDamageRateNormal( int[] hp, BattleData bd ) { int sunkEnemy = hp.Skip( 6 ).Take( countEnemy ).Count( v => v <= 0 ); int rank = GetWinRank( countFriend, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, hp[6] <= 0 ); - - Color colorWin = SystemColors.WindowText; - Color colorLose = Color.Red; - DamageRate.Text = Constants.GetWinRank( rank ); - DamageRate.ForeColor = rank >= 4 ? colorWin : colorLose; + WinRank.Text = Constants.GetWinRank( rank ); + WinRank.ForeColor = rank >= 4 ? WinRankColor_Win : WinRankColor_Lose; } } @@ -889,15 +890,12 @@ private void SetDamageRateCombined( int[] hp, BattleData bd ) { int countEnemy = ( bdc.EnemyFleetMembers.Skip( 1 ).Count( v => v != -1 ) ); int sunkFriend = hp.Take( countFriend ).Count( v => v <= 0 ) + hp.Skip( 12 ).Take( countFriendCombined ).Count( v => v <= 0 ); int sunkEnemy = hp.Skip( 6 ).Take( countEnemy ).Count( v => v <= 0 ); - + int rank = GetWinRank( countFriend + countFriendCombined, countEnemy, sunkFriend, sunkEnemy, friendrate, enemyrate, hp[6] <= 0 ); - - Color colorWin = SystemColors.WindowText; - Color colorLose = Color.Red; - DamageRate.Text = Constants.GetWinRank( rank ); - DamageRate.ForeColor = rank >= 4 ? colorWin : colorLose; + WinRank.Text = Constants.GetWinRank( rank ); + WinRank.ForeColor = rank >= 4 ? WinRankColor_Win : WinRankColor_Lose; } } diff --git a/ElectronicObserver/Window/FormCompass.cs b/ElectronicObserver/Window/FormCompass.cs index 129594ba5..b926281ec 100644 --- a/ElectronicObserver/Window/FormCompass.cs +++ b/ElectronicObserver/Window/FormCompass.cs @@ -22,7 +22,7 @@ namespace ElectronicObserver.Window { public partial class FormCompass : DockContent { - + private class TableEnemyMemberControl { public ImageLabel ShipName; @@ -332,6 +332,9 @@ private void FormCompass_Load( object sender, EventArgs e ) { private void Updated( string apiname, dynamic data ) { + Color colorNormal = SystemColors.ControlText; + Color colorNight = Color.Navy; + if ( apiname == "api_port/port" ) { BasePanel.Visible = false; @@ -342,6 +345,7 @@ private void Updated( string apiname, dynamic data ) { TextDestination.Text = string.Format( "{0} {1}", data.api_nickname, Constants.GetAdmiralRank( (int)data.api_rank ) ); TextEventKind.Text = data.api_cmt; TextEventDetail.Text = string.Format( "Lv. {0} / {1} exp.", data.api_level, data.api_experience[0] ); + TextEventDetail.ForeColor = colorNormal; TextEnemyFleetName.Text = data.api_deckname; } else { @@ -357,6 +361,7 @@ private void Updated( string apiname, dynamic data ) { { string eventkind = Constants.GetMapEventID( compass.EventID ); + switch ( compass.EventID ) { case 0: //初期位置 @@ -410,14 +415,14 @@ private void Updated( string apiname, dynamic data ) { break; case 4: //通常戦闘 - if ( compass.EventKind >= 2 ) - eventkind += "/" + Constants.GetMapEventKind( compass.EventKind ); - UpdateEnemyFleet( compass.EnemyFleetID ); - break; - case 5: //ボス戦闘 - if ( compass.EventKind >= 2 ) + if ( compass.EventKind >= 2 ) { eventkind += "/" + Constants.GetMapEventKind( compass.EventKind ); + + if ( compass.EventKind == 2 || compass.EventKind == 3 ) { + TextEventDetail.ForeColor = colorNight; break; + } + } UpdateEnemyFleet( compass.EnemyFleetID ); break; diff --git a/ElectronicObserver/Window/FormShipGroup.Designer.cs b/ElectronicObserver/Window/FormShipGroup.Designer.cs index fa82b5132..a40da65b5 100644 --- a/ElectronicObserver/Window/FormShipGroup.Designer.cs +++ b/ElectronicObserver/Window/FormShipGroup.Designer.cs @@ -24,14 +24,14 @@ protected override void Dispose( bool disposing ) { /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle58 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle55 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle56 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle57 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); this.ShipView = new System.Windows.Forms.DataGridView(); this.ShipView_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ShipView_ShipType = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -89,6 +89,7 @@ private void InitializeComponent() { this.Status_ShipCount = new System.Windows.Forms.ToolStripStatusLabel(); this.Status_LevelTotal = new System.Windows.Forms.ToolStripStatusLabel(); this.Status_LevelAverage = new System.Windows.Forms.ToolStripStatusLabel(); + this.MenuGroup_ShowStatusBar = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.ShipView)).BeginInit(); this.MenuMember.SuspendLayout(); this.MenuGroup.SuspendLayout(); @@ -141,14 +142,14 @@ private void InitializeComponent() { this.ShipView_Locked, this.ShipView_SallyArea}); this.ShipView.ContextMenuStrip = this.MenuMember; - dataGridViewCellStyle58.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; - dataGridViewCellStyle58.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle58.Font = new System.Drawing.Font("Meiryo UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); - dataGridViewCellStyle58.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle58.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle58.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle58.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.ShipView.DefaultCellStyle = dataGridViewCellStyle58; + dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; + dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle16.Font = new System.Drawing.Font("Meiryo UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); + dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.ShipView.DefaultCellStyle = dataGridViewCellStyle16; this.ShipView.Dock = System.Windows.Forms.DockStyle.Fill; this.ShipView.Location = new System.Drawing.Point(0, 0); this.ShipView.Name = "ShipView"; @@ -171,8 +172,8 @@ private void InitializeComponent() { // // ShipView_ShipType // - dataGridViewCellStyle44.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - this.ShipView_ShipType.DefaultCellStyle = dataGridViewCellStyle44; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + this.ShipView_ShipType.DefaultCellStyle = dataGridViewCellStyle9; this.ShipView_ShipType.Frozen = true; this.ShipView_ShipType.HeaderText = "艦種"; this.ShipView_ShipType.Name = "ShipView_ShipType"; @@ -181,8 +182,8 @@ private void InitializeComponent() { // // ShipView_Name // - dataGridViewCellStyle52.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - this.ShipView_Name.DefaultCellStyle = dataGridViewCellStyle52; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + this.ShipView_Name.DefaultCellStyle = dataGridViewCellStyle10; this.ShipView_Name.Frozen = true; this.ShipView_Name.HeaderText = "艦名"; this.ShipView_Name.Name = "ShipView_Name"; @@ -246,8 +247,8 @@ private void InitializeComponent() { // // ShipView_Equipment1 // - dataGridViewCellStyle53.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - this.ShipView_Equipment1.DefaultCellStyle = dataGridViewCellStyle53; + dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + this.ShipView_Equipment1.DefaultCellStyle = dataGridViewCellStyle11; this.ShipView_Equipment1.HeaderText = "装備1"; this.ShipView_Equipment1.Name = "ShipView_Equipment1"; this.ShipView_Equipment1.ReadOnly = true; @@ -256,8 +257,8 @@ private void InitializeComponent() { // // ShipView_Equipment2 // - dataGridViewCellStyle54.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - this.ShipView_Equipment2.DefaultCellStyle = dataGridViewCellStyle54; + dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + this.ShipView_Equipment2.DefaultCellStyle = dataGridViewCellStyle12; this.ShipView_Equipment2.HeaderText = "装備2"; this.ShipView_Equipment2.Name = "ShipView_Equipment2"; this.ShipView_Equipment2.ReadOnly = true; @@ -266,8 +267,8 @@ private void InitializeComponent() { // // ShipView_Equipment3 // - dataGridViewCellStyle55.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - this.ShipView_Equipment3.DefaultCellStyle = dataGridViewCellStyle55; + dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + this.ShipView_Equipment3.DefaultCellStyle = dataGridViewCellStyle13; this.ShipView_Equipment3.HeaderText = "装備3"; this.ShipView_Equipment3.Name = "ShipView_Equipment3"; this.ShipView_Equipment3.ReadOnly = true; @@ -276,8 +277,8 @@ private void InitializeComponent() { // // ShipView_Equipment4 // - dataGridViewCellStyle56.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - this.ShipView_Equipment4.DefaultCellStyle = dataGridViewCellStyle56; + dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + this.ShipView_Equipment4.DefaultCellStyle = dataGridViewCellStyle14; this.ShipView_Equipment4.HeaderText = "装備4"; this.ShipView_Equipment4.Name = "ShipView_Equipment4"; this.ShipView_Equipment4.ReadOnly = true; @@ -286,8 +287,8 @@ private void InitializeComponent() { // // ShipView_Equipment5 // - dataGridViewCellStyle57.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - this.ShipView_Equipment5.DefaultCellStyle = dataGridViewCellStyle57; + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + this.ShipView_Equipment5.DefaultCellStyle = dataGridViewCellStyle15; this.ShipView_Equipment5.HeaderText = "装備5"; this.ShipView_Equipment5.Name = "ShipView_Equipment5"; this.ShipView_Equipment5.ReadOnly = true; @@ -507,42 +508,43 @@ private void InitializeComponent() { this.MenuGroup_Rename, this.MenuGroup_Delete, this.toolStripSeparator4, - this.MenuGroup_AutoUpdate}); + this.MenuGroup_AutoUpdate, + this.MenuGroup_ShowStatusBar}); this.MenuGroup.Name = "MenuGroup"; - this.MenuGroup.Size = new System.Drawing.Size(203, 98); + this.MenuGroup.Size = new System.Drawing.Size(221, 142); this.MenuGroup.Opening += new System.ComponentModel.CancelEventHandler(this.MenuGroup_Opening); // // MenuGroup_Add // this.MenuGroup_Add.Name = "MenuGroup_Add"; - this.MenuGroup_Add.Size = new System.Drawing.Size(202, 22); + this.MenuGroup_Add.Size = new System.Drawing.Size(220, 22); this.MenuGroup_Add.Text = "グループを追加(&A)"; this.MenuGroup_Add.Click += new System.EventHandler(this.MenuGroup_Add_Click); // // MenuGroup_Rename // this.MenuGroup_Rename.Name = "MenuGroup_Rename"; - this.MenuGroup_Rename.Size = new System.Drawing.Size(202, 22); + this.MenuGroup_Rename.Size = new System.Drawing.Size(220, 22); this.MenuGroup_Rename.Text = "グループ名の変更(&R)..."; this.MenuGroup_Rename.Click += new System.EventHandler(this.MenuGroup_Rename_Click); // // MenuGroup_Delete // this.MenuGroup_Delete.Name = "MenuGroup_Delete"; - this.MenuGroup_Delete.Size = new System.Drawing.Size(202, 22); + this.MenuGroup_Delete.Size = new System.Drawing.Size(220, 22); this.MenuGroup_Delete.Text = "グループを削除(&D)"; this.MenuGroup_Delete.Click += new System.EventHandler(this.MenuGroup_Delete_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(199, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(217, 6); // // MenuGroup_AutoUpdate // this.MenuGroup_AutoUpdate.CheckOnClick = true; this.MenuGroup_AutoUpdate.Name = "MenuGroup_AutoUpdate"; - this.MenuGroup_AutoUpdate.Size = new System.Drawing.Size(202, 22); + this.MenuGroup_AutoUpdate.Size = new System.Drawing.Size(220, 22); this.MenuGroup_AutoUpdate.Text = "自動更新する"; // // splitContainer1 @@ -609,6 +611,16 @@ private void InitializeComponent() { this.Status_LevelAverage.Name = "Status_LevelAverage"; this.Status_LevelAverage.Size = new System.Drawing.Size(0, 17); // + // MenuGroup_ShowStatusBar + // + this.MenuGroup_ShowStatusBar.Checked = true; + this.MenuGroup_ShowStatusBar.CheckOnClick = true; + this.MenuGroup_ShowStatusBar.CheckState = System.Windows.Forms.CheckState.Checked; + this.MenuGroup_ShowStatusBar.Name = "MenuGroup_ShowStatusBar"; + this.MenuGroup_ShowStatusBar.Size = new System.Drawing.Size(220, 22); + this.MenuGroup_ShowStatusBar.Text = "ステータスバーを表示する"; + this.MenuGroup_ShowStatusBar.Click += new System.EventHandler(this.MenuGroup_ShowStatusBar_Click); + // // FormShipGroup // this.AutoHidePortion = 150D; @@ -695,5 +707,6 @@ private void InitializeComponent() { private System.Windows.Forms.ToolStripStatusLabel Status_ShipCount; private System.Windows.Forms.ToolStripStatusLabel Status_LevelTotal; private System.Windows.Forms.ToolStripStatusLabel Status_LevelAverage; + private System.Windows.Forms.ToolStripMenuItem MenuGroup_ShowStatusBar; } } \ No newline at end of file diff --git a/ElectronicObserver/Window/FormShipGroup.cs b/ElectronicObserver/Window/FormShipGroup.cs index 3b306fae6..024f9ab1d 100644 --- a/ElectronicObserver/Window/FormShipGroup.cs +++ b/ElectronicObserver/Window/FormShipGroup.cs @@ -52,9 +52,7 @@ public FormShipGroup( FormMain parent ) { ControlHelper.SetDoubleBuffered( ShipView ); - ConfigurationChanged(); - splitContainer1.SplitterDistance = Utility.Configuration.Config.FormShipGroup.SplitterDistance; - + foreach ( DataGridViewColumn column in ShipView.Columns ) { column.MinimumWidth = 2; } @@ -148,9 +146,10 @@ private void FormShipGroup_Load( object sender, EventArgs e ) { } } - MenuGroup_AutoUpdate.Checked = true; //checkme:未設定です - + ConfigurationChanged(); + + APIObserver o = APIObserver.Instance; APIReceivedEventHandler rec = ( string apiname, dynamic data ) => Invoke( new APIReceivedEventHandler( APIUpdated ), apiname, data ); @@ -168,7 +167,10 @@ private void FormShipGroup_Load( object sender, EventArgs e ) { void ConfigurationChanged() { ShipView.Font = StatusBar.Font = Font = Utility.Configuration.Config.UI.MainFont; - + + splitContainer1.SplitterDistance = Utility.Configuration.Config.FormShipGroup.SplitterDistance; + MenuGroup_AutoUpdate.Checked = Utility.Configuration.Config.FormShipGroup.AutoUpdate; + MenuGroup_ShowStatusBar.Checked = Utility.Configuration.Config.FormShipGroup.ShowStatusBar; } @@ -1167,6 +1169,13 @@ private void TabPanel_DragDrop( object sender, DragEventArgs e ) { + private void MenuGroup_ShowStatusBar_Click( object sender, EventArgs e ) { + + StatusBar.Visible = MenuGroup_ShowStatusBar.Checked; + + } + + void SystemShuttingDown() { ShipGroupManager groups = KCDatabase.Instance.ShipGroup; @@ -1188,7 +1197,8 @@ void SystemShuttingDown() { } Utility.Configuration.Config.FormShipGroup.SplitterDistance = splitContainer1.SplitterDistance; - + Utility.Configuration.Config.FormShipGroup.AutoUpdate = MenuGroup_AutoUpdate.Checked; + Utility.Configuration.Config.FormShipGroup.ShowStatusBar = MenuGroup_ShowStatusBar.Checked; } @@ -1196,6 +1206,9 @@ protected override string GetPersistString() { return "ShipGroup"; } + + + } From afb3b306dc2d7644214f9ecdb04d62b365c7e5a4 Mon Sep 17 00:00:00 2001 From: andanteyk Date: Thu, 12 Mar 2015 11:36:18 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=E8=A3=85=E5=82=99=E4=B8=80=E8=A6=A7?= =?UTF-8?q?=E6=94=B9=E8=A3=85=E4=BB=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・羅針盤窓:夜戦マスで表示が崩れる不具合を修正 ・グループ窓:一部設定が適用されない不具合を修正 --- .../Dialog/DialogEquipmentList.Designer.cs | 175 ++++++++---- .../Window/Dialog/DialogEquipmentList.cs | 257 ++++++++++++++---- .../Window/Dialog/DialogEquipmentList.resx | 15 +- ElectronicObserver/Window/FormCompass.cs | 8 +- .../Window/FormShipGroup.Designer.cs | 22 +- ElectronicObserver/Window/FormShipGroup.cs | 20 +- 6 files changed, 367 insertions(+), 130 deletions(-) diff --git a/ElectronicObserver/Window/Dialog/DialogEquipmentList.Designer.cs b/ElectronicObserver/Window/Dialog/DialogEquipmentList.Designer.cs index ec5c13aa1..0eefd2a84 100644 --- a/ElectronicObserver/Window/Dialog/DialogEquipmentList.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogEquipmentList.Designer.cs @@ -24,19 +24,29 @@ protected override void Dispose( bool disposing ) { /// private void InitializeComponent() { this.EquipmentView = new System.Windows.Forms.DataGridView(); - this.TopMenu = new System.Windows.Forms.MenuStrip(); - this.TopMenu_File = new System.Windows.Forms.ToolStripMenuItem(); - this.TopMenu_File_CSVOutput = new System.Windows.Forms.ToolStripMenuItem(); - this.TopMenu_File_Update = new System.Windows.Forms.ToolStripMenuItem(); - this.SaveCSVDialog = new System.Windows.Forms.SaveFileDialog(); this.EquipmentView_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.EquipmentView_Icon = new System.Windows.Forms.DataGridViewImageColumn(); this.EquipmentView_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.EquipmentView_CountAll = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.EquipmentView_CountRemain = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.EquipmentView_EquippedShip = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TopMenu = new System.Windows.Forms.MenuStrip(); + this.TopMenu_File = new System.Windows.Forms.ToolStripMenuItem(); + this.TopMenu_File_CSVOutput = new System.Windows.Forms.ToolStripMenuItem(); + this.TopMenu_File_Update = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveCSVDialog = new System.Windows.Forms.SaveFileDialog(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.DetailView = new System.Windows.Forms.DataGridView(); + this.DetailView_Level = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.DetailView_CountAll = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.DetailView_CountRemain = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.DetailView_EquippedShip = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.EquipmentView)).BeginInit(); this.TopMenu.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.DetailView)).BeginInit(); this.SuspendLayout(); // // EquipmentView @@ -51,21 +61,59 @@ private void InitializeComponent() { this.EquipmentView_Icon, this.EquipmentView_Name, this.EquipmentView_CountAll, - this.EquipmentView_CountRemain, - this.EquipmentView_EquippedShip}); + this.EquipmentView_CountRemain}); this.EquipmentView.Dock = System.Windows.Forms.DockStyle.Fill; - this.EquipmentView.Location = new System.Drawing.Point(0, 26); + this.EquipmentView.Location = new System.Drawing.Point(0, 0); this.EquipmentView.Name = "EquipmentView"; this.EquipmentView.ReadOnly = true; this.EquipmentView.RowHeadersVisible = false; this.EquipmentView.RowTemplate.Height = 21; this.EquipmentView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.EquipmentView.Size = new System.Drawing.Size(640, 454); + this.EquipmentView.Size = new System.Drawing.Size(320, 454); this.EquipmentView.TabIndex = 0; this.EquipmentView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.EquipmentView_CellFormatting); + this.EquipmentView.SelectionChanged += new System.EventHandler(this.EquipmentView_SelectionChanged); this.EquipmentView.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.EquipmentView_SortCompare); this.EquipmentView.Sorted += new System.EventHandler(this.EquipmentView_Sorted); // + // EquipmentView_ID + // + this.EquipmentView_ID.HeaderText = "ID"; + this.EquipmentView_ID.Name = "EquipmentView_ID"; + this.EquipmentView_ID.ReadOnly = true; + this.EquipmentView_ID.Width = 40; + // + // EquipmentView_Icon + // + this.EquipmentView_Icon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader; + this.EquipmentView_Icon.HeaderText = ""; + this.EquipmentView_Icon.Name = "EquipmentView_Icon"; + this.EquipmentView_Icon.ReadOnly = true; + this.EquipmentView_Icon.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.EquipmentView_Icon.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.EquipmentView_Icon.Width = 5; + // + // EquipmentView_Name + // + this.EquipmentView_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.EquipmentView_Name.HeaderText = "装備名"; + this.EquipmentView_Name.Name = "EquipmentView_Name"; + this.EquipmentView_Name.ReadOnly = true; + // + // EquipmentView_CountAll + // + this.EquipmentView_CountAll.HeaderText = "全個数"; + this.EquipmentView_CountAll.Name = "EquipmentView_CountAll"; + this.EquipmentView_CountAll.ReadOnly = true; + this.EquipmentView_CountAll.Width = 40; + // + // EquipmentView_CountRemain + // + this.EquipmentView_CountRemain.HeaderText = "余個数"; + this.EquipmentView_CountRemain.Name = "EquipmentView_CountRemain"; + this.EquipmentView_CountRemain.ReadOnly = true; + this.EquipmentView_CountRemain.Width = 40; + // // TopMenu // this.TopMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -106,58 +154,81 @@ private void InitializeComponent() { this.SaveCSVDialog.Filter = "CSV|*.csv|File|*"; this.SaveCSVDialog.Title = "CSVに出力"; // - // EquipmentView_ID + // splitContainer1 // - this.EquipmentView_ID.HeaderText = "ID"; - this.EquipmentView_ID.Name = "EquipmentView_ID"; - this.EquipmentView_ID.ReadOnly = true; - this.EquipmentView_ID.Width = 40; + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 26); + this.splitContainer1.Name = "splitContainer1"; // - // EquipmentView_Icon + // splitContainer1.Panel1 // - this.EquipmentView_Icon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader; - this.EquipmentView_Icon.HeaderText = ""; - this.EquipmentView_Icon.Name = "EquipmentView_Icon"; - this.EquipmentView_Icon.ReadOnly = true; - this.EquipmentView_Icon.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.EquipmentView_Icon.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.EquipmentView_Icon.Width = 5; + this.splitContainer1.Panel1.Controls.Add(this.EquipmentView); // - // EquipmentView_Name + // splitContainer1.Panel2 // - this.EquipmentView_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader; - this.EquipmentView_Name.HeaderText = "装備名"; - this.EquipmentView_Name.Name = "EquipmentView_Name"; - this.EquipmentView_Name.ReadOnly = true; - this.EquipmentView_Name.Width = 5; + this.splitContainer1.Panel2.Controls.Add(this.DetailView); + this.splitContainer1.Size = new System.Drawing.Size(640, 454); + this.splitContainer1.SplitterDistance = 320; + this.splitContainer1.TabIndex = 2; // - // EquipmentView_CountAll + // DetailView // - this.EquipmentView_CountAll.HeaderText = "全個数"; - this.EquipmentView_CountAll.Name = "EquipmentView_CountAll"; - this.EquipmentView_CountAll.ReadOnly = true; - this.EquipmentView_CountAll.Width = 40; + this.DetailView.AllowUserToAddRows = false; + this.DetailView.AllowUserToDeleteRows = false; + this.DetailView.AllowUserToResizeRows = false; + this.DetailView.BackgroundColor = System.Drawing.SystemColors.Control; + this.DetailView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.DetailView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.DetailView_Level, + this.DetailView_CountAll, + this.DetailView_CountRemain, + this.DetailView_EquippedShip}); + this.DetailView.Dock = System.Windows.Forms.DockStyle.Fill; + this.DetailView.Location = new System.Drawing.Point(0, 0); + this.DetailView.Name = "DetailView"; + this.DetailView.ReadOnly = true; + this.DetailView.RowHeadersVisible = false; + this.DetailView.RowTemplate.Height = 21; + this.DetailView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.DetailView.Size = new System.Drawing.Size(316, 454); + this.DetailView.TabIndex = 1; + this.DetailView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.DetailView_CellFormatting); + this.DetailView.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.DetailView_CellPainting); // - // EquipmentView_CountRemain + // DetailView_Level // - this.EquipmentView_CountRemain.HeaderText = "余個数"; - this.EquipmentView_CountRemain.Name = "EquipmentView_CountRemain"; - this.EquipmentView_CountRemain.ReadOnly = true; - this.EquipmentView_CountRemain.Width = 40; + this.DetailView_Level.HeaderText = "改修"; + this.DetailView_Level.Name = "DetailView_Level"; + this.DetailView_Level.ReadOnly = true; + this.DetailView_Level.Width = 40; + // + // DetailView_CountAll + // + this.DetailView_CountAll.HeaderText = "全個数"; + this.DetailView_CountAll.Name = "DetailView_CountAll"; + this.DetailView_CountAll.ReadOnly = true; + this.DetailView_CountAll.Width = 40; + // + // DetailView_CountRemain + // + this.DetailView_CountRemain.HeaderText = "余個数"; + this.DetailView_CountRemain.Name = "DetailView_CountRemain"; + this.DetailView_CountRemain.ReadOnly = true; + this.DetailView_CountRemain.Width = 40; // - // EquipmentView_EquippedShip + // DetailView_EquippedShip // - this.EquipmentView_EquippedShip.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.EquipmentView_EquippedShip.HeaderText = "装備艦"; - this.EquipmentView_EquippedShip.Name = "EquipmentView_EquippedShip"; - this.EquipmentView_EquippedShip.ReadOnly = true; - this.EquipmentView_EquippedShip.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.DetailView_EquippedShip.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.DetailView_EquippedShip.HeaderText = "装備艦"; + this.DetailView_EquippedShip.Name = "DetailView_EquippedShip"; + this.DetailView_EquippedShip.ReadOnly = true; + this.DetailView_EquippedShip.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // DialogEquipmentList // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.ClientSize = new System.Drawing.Size(640, 480); - this.Controls.Add(this.EquipmentView); + this.Controls.Add(this.splitContainer1); this.Controls.Add(this.TopMenu); this.DoubleBuffered = true; this.Font = new System.Drawing.Font("Meiryo UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); @@ -169,6 +240,11 @@ private void InitializeComponent() { ((System.ComponentModel.ISupportInitialize)(this.EquipmentView)).EndInit(); this.TopMenu.ResumeLayout(false); this.TopMenu.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.DetailView)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -187,6 +263,11 @@ private void InitializeComponent() { private System.Windows.Forms.DataGridViewTextBoxColumn EquipmentView_Name; private System.Windows.Forms.DataGridViewTextBoxColumn EquipmentView_CountAll; private System.Windows.Forms.DataGridViewTextBoxColumn EquipmentView_CountRemain; - private System.Windows.Forms.DataGridViewTextBoxColumn EquipmentView_EquippedShip; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.DataGridView DetailView; + private System.Windows.Forms.DataGridViewTextBoxColumn DetailView_Level; + private System.Windows.Forms.DataGridViewTextBoxColumn DetailView_CountAll; + private System.Windows.Forms.DataGridViewTextBoxColumn DetailView_CountRemain; + private System.Windows.Forms.DataGridViewTextBoxColumn DetailView_EquippedShip; } } \ No newline at end of file diff --git a/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs b/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs index a3eed3128..47e1ae3b6 100644 --- a/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs +++ b/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs @@ -16,7 +16,8 @@ namespace ElectronicObserver.Window.Dialog { public partial class DialogEquipmentList : Form { - private DataGridViewCellStyle CSDefaultLeft, CSDefaultRight, CSEquippedShips; + private DataGridViewCellStyle CSDefaultLeft, CSDefaultRight, + CSUnselectableLeft, CSUnselectableRight; public DialogEquipmentList() { @@ -42,19 +43,28 @@ public DialogEquipmentList() { CSDefaultLeft.ForeColor = SystemColors.ControlText; CSDefaultLeft.SelectionBackColor = Color.FromArgb( 0xFF, 0xFF, 0xCC ); CSDefaultLeft.SelectionForeColor = SystemColors.ControlText; + CSDefaultLeft.WrapMode = DataGridViewTriState.False; CSDefaultRight = new DataGridViewCellStyle( CSDefaultLeft ); CSDefaultRight.Alignment = DataGridViewContentAlignment.MiddleRight; - CSDefaultRight.WrapMode = DataGridViewTriState.False; - CSEquippedShips = new DataGridViewCellStyle( CSDefaultLeft ); - CSEquippedShips.WrapMode = DataGridViewTriState.True; + CSUnselectableLeft = new DataGridViewCellStyle( CSDefaultLeft ); + CSUnselectableLeft.SelectionForeColor = CSUnselectableLeft.ForeColor; + CSUnselectableLeft.SelectionBackColor = CSUnselectableLeft.BackColor; + + CSUnselectableRight = new DataGridViewCellStyle( CSDefaultRight ); + CSUnselectableRight.SelectionForeColor = CSUnselectableRight.ForeColor; + CSUnselectableRight.SelectionBackColor = CSUnselectableRight.BackColor; + EquipmentView.DefaultCellStyle = CSDefaultRight; EquipmentView_Name.DefaultCellStyle = CSDefaultLeft; - EquipmentView_EquippedShip.DefaultCellStyle = CSEquippedShips; EquipmentView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; + DetailView.DefaultCellStyle = CSUnselectableRight; + DetailView_EquippedShip.DefaultCellStyle = CSUnselectableLeft; + DetailView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; + #endregion } @@ -68,6 +78,111 @@ private void DialogEquipmentList_Load( object sender, EventArgs e ) { } + private void EquipmentView_SortCompare( object sender, DataGridViewSortCompareEventArgs e ) { + + if ( e.Column.Index == EquipmentView_Name.Index ) { + + int id1 = (int)EquipmentView[EquipmentView_ID.Index, e.RowIndex1].Value; + int id2 = (int)EquipmentView[EquipmentView_ID.Index, e.RowIndex2].Value; + + e.SortResult = + KCDatabase.Instance.MasterEquipments[id1].CategoryType - + KCDatabase.Instance.MasterEquipments[id2].CategoryType; + + if ( e.SortResult == 0 ) { + e.SortResult = id1 - id2; + } + + } else { + + e.SortResult = ( (IComparable)e.CellValue1 ).CompareTo( e.CellValue2 ); + + } + + + if ( e.SortResult == 0 ) { + e.SortResult = ( EquipmentView.Rows[e.RowIndex1].Tag as int? ?? 0 ) - ( EquipmentView.Rows[e.RowIndex2].Tag as int? ?? 0 ); + } + + e.Handled = true; + + } + + private void EquipmentView_Sorted( object sender, EventArgs e ) { + + for ( int i = 0; i < EquipmentView.Rows.Count; i++ ) + EquipmentView.Rows[i].Tag = i; + + } + + private void EquipmentView_CellFormatting( object sender, DataGridViewCellFormattingEventArgs e ) { + + if ( e.ColumnIndex == EquipmentView_Icon.Index ) { + e.Value = ResourceManager.Instance.Equipments.Images[(int)e.Value]; + e.FormattingApplied = true; + } + + } + + private void EquipmentView_SelectionChanged( object sender, EventArgs e ) { + + if ( EquipmentView.Enabled && EquipmentView.SelectedRows != null && EquipmentView.SelectedRows.Count > 0 ) + UpdateDetailView( (int)EquipmentView[EquipmentView_ID.Index, EquipmentView.SelectedRows[0].Index].Value ); + + } + + + private void DetailView_CellFormatting( object sender, DataGridViewCellFormattingEventArgs e ) { + + if ( e.ColumnIndex != DetailView_EquippedShip.Index ) { + if ( AreEqual( e.RowIndex, e.RowIndex - 1 ) ) { + + e.Value = ""; + e.FormattingApplied = true; + return; + } + } + + if ( e.ColumnIndex == DetailView_Level.Index ) { + + e.Value = "+" + e.Value; + e.FormattingApplied = true; + + } + + } + + private void DetailView_CellPainting( object sender, DataGridViewCellPaintingEventArgs e ) { + + e.AdvancedBorderStyle.Top = DataGridViewAdvancedCellBorderStyle.None; + + if ( AreEqual( e.RowIndex, e.RowIndex + 1 ) ) { + e.AdvancedBorderStyle.Bottom = DataGridViewAdvancedCellBorderStyle.None; + } else { + e.AdvancedBorderStyle.Bottom = DetailView.AdvancedCellBorderStyle.Bottom; + } + + } + + /// + /// DetailView 内の行が同じレベルであるかを判定します。 + /// + private bool AreEqual( int rowIndex1, int rowIndex2 ) { + + if ( rowIndex1 < 0 || + rowIndex1 >= DetailView.Rows.Count || + rowIndex2 < 0 || + rowIndex2 >= DetailView.Rows.Count ) + return false; + + return ( (IComparable)DetailView[DetailView_Level.Index, rowIndex1].Value ) + .CompareTo( DetailView[DetailView_Level.Index, rowIndex2].Value ) == 0; + } + + + /// + /// 一覧ビューを更新します。 + /// private void UpdateView() { var ships = KCDatabase.Instance.Ships.Values; @@ -91,12 +206,11 @@ private void UpdateView() { var remainCount = new Dictionary( allCount ); - var equippedShips = new Dictionary( allCount.Count ); - //剰余数計算&装備艦 + + //剰余数計算 foreach ( var ship in ships ) { - var owneqs = ship.SlotInstance; int[] eqids = ship.SlotInstance.Select( i => i != null ? i.EquipmentID : -1 ).ToArray(); @@ -104,25 +218,7 @@ private void UpdateView() { if ( eqids[i] == -1 ) continue; - int cid = eqids[i]; - - int count = 0; - for ( int j = 0; j < eqids.Length; j++ ) { - if ( eqids[j] == cid ) { - count++; - eqids[j] = -1; - } - } - - remainCount[cid] -= count; - - if ( !equippedShips.ContainsKey( cid ) ) { - equippedShips.Add( cid, new StringBuilder( GetShipInformation( ship, count ) ) ); - - } else { - equippedShips[cid].AppendFormat( ", {0}", GetShipInformation( ship, count ) ); - } - + remainCount[eqids[i]]--; } } @@ -131,6 +227,7 @@ private void UpdateView() { //表示処理 EquipmentView.SuspendLayout(); + EquipmentView.Enabled = false; EquipmentView.Rows.Clear(); @@ -146,8 +243,7 @@ private void UpdateView() { masterEquipments[id].IconType, masterEquipments[id].Name, allCount[id], - remainCount[id], - equippedShips.ContainsKey( id ) ? equippedShips[id].ToString() : null + remainCount[id] ); rows.Add( row ); @@ -160,65 +256,113 @@ private void UpdateView() { EquipmentView.Sort( EquipmentView_Name, ListSortDirection.Ascending ); + + EquipmentView.Enabled = true; EquipmentView.ResumeLayout(); + if ( EquipmentView.Rows.Count > 0 ) + EquipmentView.CurrentCell = EquipmentView[0, 0]; + } - private string GetShipInformation( ShipData ship, int count ) { + private class DetailCounter : IIdentifiable { + + public int level; + public int countAll; + public int countRemain; + public int countRemainPrev; - return string.Format( "{0} Lv.{1}{2}", ship.MasterShip.Name, ship.Level, count > 1 ? " x" + count : "" ); + public List equippedShips; + public DetailCounter( int lv ) { + level = lv; + countAll = 0; + countRemainPrev = 0; + countRemain = 0; + equippedShips = new List(); + } + + public int ID { get { return level; } } } - private void EquipmentView_SortCompare( object sender, DataGridViewSortCompareEventArgs e ) { + /// + /// 詳細ビューを更新します。 + /// + private void UpdateDetailView( int equipmentID ) { - if ( e.Column.Index == EquipmentView_Name.Index ) { + DetailView.SuspendLayout(); - int id1 = (int)EquipmentView.Rows[e.RowIndex1].Cells[EquipmentView_ID.Index].Value; - int id2 = (int)EquipmentView.Rows[e.RowIndex2].Cells[EquipmentView_ID.Index].Value; + DetailView.Rows.Clear(); - e.SortResult = - KCDatabase.Instance.MasterEquipments[id1].EquipmentType[2] - - KCDatabase.Instance.MasterEquipments[id2].EquipmentType[2]; + //装備数カウント + var eqs = KCDatabase.Instance.Equipments.Values.Where( eq => eq.EquipmentID == equipmentID ); + var countlist = new IDDictionary(); - if ( e.SortResult == 0 ) { - e.SortResult = id1 - id2; + foreach ( var eq in eqs ) { + var c = countlist[eq.Level]; + if ( c == null ) { + countlist.Add( new DetailCounter( eq.Level ) ); + c = countlist[eq.Level]; } + c.countAll++; + c.countRemain++; + c.countRemainPrev++; + } - } else { + //装備艦集計 + foreach ( var ship in KCDatabase.Instance.Ships.Values ) { - e.SortResult = ( (IComparable)e.CellValue1 ).CompareTo( e.CellValue2 ); + foreach ( var eq in ship.SlotInstance.Where( s => s != null && s.EquipmentID == equipmentID ) ) { - } + countlist[eq.Level].countRemain--; + } + + foreach ( var c in countlist.Values ) { + if ( c.countRemain != c.countRemainPrev ) { + + int diff = c.countRemainPrev - c.countRemain; + + c.equippedShips.Add( ship.NameWithLevel + ( diff > 1 ? ( " x" + diff ) : "" ) ); + + c.countRemainPrev = c.countRemain; + } + } - if ( e.SortResult == 0 ) { - e.SortResult = ( EquipmentView.Rows[e.RowIndex1].Tag as int? ?? 0 ) - ( EquipmentView.Rows[e.RowIndex2].Tag as int? ?? 0 ); } - e.Handled = true; - } + //行に反映 + var rows = new List( eqs.Count() ); - private void EquipmentView_Sorted( object sender, EventArgs e ) { + foreach ( var c in countlist.Values ) { - for ( int i = 0; i < EquipmentView.Rows.Count; i++ ) - EquipmentView.Rows[i].Tag = i; + if ( c.equippedShips.Count() == 0 ) { + c.equippedShips.Add( "" ); + } - } + foreach ( var s in c.equippedShips ) { - private void EquipmentView_CellFormatting( object sender, DataGridViewCellFormattingEventArgs e ) { + var row = new DataGridViewRow(); + row.CreateCells( DetailView ); + row.SetValues( c.level, c.countAll, c.countRemain, s ); + rows.Add( row ); + } - if ( e.ColumnIndex == EquipmentView_Icon.Index ) { - e.Value = ResourceManager.Instance.Equipments.Images[(int)e.Value]; - e.FormattingApplied = true; } + DetailView.Rows.AddRange( rows.ToArray() ); + DetailView.Sort( DetailView_Level, ListSortDirection.Ascending ); + + DetailView.ResumeLayout(); + + Text = "装備図鑑 - " + KCDatabase.Instance.MasterEquipments[equipmentID].Name; } + private void Menu_File_CSVOutput_Click( object sender, EventArgs e ) { if ( SaveCSVDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK ) { @@ -263,8 +407,6 @@ private void Menu_File_CSVOutput_Click( object sender, EventArgs e ) { } - - private void DialogEquipmentList_FormClosed( object sender, FormClosedEventArgs e ) { ResourceManager.DestroyIcon( Icon ); @@ -276,5 +418,6 @@ private void TopMenu_File_Update_Click( object sender, EventArgs e ) { UpdateView(); } + } } diff --git a/ElectronicObserver/Window/Dialog/DialogEquipmentList.resx b/ElectronicObserver/Window/Dialog/DialogEquipmentList.resx index 9edf233e7..01c1f4b58 100644 --- a/ElectronicObserver/Window/Dialog/DialogEquipmentList.resx +++ b/ElectronicObserver/Window/Dialog/DialogEquipmentList.resx @@ -132,13 +132,22 @@ True - - True - 17, 17 101, 17 + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/ElectronicObserver/Window/FormCompass.cs b/ElectronicObserver/Window/FormCompass.cs index b926281ec..b97bf06a7 100644 --- a/ElectronicObserver/Window/FormCompass.cs +++ b/ElectronicObserver/Window/FormCompass.cs @@ -334,7 +334,8 @@ private void Updated( string apiname, dynamic data ) { Color colorNormal = SystemColors.ControlText; Color colorNight = Color.Navy; - + + if ( apiname == "api_port/port" ) { BasePanel.Visible = false; @@ -344,8 +345,8 @@ private void Updated( string apiname, dynamic data ) { TextMapArea.Text = "演習"; TextDestination.Text = string.Format( "{0} {1}", data.api_nickname, Constants.GetAdmiralRank( (int)data.api_rank ) ); TextEventKind.Text = data.api_cmt; + TextEventKind.ForeColor = colorNormal; TextEventDetail.Text = string.Format( "Lv. {0} / {1} exp.", data.api_level, data.api_experience[0] ); - TextEventDetail.ForeColor = colorNormal; TextEnemyFleetName.Text = data.api_deckname; } else { @@ -358,6 +359,7 @@ private void Updated( string apiname, dynamic data ) { TextMapArea.Text = "出撃海域 : " + compass.MapAreaID + "-" + compass.MapInfoID; TextDestination.Text = "次のセル : " + compass.Destination + ( compass.IsEndPoint ? " (終点)" : "" ); + TextEventKind.ForeColor = colorNormal; { string eventkind = Constants.GetMapEventID( compass.EventID ); @@ -420,7 +422,7 @@ private void Updated( string apiname, dynamic data ) { eventkind += "/" + Constants.GetMapEventKind( compass.EventKind ); if ( compass.EventKind == 2 || compass.EventKind == 3 ) { - TextEventDetail.ForeColor = colorNight; break; + TextEventKind.ForeColor = colorNight; } } UpdateEnemyFleet( compass.EnemyFleetID ); diff --git a/ElectronicObserver/Window/FormShipGroup.Designer.cs b/ElectronicObserver/Window/FormShipGroup.Designer.cs index a40da65b5..bc76b5728 100644 --- a/ElectronicObserver/Window/FormShipGroup.Designer.cs +++ b/ElectronicObserver/Window/FormShipGroup.Designer.cs @@ -83,13 +83,13 @@ private void InitializeComponent() { this.MenuGroup_Delete = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.MenuGroup_AutoUpdate = new System.Windows.Forms.ToolStripMenuItem(); + this.MenuGroup_ShowStatusBar = new System.Windows.Forms.ToolStripMenuItem(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.TabPanel = new System.Windows.Forms.FlowLayoutPanel(); this.StatusBar = new System.Windows.Forms.StatusStrip(); this.Status_ShipCount = new System.Windows.Forms.ToolStripStatusLabel(); this.Status_LevelTotal = new System.Windows.Forms.ToolStripStatusLabel(); this.Status_LevelAverage = new System.Windows.Forms.ToolStripStatusLabel(); - this.MenuGroup_ShowStatusBar = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.ShipView)).BeginInit(); this.MenuMember.SuspendLayout(); this.MenuGroup.SuspendLayout(); @@ -547,6 +547,16 @@ private void InitializeComponent() { this.MenuGroup_AutoUpdate.Size = new System.Drawing.Size(220, 22); this.MenuGroup_AutoUpdate.Text = "自動更新する"; // + // MenuGroup_ShowStatusBar + // + this.MenuGroup_ShowStatusBar.Checked = true; + this.MenuGroup_ShowStatusBar.CheckOnClick = true; + this.MenuGroup_ShowStatusBar.CheckState = System.Windows.Forms.CheckState.Checked; + this.MenuGroup_ShowStatusBar.Name = "MenuGroup_ShowStatusBar"; + this.MenuGroup_ShowStatusBar.Size = new System.Drawing.Size(220, 22); + this.MenuGroup_ShowStatusBar.Text = "ステータスバーを表示する"; + this.MenuGroup_ShowStatusBar.CheckedChanged += new System.EventHandler(this.MenuGroup_ShowStatusBar_CheckedChanged); + // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -611,16 +621,6 @@ private void InitializeComponent() { this.Status_LevelAverage.Name = "Status_LevelAverage"; this.Status_LevelAverage.Size = new System.Drawing.Size(0, 17); // - // MenuGroup_ShowStatusBar - // - this.MenuGroup_ShowStatusBar.Checked = true; - this.MenuGroup_ShowStatusBar.CheckOnClick = true; - this.MenuGroup_ShowStatusBar.CheckState = System.Windows.Forms.CheckState.Checked; - this.MenuGroup_ShowStatusBar.Name = "MenuGroup_ShowStatusBar"; - this.MenuGroup_ShowStatusBar.Size = new System.Drawing.Size(220, 22); - this.MenuGroup_ShowStatusBar.Text = "ステータスバーを表示する"; - this.MenuGroup_ShowStatusBar.Click += new System.EventHandler(this.MenuGroup_ShowStatusBar_Click); - // // FormShipGroup // this.AutoHidePortion = 150D; diff --git a/ElectronicObserver/Window/FormShipGroup.cs b/ElectronicObserver/Window/FormShipGroup.cs index 024f9ab1d..12b11eee9 100644 --- a/ElectronicObserver/Window/FormShipGroup.cs +++ b/ElectronicObserver/Window/FormShipGroup.cs @@ -171,6 +171,7 @@ void ConfigurationChanged() { splitContainer1.SplitterDistance = Utility.Configuration.Config.FormShipGroup.SplitterDistance; MenuGroup_AutoUpdate.Checked = Utility.Configuration.Config.FormShipGroup.AutoUpdate; MenuGroup_ShowStatusBar.Checked = Utility.Configuration.Config.FormShipGroup.ShowStatusBar; + } @@ -1169,19 +1170,27 @@ private void TabPanel_DragDrop( object sender, DragEventArgs e ) { - private void MenuGroup_ShowStatusBar_Click( object sender, EventArgs e ) { + private void MenuGroup_ShowStatusBar_CheckedChanged( object sender, EventArgs e ) { StatusBar.Visible = MenuGroup_ShowStatusBar.Checked; } + void SystemShuttingDown() { - ShipGroupManager groups = KCDatabase.Instance.ShipGroup; + + Utility.Configuration.Config.FormShipGroup.SplitterDistance = splitContainer1.SplitterDistance; + Utility.Configuration.Config.FormShipGroup.AutoUpdate = MenuGroup_AutoUpdate.Checked; + Utility.Configuration.Config.FormShipGroup.ShowStatusBar = MenuGroup_ShowStatusBar.Checked; + + //以下は実データがないと動作しないためなければスキップ if ( KCDatabase.Instance.Ships.Count == 0 ) return; + ShipGroupManager groups = KCDatabase.Instance.ShipGroup; + if ( SelectedTab != null ) ApplyGroupData( SelectedTab ); @@ -1196,19 +1205,12 @@ void SystemShuttingDown() { group.GroupID = i + 1; } - Utility.Configuration.Config.FormShipGroup.SplitterDistance = splitContainer1.SplitterDistance; - Utility.Configuration.Config.FormShipGroup.AutoUpdate = MenuGroup_AutoUpdate.Checked; - Utility.Configuration.Config.FormShipGroup.ShowStatusBar = MenuGroup_ShowStatusBar.Checked; } protected override string GetPersistString() { return "ShipGroup"; } - - - - } From d21c598eaa2060c37787f3a09c3454b52b8802e0 Mon Sep 17 00:00:00 2001 From: andanteyk Date: Thu, 12 Mar 2015 19:24:29 +0900 Subject: [PATCH 6/6] Version 1.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・スタイルシートの再適用を実装. --- .../Utility/SoftwareInformation.cs | 2 +- .../Window/Dialog/DialogEquipmentList.cs | 2 +- ElectronicObserver/Window/FormBrowser.cs | 3 ++- ElectronicObserver/Window/FormFleet.cs | 6 ++--- .../Window/FormMain.Designer.cs | 24 +++++++++++++------ ElectronicObserver/Window/FormMain.cs | 13 ++++++++++ README.md | 2 +- 7 files changed, 38 insertions(+), 14 deletions(-) diff --git a/ElectronicObserver/Utility/SoftwareInformation.cs b/ElectronicObserver/Utility/SoftwareInformation.cs index c7e486073..184440273 100644 --- a/ElectronicObserver/Utility/SoftwareInformation.cs +++ b/ElectronicObserver/Utility/SoftwareInformation.cs @@ -54,7 +54,7 @@ public static string VersionEnglish { /// public static DateTime UpdateTime { get { - return DateTimeHelper.CSVStringToTime( "2015/03/10 00:00:00" ); + return DateTimeHelper.CSVStringToTime( "2015/03/12 18:00:00" ); } } diff --git a/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs b/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs index 47e1ae3b6..c760208eb 100644 --- a/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs +++ b/ElectronicObserver/Window/Dialog/DialogEquipmentList.cs @@ -358,7 +358,7 @@ private void UpdateDetailView( int equipmentID ) { DetailView.ResumeLayout(); - Text = "装備図鑑 - " + KCDatabase.Instance.MasterEquipments[equipmentID].Name; + Text = "装備一覧 - " + KCDatabase.Instance.MasterEquipments[equipmentID].Name; } diff --git a/ElectronicObserver/Window/FormBrowser.cs b/ElectronicObserver/Window/FormBrowser.cs index 6e8c295f2..7db53c993 100644 --- a/ElectronicObserver/Window/FormBrowser.cs +++ b/ElectronicObserver/Window/FormBrowser.cs @@ -84,6 +84,7 @@ void ConfigurationChanged() { //ロード直後の適用ではレイアウトがなぜか崩れるのでこのタイミングでも適用 void InitialAPIReceived( string apiname, dynamic data ) { + ApplyStyleSheet(); ApplyZoom(); } @@ -132,7 +133,7 @@ private void Browser_DocumentCompleted( object sender, WebBrowserDocumentComplet /// /// スタイルシートを適用します。 /// - private void ApplyStyleSheet() { + public void ApplyStyleSheet() { try { diff --git a/ElectronicObserver/Window/FormFleet.cs b/ElectronicObserver/Window/FormFleet.cs index ee775670f..54f706b93 100644 --- a/ElectronicObserver/Window/FormFleet.cs +++ b/ElectronicObserver/Window/FormFleet.cs @@ -318,10 +318,10 @@ public void AddToTable( TableLayoutPanel table, int row ) { public void Update( int shipMasterID ) { KCDatabase db = KCDatabase.Instance; + ShipData ship = db.Ships[shipMasterID]; + + if ( ship != null ) { - if ( shipMasterID != -1 ) { - - ShipData ship = db.Ships[shipMasterID]; bool isEscaped = KCDatabase.Instance.Fleet[Parent.FleetID].EscapedShipList.Contains( shipMasterID ); diff --git a/ElectronicObserver/Window/FormMain.Designer.cs b/ElectronicObserver/Window/FormMain.Designer.cs index 01ca53244..13353e3c0 100644 --- a/ElectronicObserver/Window/FormMain.Designer.cs +++ b/ElectronicObserver/Window/FormMain.Designer.cs @@ -119,6 +119,7 @@ private void InitializeComponent() { this.StripStatus_Padding = new System.Windows.Forms.ToolStripStatusLabel(); this.StripStatus_Clock = new System.Windows.Forms.ToolStripStatusLabel(); this.UIUpdateTimer = new System.Windows.Forms.Timer(this.components); + this.StripMenu_Browser_ApplyStyleSheet = new System.Windows.Forms.ToolStripMenuItem(); this.StripMenu.SuspendLayout(); this.StripStatus.SuspendLayout(); this.SuspendLayout(); @@ -455,6 +456,7 @@ private void InitializeComponent() { this.StripMenu_Browser_ScreenShot, this.toolStripSeparator9, this.StripMenu_Browser_Zoom, + this.StripMenu_Browser_ApplyStyleSheet, this.toolStripSeparator10, this.StripMenu_Browser_Refresh, this.StripMenu_Browser_NavigateToLogInPage, @@ -467,14 +469,14 @@ private void InitializeComponent() { // this.StripMenu_Browser_ScreenShot.Name = "StripMenu_Browser_ScreenShot"; this.StripMenu_Browser_ScreenShot.ShortcutKeys = System.Windows.Forms.Keys.F2; - this.StripMenu_Browser_ScreenShot.Size = new System.Drawing.Size(224, 22); + this.StripMenu_Browser_ScreenShot.Size = new System.Drawing.Size(226, 22); this.StripMenu_Browser_ScreenShot.Text = "スクリーンショット(&S)"; this.StripMenu_Browser_ScreenShot.Click += new System.EventHandler(this.StripMenu_Browser_ScreenShot_Click); // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(221, 6); + this.toolStripSeparator9.Size = new System.Drawing.Size(223, 6); // // StripMenu_Browser_Zoom // @@ -496,7 +498,7 @@ private void InitializeComponent() { this.StripMenu_Browser_Zoom_300, this.StripMenu_Browser_Zoom_400}); this.StripMenu_Browser_Zoom.Name = "StripMenu_Browser_Zoom"; - this.StripMenu_Browser_Zoom.Size = new System.Drawing.Size(224, 22); + this.StripMenu_Browser_Zoom.Size = new System.Drawing.Size(226, 22); this.StripMenu_Browser_Zoom.Text = "ズーム(&Z)"; this.StripMenu_Browser_Zoom.DropDownOpening += new System.EventHandler(this.StripMenu_Browser_Zoom_DropDownOpening); // @@ -607,27 +609,27 @@ private void InitializeComponent() { // toolStripSeparator10 // this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(221, 6); + this.toolStripSeparator10.Size = new System.Drawing.Size(223, 6); // // StripMenu_Browser_Refresh // this.StripMenu_Browser_Refresh.Name = "StripMenu_Browser_Refresh"; this.StripMenu_Browser_Refresh.ShortcutKeys = System.Windows.Forms.Keys.F5; - this.StripMenu_Browser_Refresh.Size = new System.Drawing.Size(224, 22); + this.StripMenu_Browser_Refresh.Size = new System.Drawing.Size(226, 22); this.StripMenu_Browser_Refresh.Text = "更新(&R)"; this.StripMenu_Browser_Refresh.Click += new System.EventHandler(this.StripMenu_Browser_Refresh_Click); // // StripMenu_Browser_NavigateToLogInPage // this.StripMenu_Browser_NavigateToLogInPage.Name = "StripMenu_Browser_NavigateToLogInPage"; - this.StripMenu_Browser_NavigateToLogInPage.Size = new System.Drawing.Size(224, 22); + this.StripMenu_Browser_NavigateToLogInPage.Size = new System.Drawing.Size(226, 22); this.StripMenu_Browser_NavigateToLogInPage.Text = "ログインページへ移動(&L)"; this.StripMenu_Browser_NavigateToLogInPage.Click += new System.EventHandler(this.StripMenu_Browser_NavigateToLogInPage_Click); // // StripMenu_Browser_Navigate // this.StripMenu_Browser_Navigate.Name = "StripMenu_Browser_Navigate"; - this.StripMenu_Browser_Navigate.Size = new System.Drawing.Size(224, 22); + this.StripMenu_Browser_Navigate.Size = new System.Drawing.Size(226, 22); this.StripMenu_Browser_Navigate.Text = "移動(&M)..."; this.StripMenu_Browser_Navigate.Click += new System.EventHandler(this.StripMenu_Browser_Navigate_Click); // @@ -785,6 +787,13 @@ private void InitializeComponent() { this.UIUpdateTimer.Interval = 1000; this.UIUpdateTimer.Tick += new System.EventHandler(this.UIUpdateTimer_Tick); // + // StripMenu_Browser_ApplyStyleSheet + // + this.StripMenu_Browser_ApplyStyleSheet.Name = "StripMenu_Browser_ApplyStyleSheet"; + this.StripMenu_Browser_ApplyStyleSheet.Size = new System.Drawing.Size(226, 22); + this.StripMenu_Browser_ApplyStyleSheet.Text = "スタイルシートの再適用(&S)"; + this.StripMenu_Browser_ApplyStyleSheet.Click += new System.EventHandler(this.StripMenu_Browser_ApplyStyleSheet_Click); + // // FormMain // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -891,6 +900,7 @@ private void InitializeComponent() { private System.Windows.Forms.ToolStripMenuItem StripMenu_Browser_Refresh; private System.Windows.Forms.ToolStripMenuItem StripMenu_Browser_NavigateToLogInPage; private System.Windows.Forms.ToolStripMenuItem StripMenu_Browser_Navigate; + private System.Windows.Forms.ToolStripMenuItem StripMenu_Browser_ApplyStyleSheet; } } diff --git a/ElectronicObserver/Window/FormMain.cs b/ElectronicObserver/Window/FormMain.cs index dd1727918..a2a6b93f9 100644 --- a/ElectronicObserver/Window/FormMain.cs +++ b/ElectronicObserver/Window/FormMain.cs @@ -915,6 +915,17 @@ private void StripMenu_Browser_Zoom_DropDownOpening( object sender, EventArgs e } + private void StripMenu_Browser_ApplyStyleSheet_Click( object sender, EventArgs e ) { + + if ( MessageBox.Show( + "スタイルシートを再適用します。\r\nよろしいですか?", "確認", + MessageBoxButtons.YesNo, MessageBoxIcon.Question + ) == System.Windows.Forms.DialogResult.Yes ) { + + fBrowser.ApplyStyleSheet(); + } + + } #region フォーム表示 @@ -981,6 +992,8 @@ private void StripMenu_View_Browser_Click( object sender, EventArgs e ) { #endregion + + } } diff --git a/README.md b/README.md index bea2eeea7..487bcc287 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ *このリンクの更新は遅れる可能性があります。最新版は[こちら](http://electronicobserver.blog.fc2.com/)で確認してください。* -[ver. 1.0.0 (2015/03/04)](http://bit.ly/1NfQ1iB) +[ver. 1.0.1 (2015/03/12)](http://bit.ly/18dStWr) 更新内容・履歴は[こちら](https://github.com/andanteyk/ElectronicObserver/wiki/ChangeLog)で確認できます。