OSDN Git Service

ネタバレオフ時には次のセルの表示を完全に消す
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Mon, 9 Jul 2018 14:11:43 +0000 (23:11 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Mon, 9 Jul 2018 14:11:43 +0000 (23:11 +0900)
This reverts commit 6165ab8e3238ec4d6bbfc74a706d4e82d92ceae1.

KancolleSniffer/BattleResultPanel.cs

index 4a3b6f0..1503887 100644 (file)
@@ -31,8 +31,7 @@ namespace KancolleSniffer
         private readonly List<ShipLabel> _hpLabels = new List<ShipLabel>();\r
         private readonly ResizableToolTip _toolTip = new ResizableToolTip {ShowAlways = true};\r
         private readonly BattleInfo.BattleResult[] _result = new BattleInfo.BattleResult[2];\r
-        private Label _phaseLabel, _rankLabel;\r
-        private CellInfoLabel _cellLabel;\r
+        private Label _phaseLabel, _rankLabel, _cellLabel;\r
         private BattleState _prevBattleState;\r
         private readonly BattleResultRank[] _rank = new BattleResultRank[2];\r
         private readonly InformationPanel _infomationPanel;\r
@@ -287,41 +286,13 @@ namespace KancolleSniffer
 \r
         public void UpdateCellInfo(Sniffer sniffer)\r
         {\r
-            _cellLabel.Update(sniffer);\r
-        }\r
-\r
-        private class CellInfoLabel : Label\r
-        {\r
-            private string _cellInfo;\r
-\r
-            public void Update(Sniffer sniffer)\r
-            {\r
-                var spoilers = ((BattleResultPanel)Parent).Spoilers;\r
-                _cellInfo = sniffer.CellInfo;\r
-                if (_cellInfo == null)\r
-                    return;\r
-                if ((spoilers & Spoiler.NextCell) == 0 && _cellInfo[0] == '次')\r
-                {\r
-                    Text = "次";\r
-                    BorderStyle = BorderStyle.FixedSingle;\r
-                    Location = new Point(Parent.ClientSize.Width - Width - 6, 3);\r
-                    return;\r
-                }\r
-                ShowCellInfo();\r
-            }\r
-\r
-            private void ShowCellInfo()\r
-            {\r
-                Text = _cellInfo;\r
-                BorderStyle = BorderStyle.None;\r
-                Location = new Point(Parent.ClientSize.Width - Width - 2, 4);\r
-            }\r
-\r
-            protected override void OnClick(EventArgs e)\r
-            {\r
-                base.OnClick(e);\r
-                ShowCellInfo();\r
-            }\r
+            var text = sniffer.CellInfo;\r
+            if (text == null)\r
+                return;\r
+            if ((Spoilers & Spoiler.NextCell) == 0 && text[0] == '次')\r
+                return;\r
+            _cellLabel.Text = sniffer.CellInfo;\r
+            _cellLabel.Location = new Point(ClientSize.Width - _cellLabel.Width - 2, 4);\r
         }\r
 \r
         private void CreateLabels()\r
@@ -339,7 +310,7 @@ namespace KancolleSniffer
                 Size = new Size(42, 12)\r
             };\r
             Controls.Add(_rankLabel);\r
-            _cellLabel = new CellInfoLabel\r
+            _cellLabel = new Label\r
             {\r
                 Location = new Point(0, 4),\r
                 AutoSize = true,\r