From 6ac43d7731b8bee862a492a345dc7be2ce93308c Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Fri, 21 Jun 2019 21:34:09 +0900 Subject: [PATCH] =?utf8?q?6=E9=9A=BB=E6=9C=AA=E6=BA=80=E3=81=A7HP=E3=81=AE?= =?utf8?q?=E3=83=91=E3=83=BC=E3=82=BB=E3=83=B3=E3=83=88=E8=A1=A8=E7=A4=BA?= =?utf8?q?=E3=82=92=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88=E3=82=8B=E3=81=A8?= =?utf8?q?=E8=A1=A8=E7=A4=BA=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F?= =?utf8?q?=E3=81=AA=E3=82=8B=E3=81=AE=E3=82=92=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KancolleSniffer/View/ShipLabel.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/KancolleSniffer/View/ShipLabel.cs b/KancolleSniffer/View/ShipLabel.cs index a19c518..c9e3477 100644 --- a/KancolleSniffer/View/ShipLabel.cs +++ b/KancolleSniffer/View/ShipLabel.cs @@ -27,7 +27,6 @@ namespace KancolleSniffer.View public abstract class ShipLabel : GrowLeftLabel { protected Color InitialBackColor; - protected ShipStatus Status; protected Font BaseFont => Parent.Font; @@ -204,6 +203,7 @@ namespace KancolleSniffer.View public sealed class Hp : ShipLabel { private bool _hpPercent; + private ShipStatus _status; public Hp() { @@ -220,13 +220,14 @@ namespace KancolleSniffer.View public override void Reset() { + _status = null; Text = ""; BackColor = InitialBackColor; } public override void Set(ShipStatus status) { - Status = status; + _status = status; Font = BaseFont; Text = _hpPercent ? $"{(int)Floor(status.NowHp * 100.0 / status.MaxHp):D}%" @@ -237,8 +238,8 @@ namespace KancolleSniffer.View public void ToggleHpPercent() { _hpPercent = !_hpPercent; - if (Status != null) - Set(Status); + if (_status != null) + Set(_status); } public void SetHp(int now, int max) -- 2.11.0