OSDN Git Service

装備のないスロットがあるのをわかるようにする
[kancollesniffer/KancolleSniffer.git] / KancolleSniffer / View / ShipLabel.cs
index acb63f0..c834d6a 100644 (file)
@@ -47,8 +47,9 @@ namespace KancolleSniffer.View
         private enum SlotStatus\r
         {\r
             Equipped = 0,\r
-            NormalEmpty = 1,\r
-            ExtraEmpty = 2\r
+            SemiEquipped = 1,\r
+            NormalEmpty = 2,\r
+            ExtraEmpty = 4\r
         }\r
 \r
         public ShipLabel()\r
@@ -66,8 +67,15 @@ namespace KancolleSniffer.View
             var empty = SlotStatus.Equipped;\r
             if (!status.Empty)\r
             {\r
-                if (status.Slot.All(item => item.Empty))\r
+                var slots = status.Slot.Take(status.Spec.SlotNum).ToArray();\r
+                if (slots.All(item => item.Empty))\r
+                {\r
                     empty |= SlotStatus.NormalEmpty;\r
+                }\r
+                else if (slots.Any(item => item.Empty))\r
+                {\r
+                    empty |= SlotStatus.SemiEquipped;\r
+                }\r
                 if (status.SlotEx.Empty)\r
                     empty |= SlotStatus.ExtraEmpty;\r
             }\r
@@ -261,14 +269,21 @@ namespace KancolleSniffer.View
             {\r
                 e.Graphics.DrawRectangle(\r
                     Pens.Black,\r
-                    ClientSize.Width - 3 * ScaleFactor.Width, 1 * ScaleFactor.Height,\r
-                    2 * ScaleFactor.Width, 4 * ScaleFactor.Height);\r
+                    ClientSize.Width - 3 * ScaleFactor.Width, 0,\r
+                    2 * ScaleFactor.Width, 5 * ScaleFactor.Height);\r
+            }\r
+            else if ((_slotStatus & SlotStatus.SemiEquipped) != 0)\r
+            {\r
+                e.Graphics.DrawLine(\r
+                    Pens.Black,\r
+                    ClientSize.Width - 1 * ScaleFactor.Width, 0,\r
+                    ClientSize.Width - 1 * ScaleFactor.Width, 5 * ScaleFactor.Height);\r
             }\r
             if ((_slotStatus & SlotStatus.ExtraEmpty) != 0)\r
             {\r
                 e.Graphics.DrawRectangle(\r
                     Pens.Black,\r
-                    ClientSize.Width - 3 * ScaleFactor.Width, 7 * ScaleFactor.Height,\r
+                    ClientSize.Width - 3 * ScaleFactor.Width, 8 * ScaleFactor.Height,\r
                     2 * ScaleFactor.Width, 3 * ScaleFactor.Height);\r
             }\r
         }\r