this.labelFleet2 = new System.Windows.Forms.Label();\r
this.labelFleet1 = new System.Windows.Forms.Label();\r
this.panelSType = new System.Windows.Forms.Panel();\r
+ this.checkBoxSTypeDetails = new System.Windows.Forms.CheckBox();\r
this.checkBoxSTypeAll = new System.Windows.Forms.CheckBox();\r
this.checkBoxSTypeAuxiliary = new System.Windows.Forms.CheckBox();\r
this.checkBoxSTypeSubmarine = new System.Windows.Forms.CheckBox();\r
this.checkBoxSTypeAircraftCarrier = new System.Windows.Forms.CheckBox();\r
this.checkBoxSTypeBattleShip = new System.Windows.Forms.CheckBox();\r
this.labelSTypeButton = new System.Windows.Forms.Label();\r
+ this.labelSType = new System.Windows.Forms.Label();\r
this.airBattleResultPanel = new KancolleSniffer.View.AirBattleResultPanel();\r
this.battleResultPanel = new KancolleSniffer.View.BattleResultPanel();\r
this.antiAirPanel = new KancolleSniffer.View.AntiAirPanel();\r
this.fleetPanel = new KancolleSniffer.View.FleetPanel();\r
this.itemTreeView = new KancolleSniffer.View.ItemTreeView();\r
this.shipListPanel = new KancolleSniffer.View.ShipListPanel();\r
- this.labelSType = new System.Windows.Forms.Label();\r
this.contextMenuStripShipList.SuspendLayout();\r
this.contextMenuStrip.SuspendLayout();\r
this.panelGroupHeader.SuspendLayout();\r
// panelSType\r
// \r
this.panelSType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
+ this.panelSType.Controls.Add(this.checkBoxSTypeDetails);\r
this.panelSType.Controls.Add(this.checkBoxSTypeAll);\r
this.panelSType.Controls.Add(this.checkBoxSTypeAuxiliary);\r
this.panelSType.Controls.Add(this.checkBoxSTypeSubmarine);\r
this.panelSType.Visible = false;\r
this.panelSType.Click += new System.EventHandler(this.panelSType_Click);\r
// \r
+ // checkBoxSTypeDetails\r
+ // \r
+ this.checkBoxSTypeDetails.AutoSize = true;\r
+ this.checkBoxSTypeDetails.Location = new System.Drawing.Point(49, 45);\r
+ this.checkBoxSTypeDetails.Name = "checkBoxSTypeDetails";\r
+ this.checkBoxSTypeDetails.Size = new System.Drawing.Size(48, 16);\r
+ this.checkBoxSTypeDetails.TabIndex = 9;\r
+ this.checkBoxSTypeDetails.Text = "種別";\r
+ this.checkBoxSTypeDetails.UseVisualStyleBackColor = true;\r
+ this.checkBoxSTypeDetails.Click += new System.EventHandler(this.checkBoxSTypeDetails_Click);\r
+ // \r
// checkBoxSTypeAll\r
// \r
this.checkBoxSTypeAll.AutoSize = true;\r
this.labelSTypeButton.TabIndex = 19;\r
this.labelSTypeButton.Click += new System.EventHandler(this.labelSTypeButton_Click);\r
// \r
+ // labelSType\r
+ // \r
+ this.labelSType.AutoSize = true;\r
+ this.labelSType.Location = new System.Drawing.Point(74, 8);\r
+ this.labelSType.Name = "labelSType";\r
+ this.labelSType.Size = new System.Drawing.Size(29, 12);\r
+ this.labelSType.TabIndex = 20;\r
+ this.labelSType.Text = "艦種";\r
+ this.labelSType.Click += new System.EventHandler(this.labelSTypeButton_Click);\r
+ // \r
// airBattleResultPanel\r
// \r
this.airBattleResultPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
this.shipListPanel.Size = new System.Drawing.Size(238, 263);\r
this.shipListPanel.TabIndex = 0;\r
// \r
- // labelSType\r
- // \r
- this.labelSType.AutoSize = true;\r
- this.labelSType.Location = new System.Drawing.Point(74, 8);\r
- this.labelSType.Name = "labelSType";\r
- this.labelSType.Size = new System.Drawing.Size(29, 12);\r
- this.labelSType.TabIndex = 20;\r
- this.labelSType.Text = "艦種";\r
- this.labelSType.Click += new System.EventHandler(this.labelSTypeButton_Click);\r
- // \r
// ListForm\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
private System.Windows.Forms.CheckBox checkBoxSTypeBattleShip;\r
private System.Windows.Forms.Label labelSTypeButton;\r
private System.Windows.Forms.Label labelSType;\r
+ private System.Windows.Forms.CheckBox checkBoxSTypeDetails;\r
}\r
}
\ No newline at end of file
{\r
var ships = FilterByShipTypes(\r
_mode == "修復" ? sniffer.RepairList : FilterByGroup(sniffer.ShipList, _mode),\r
- config.ShipCategories);\r
+ config.ShipCategories).ToArray();\r
var order = _mode == "修復" ? ListForm.SortOrder.Repair : config.SortOrder;\r
- _shipList = ships.OrderBy(s => s, new CompareShip(false, order)).ToArray();\r
+ if (!config.ShipType)\r
+ {\r
+ _shipList = ships.OrderBy(s => s, new CompareShip(false, order)).ToArray();\r
+ return;\r
+ }\r
+ _shipList = ships.Select(ship => new {Id = ship.Spec.ShipType, Name = ship.Spec.ShipTypeName})\r
+ .Distinct().Select(type => new ShipStatus\r
+ {\r
+ Spec = new ShipSpec { Name = type.Name, ShipType = type.Id},\r
+ Level = 1000,\r
+ }).Concat(ships).OrderBy(ship => ship, new CompareShip(true, order)).ToArray();\r
}\r
\r
private IEnumerable<ShipStatus> FilterByGroup(IEnumerable<ShipStatus> ships, string group)\r
return from s in ships where GroupSettings[g].Contains(s.Id) select s;\r
}\r
\r
- private readonly int[][] _shipTypeIds =\r
+ private static readonly int[][] ShipTypeIds =\r
{\r
new[] // 戦艦\r
{\r
}\r
};\r
\r
+ private static readonly int[] ShipTypeSortIds = CreateShipTypeSortIds();\r
+\r
+ private static int[] CreateShipTypeSortIds()\r
+ {\r
+ var ids = ShipTypeIds.SelectMany(x => x).ToArray();\r
+ var res = new int[ids.Max() + 1];\r
+ for (var i = 0; i < ids.Length; i++)\r
+ res[ids[i]] = i;\r
+ return res;\r
+ }\r
+\r
private IEnumerable<ShipStatus> FilterByShipTypes(IEnumerable<ShipStatus> ships, ShipCategory shipTypes)\r
{\r
- var ids = Enumerable.Range(0, _shipTypeIds.Length)\r
+ var ids = Enumerable.Range(0, ShipTypeIds.Length)\r
.Where(type => ((int)shipTypes & (1 << type)) != 0)\r
- .SelectMany(type => _shipTypeIds[type]).ToArray();\r
+ .SelectMany(type => ShipTypeIds[type]).ToArray();\r
return ships.Where(ship => ids.Contains(ship.Spec.ShipType));\r
}\r
\r
if (_shipType)\r
{\r
if (a.Spec.ShipType != b.Spec.ShipType)\r
- return a.Spec.ShipType - b.Spec.ShipType;\r
+ return ShipTypeSortIds[a.Spec.ShipType] - ShipTypeSortIds[b.Spec.ShipType];\r
if (a.Level != b.Level)\r
{\r
if (a.Level == 1000)\r
if (s.Level == 1000) // 艦種の表示\r
{\r
SetShipType(i);\r
+ panel.Visible = true;\r
return;\r
}\r
labels[0].SetHp(s);\r
labels[4].SetName(null);\r
labels[5].SetFleet(null);\r
labels[5].Text = s.Name;\r
- _labelPanelList[i].Visible = true;\r
}\r
\r
private void SetGrouping(int i)\r