OSDN Git Service

大破のHPのフォントを変えるのをやめる
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Wed, 22 May 2019 11:16:09 +0000 (20:16 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Thu, 23 May 2019 07:45:47 +0000 (16:45 +0900)
KancolleSniffer/View/ShipLabel.cs

index 4ef5893..d2aab32 100644 (file)
@@ -207,9 +207,6 @@ namespace KancolleSniffer.View
         public sealed class Hp : ShipLabel\r
         {\r
             private bool _hpPercent;\r
-            private Font _strongFont;\r
-            private ShipLabel _hpStrongLabel;\r
-            private Font StrongFont => _strongFont ?? (_strongFont = new Font("Leelawadee", BaseFont.Size));\r
 \r
             public Hp()\r
             {\r
@@ -226,8 +223,6 @@ namespace KancolleSniffer.View
 \r
             public override void Reset()\r
             {\r
-                if (_hpStrongLabel != null)\r
-                    _hpStrongLabel.Text = "";\r
                 Text = "";\r
                 BackColor = InitialBackColor;\r
             }\r
@@ -235,46 +230,11 @@ namespace KancolleSniffer.View
             public override void Set(ShipStatus status)\r
             {\r
                 Status = status;\r
-                if (_hpStrongLabel != null)\r
-                    _hpStrongLabel.Text = "";\r
                 Font = BaseFont;\r
-                if (_hpPercent)\r
-                {\r
-                    var percent = $"{(int)Floor(status.NowHp * 100.0 / status.MaxHp):D}";\r
-                    if (status.DamageLevel == ShipStatus.Damage.Badly)\r
-                    {\r
-                        Text = "%";\r
-                        if (_hpStrongLabel == null)\r
-                            CreateHpStrongLabel();\r
-                        _hpStrongLabel.Text = percent;\r
-                    }\r
-                    else\r
-                    {\r
-                        Text = percent + "%";\r
-                    }\r
-                }\r
-                else\r
-                {\r
-                    Text = $"{status.NowHp:D}/{status.MaxHp:D}";\r
-                    if (status.DamageLevel == ShipStatus.Damage.Badly)\r
-                        Font = StrongFont;\r
-                }\r
+                Text = _hpPercent ? $"{(int)Floor(status.NowHp * 100.0 / status.MaxHp):D}%" : $"{status.NowHp:D}/{status.MaxHp:D}";\r
                 BackColor = DamageColor(status);\r
             }\r
 \r
-            private void CreateHpStrongLabel()\r
-            {\r
-                _hpStrongLabel = new Hp(Scaler.Move(Left, Top, 4, 0), Height)\r
-                {\r
-                    Font = StrongFont,\r
-                    BackColor = CUDColors.Red\r
-                };\r
-                _hpStrongLabel.DoubleClick += (sender, e) => { OnDoubleClick(e); };\r
-                Parent.Controls.Add(_hpStrongLabel);\r
-                var index = Parent.Controls.GetChildIndex(this);\r
-                Parent.Controls.SetChildIndex(_hpStrongLabel, index + 1);\r
-            }\r
-\r
             public void ToggleHpPercent()\r
             {\r
                 _hpPercent = !_hpPercent;\r