• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版7c4e701c179a5a7ea37d61a6d5f6486b3d2ac695 (tree)
时间2020-09-14 22:10:55
作者Kazuhiro Fujieda <fujieda@user...>
CommiterKazuhiro Fujieda

Log Message

一覧を表示せずに戦況が更新されると艦名などが表示されないのを直す

更改概述

差异

--- a/KancolleSniffer/View/ListWindow/BattleResultPanel.cs
+++ b/KancolleSniffer/View/ListWindow/BattleResultPanel.cs
@@ -32,6 +32,7 @@ namespace KancolleSniffer.View.ListWindow
3232 private readonly InformationPanel _information;
3333 private CellInfo _cellInfo;
3434 private readonly BattleData _data = new BattleData();
35+ private int _lines;
3536
3637 public Spoiler Spoilers { get; set; }
3738
@@ -212,8 +213,9 @@ namespace KancolleSniffer.View.ListWindow
212213
213214 private void ClearResult()
214215 {
216+ _lines = 0;
215217 _scrollPosition = AutoScrollPosition;
216- SetPanelVisible(0);
218+ SetPanelVisible();
217219 _information.Visible = false;
218220 _rankLabel.Text = "";
219221 _supportLabel.Text = "";
@@ -235,8 +237,8 @@ namespace KancolleSniffer.View.ListWindow
235237 SuspendLayout();
236238 SetEachResult(_friendLabels, result.Friend);
237239 SetEachResult(_enemyLabels, result.Enemy);
238- var lines = Max(Ships(result.Friend).Length, Ships(result.Enemy).Length);
239- SetPanelVisible(lines);
240+ _lines = Max(Ships(result.Friend).Length, Ships(result.Enemy).Length);
241+ SetPanelVisible();
240242 ResumeLayout(); // スクロールバーの有無を決定する
241243 AdjustPanelWidth();
242244 }
@@ -386,10 +388,10 @@ namespace KancolleSniffer.View.ListWindow
386388 }
387389 }
388390
389- private void SetPanelVisible(int showPanels)
391+ private void SetPanelVisible()
390392 {
391393 for (var i = 0; i < _friendLabels.Count; i++)
392- _friendLabels[i].BackPanel.Visible = i < showPanels;
394+ _friendLabels[i].BackPanel.Visible = i < _lines;
393395 }
394396
395397 private int _gap;
@@ -399,8 +401,8 @@ namespace KancolleSniffer.View.ListWindow
399401 var labelMax = _enemyLabels[0].Name.Location.X + _enemyLabels.Max(labels => labels.Name.Size.Width) - 1;
400402 var panelWidth = Max(ClientSize.Width, // スクロールバーの有無を反映した横幅
401403 labelMax); // 敵の名前の右端
402- foreach (var panel in from labels in _friendLabels where labels.BackPanel.Visible select labels.BackPanel)
403- panel.Width = panelWidth;
404+ for (var i = 0; i < _lines; i++)
405+ _friendLabels[i].BackPanel.Width = panelWidth;
404406 _gap = (ClientSize.Width - labelMax) * 2 / 3;
405407 }
406408