OSDN Git Service

ズームしたときに文字が欠けないようにゆとりを持たせる
[kancollesniffer/KancolleSniffer.git] / KancolleSniffer / ShipListPanel.cs
index bce3909..017c71c 100644 (file)
@@ -68,6 +68,8 @@ namespace KancolleSniffer
 \r
         protected override void OnMouseWheel(MouseEventArgs e)\r
         {\r
+            if (!ScrollBar.Visible)\r
+                return;\r
             ScrollBar.Value = Max(ScrollBar.Minimum, Min(ScrollBar.Maximum - ScrollBar.LargeChange + 1,\r
                 ScrollBar.Value - e.Delta * SystemInformation.MouseWheelScrollLines / 120));\r
         }\r
@@ -145,26 +147,43 @@ namespace KancolleSniffer
             {\r
                 if (a == null || b == null)\r
                     throw new ArgumentNullException();\r
-                if (_shipType && a.Spec.ShipType != b.Spec.ShipType)\r
-                    return a.Spec.ShipType - b.Spec.ShipType;\r
-                switch (_order)\r
+                if (_shipType)\r
+                {\r
+                    if (a.Spec.ShipType != b.Spec.ShipType)\r
+                        return a.Spec.ShipType - b.Spec.ShipType;\r
+                    if (a.Level != b.Level)\r
+                    {\r
+                        if (a.Level == 1000)\r
+                            return -1;\r
+                        if (b.Level == 1000)\r
+                            return 1;\r
+                    }\r
+                }\r
+                if (_order == ListForm.SortOrder.Repair && a.RepairTime != b.RepairTime)\r
+                    return (int)(b.RepairTime - a.RepairTime).TotalSeconds;\r
+                if (a.Cond != b.Cond)\r
+                {\r
+                    if (_order == ListForm.SortOrder.CondAscend)\r
+                        return a.Cond - b.Cond;\r
+                    if (_order == ListForm.SortOrder.CondDescend)\r
+                        return b.Cond - a.Cond;\r
+                }\r
+                if (a.Level != b.Level)\r
+                {\r
+                    if (_order == ListForm.SortOrder.ExpToNextAscend)\r
+                        return b.Level - a.Level;\r
+                    if (_order == ListForm.SortOrder.ExpToNextDescend)\r
+                        return a.Level - b.Level;\r
+                    if (!_shipType) // Condが同じかSortOrder.Noneで艦種なし\r
+                        return b.Level - a.Level;\r
+                }\r
+                if (a.ExpToNext != b.ExpToNext)\r
                 {\r
-                    case ListForm.SortOrder.None:\r
-                    case ListForm.SortOrder.ExpToNext:\r
-                        break;\r
-                    case ListForm.SortOrder.Cond:\r
-                        if (a.Cond != b.Cond)\r
-                            return a.Cond - b.Cond;\r
-                        break;\r
-                    case ListForm.SortOrder.Repair:\r
-                        if (a.RepairTime != b.RepairTime)\r
-                            return (int)(b.RepairTime - a.RepairTime).TotalSeconds;\r
-                        break;\r
+                    if (_order == ListForm.SortOrder.ExpToNextAscend)\r
+                        return a.ExpToNext - b.ExpToNext;\r
+                    if (_order == ListForm.SortOrder.ExpToNextDescend)\r
+                        return b.ExpToNext - a.ExpToNext;\r
                 }\r
-                if ((!_shipType || _order == ListForm.SortOrder.ExpToNext) && a.Level != b.Level)\r
-                    return b.Level - a.Level;\r
-                if (_order == ListForm.SortOrder.ExpToNext && a.ExpToNext != b.ExpToNext)\r
-                    return a.ExpToNext - b.ExpToNext;\r
                 if (a.Spec.SortNo != b.Spec.SortNo)\r
                     return a.Spec.SortNo - b.Spec.SortNo;\r
                 return a.Id - b.Id;\r
@@ -222,8 +241,8 @@ namespace KancolleSniffer
             {\r
                 new ShipLabel\r
                 {\r
-                    Location = new Point(91, 2),\r
-                    Size = new Size(23, LabelHeight),\r
+                    Location = new Point(90, 2),\r
+                    Size = new Size(24, LabelHeight),\r
                     TextAlign = ContentAlignment.MiddleRight\r
                 },\r
                 new ShipLabel {Location = new Point(10, 2), AutoSize = true},\r
@@ -291,8 +310,8 @@ namespace KancolleSniffer
                 new ShipLabel {Location = new Point(118, 2), AutoSize = true, AnchorRight = true},\r
                 new ShipLabel\r
                 {\r
-                    Location = new Point(117, 2),\r
-                    Size = new Size(23, height),\r
+                    Location = new Point(116, 2),\r
+                    Size = new Size(24, height),\r
                     TextAlign = ContentAlignment.MiddleRight\r
                 },\r
                 new ShipLabel {Location = new Point(141, 2), AutoSize = true},\r
@@ -329,20 +348,20 @@ namespace KancolleSniffer
                 new ShipLabel {Location = new Point(126, 2), AutoSize = true, AnchorRight = true},\r
                 new ShipLabel\r
                 {\r
-                    Location = new Point(129, 2),\r
-                    Size = new Size(23, height),\r
+                    Location = new Point(128, 2),\r
+                    Size = new Size(24, height),\r
                     TextAlign = ContentAlignment.MiddleRight\r
                 },\r
                 new ShipLabel\r
                 {\r
-                    Location = new Point(155, 2),\r
-                    Size = new Size(23, height),\r
+                    Location = new Point(154, 2),\r
+                    Size = new Size(24, height),\r
                     TextAlign = ContentAlignment.MiddleRight\r
                 },\r
                 new ShipLabel\r
                 {\r
-                    Location = new Point(176, 2),\r
-                    Size = new Size(41, height),\r
+                    Location = new Point(175, 2),\r
+                    Size = new Size(42, height),\r
                     TextAlign = ContentAlignment.MiddleRight\r
                 },\r
                 new ShipLabel {Location = new Point(10, 2), AutoSize = true},\r
@@ -460,7 +479,7 @@ namespace KancolleSniffer
             rpl[0].SetHp(s);\r
             rpl[1].SetLevel(s);\r
             rpl[2].SetRepairTime(s);\r
-            rpl[3].Text = TimeSpan.FromSeconds(s.RepairSecPerHp).ToString(@"mm\:ss");\r
+            rpl[3].Text = s.RepairTimePerHp.ToString(@"mm\:ss");\r
             rpl[4].SetName(s, ShipNameWidth.RepairListFull);\r
             rpl[5].SetFleet(s);\r
             panel.Visible = true;\r