コミットメタ情報

リビジョン6165ab8e3238ec4d6bbfc74a706d4e82d92ceae1 (tree)
日時2018-06-29 21:56:37
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

ネタバレオフ時にラベルのクリックで次のセルを表示する

変更サマリ

差分

--- a/KancolleSniffer/BattleResultPanel.cs
+++ b/KancolleSniffer/BattleResultPanel.cs
@@ -31,7 +31,8 @@ namespace KancolleSniffer
3131 private readonly List<ShipLabel> _hpLabels = new List<ShipLabel>();
3232 private readonly ResizableToolTip _toolTip = new ResizableToolTip {ShowAlways = true};
3333 private readonly BattleInfo.BattleResult[] _result = new BattleInfo.BattleResult[2];
34- private Label _phaseLabel, _rankLabel, _cellLabel;
34+ private Label _phaseLabel, _rankLabel;
35+ private CellInfoLabel _cellLabel;
3536 private BattleState _prevBattleState;
3637 private readonly BattleResultRank[] _rank = new BattleResultRank[2];
3738 private readonly InformationPanel _infomationPanel;
@@ -286,13 +287,41 @@ namespace KancolleSniffer
286287
287288 public void UpdateCellInfo(Sniffer sniffer)
288289 {
289- var text = sniffer.CellInfo;
290- if (text == null)
291- return;
292- if ((Spoilers & Spoiler.NextCell) == 0 && text[0] == '次')
293- return;
294- _cellLabel.Text = sniffer.CellInfo;
295- _cellLabel.Location = new Point(ClientSize.Width - _cellLabel.Width - 2, 4);
290+ _cellLabel.Update(sniffer);
291+ }
292+
293+ private class CellInfoLabel : Label
294+ {
295+ private string _cellInfo;
296+
297+ public void Update(Sniffer sniffer)
298+ {
299+ var spoilers = ((BattleResultPanel)Parent).Spoilers;
300+ _cellInfo = sniffer.CellInfo;
301+ if (_cellInfo == null)
302+ return;
303+ if ((spoilers & Spoiler.NextCell) == 0 && _cellInfo[0] == '次')
304+ {
305+ Text = "次";
306+ BorderStyle = BorderStyle.FixedSingle;
307+ Location = new Point(Parent.ClientSize.Width - Width - 6, 3);
308+ return;
309+ }
310+ ShowCellInfo();
311+ }
312+
313+ private void ShowCellInfo()
314+ {
315+ Text = _cellInfo;
316+ BorderStyle = BorderStyle.None;
317+ Location = new Point(Parent.ClientSize.Width - Width - 2, 4);
318+ }
319+
320+ protected override void OnClick(EventArgs e)
321+ {
322+ base.OnClick(e);
323+ ShowCellInfo();
324+ }
296325 }
297326
298327 private void CreateLabels()
@@ -310,7 +339,7 @@ namespace KancolleSniffer
310339 Size = new Size(42, 12)
311340 };
312341 Controls.Add(_rankLabel);
313- _cellLabel = new Label
342+ _cellLabel = new CellInfoLabel
314343 {
315344 Location = new Point(0, 4),
316345 AutoSize = true,
旧リポジトリブラウザで表示