From b984e1fd544cd2e21848ace90e7694ec4a5da183 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Mon, 14 Jan 2019 17:40:08 +0900 Subject: [PATCH] =?utf8?q?=E8=A3=85=E5=82=99=E3=81=AE=E3=81=AA=E3=81=84?= =?utf8?q?=E3=82=B9=E3=83=AD=E3=83=83=E3=83=88=E3=81=8C=E3=81=82=E3=82=8B?= =?utf8?q?=E3=81=AE=E3=82=92=E3=82=8F=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86?= =?utf8?q?=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KancolleSniffer/View/ShipLabel.cs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/KancolleSniffer/View/ShipLabel.cs b/KancolleSniffer/View/ShipLabel.cs index acb63f0..c834d6a 100644 --- a/KancolleSniffer/View/ShipLabel.cs +++ b/KancolleSniffer/View/ShipLabel.cs @@ -47,8 +47,9 @@ namespace KancolleSniffer.View private enum SlotStatus { Equipped = 0, - NormalEmpty = 1, - ExtraEmpty = 2 + SemiEquipped = 1, + NormalEmpty = 2, + ExtraEmpty = 4 } public ShipLabel() @@ -66,8 +67,15 @@ namespace KancolleSniffer.View var empty = SlotStatus.Equipped; if (!status.Empty) { - if (status.Slot.All(item => item.Empty)) + var slots = status.Slot.Take(status.Spec.SlotNum).ToArray(); + if (slots.All(item => item.Empty)) + { empty |= SlotStatus.NormalEmpty; + } + else if (slots.Any(item => item.Empty)) + { + empty |= SlotStatus.SemiEquipped; + } if (status.SlotEx.Empty) empty |= SlotStatus.ExtraEmpty; } @@ -261,14 +269,21 @@ namespace KancolleSniffer.View { e.Graphics.DrawRectangle( Pens.Black, - ClientSize.Width - 3 * ScaleFactor.Width, 1 * ScaleFactor.Height, - 2 * ScaleFactor.Width, 4 * ScaleFactor.Height); + ClientSize.Width - 3 * ScaleFactor.Width, 0, + 2 * ScaleFactor.Width, 5 * ScaleFactor.Height); + } + else if ((_slotStatus & SlotStatus.SemiEquipped) != 0) + { + e.Graphics.DrawLine( + Pens.Black, + ClientSize.Width - 1 * ScaleFactor.Width, 0, + ClientSize.Width - 1 * ScaleFactor.Width, 5 * ScaleFactor.Height); } if ((_slotStatus & SlotStatus.ExtraEmpty) != 0) { e.Graphics.DrawRectangle( Pens.Black, - ClientSize.Width - 3 * ScaleFactor.Width, 7 * ScaleFactor.Height, + ClientSize.Width - 3 * ScaleFactor.Width, 8 * ScaleFactor.Height, 2 * ScaleFactor.Width, 3 * ScaleFactor.Height); } } -- 2.11.0