{\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShipListForm));\r
this.panelShipList = new System.Windows.Forms.Panel();\r
+ this.treeViewItem = new KancolleSniffer.DbTreeView();\r
this.label1 = new System.Windows.Forms.Label();\r
this.label2 = new System.Windows.Forms.Label();\r
this.label4 = new System.Windows.Forms.Label();\r
this.label10 = new System.Windows.Forms.Label();\r
this.label11 = new System.Windows.Forms.Label();\r
this.panelItemHeader = new System.Windows.Forms.Panel();\r
- this.treeViewItem = new KancolleSniffer.DbTreeView();\r
this.panelShipList.SuspendLayout();\r
this.panelGroupHeader.SuspendLayout();\r
this.panelRepairHeader.SuspendLayout();\r
this.panelShipList.Size = new System.Drawing.Size(238, 263);\r
this.panelShipList.TabIndex = 0;\r
// \r
+ // treeViewItem\r
+ // \r
+ this.treeViewItem.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.treeViewItem.Location = new System.Drawing.Point(0, 0);\r
+ this.treeViewItem.Name = "treeViewItem";\r
+ this.treeViewItem.Size = new System.Drawing.Size(236, 261);\r
+ this.treeViewItem.TabIndex = 0;\r
+ // \r
// label1\r
// \r
this.label1.AutoSize = true;\r
"D",\r
"分類",\r
"修復",\r
- "装備"});\r
+ "装備",\r
+ "装着"});\r
this.comboBoxGroup.Location = new System.Drawing.Point(6, 4);\r
this.comboBoxGroup.Name = "comboBoxGroup";\r
this.comboBoxGroup.Size = new System.Drawing.Size(48, 20);\r
this.panelItemHeader.Size = new System.Drawing.Size(166, 19);\r
this.panelItemHeader.TabIndex = 0;\r
// \r
- // treeViewItem\r
- // \r
- this.treeViewItem.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.treeViewItem.Location = new System.Drawing.Point(0, 0);\r
- this.treeViewItem.Name = "treeViewItem";\r
- this.treeViewItem.Size = new System.Drawing.Size(236, 261);\r
- this.treeViewItem.TabIndex = 0;\r
- // \r
// ShipListForm\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
private readonly List<Panel> _checkBoxPanelList = new List<Panel>();\r
private readonly List<ShipLabel[]> _repairLabelList = new List<ShipLabel[]>();\r
private readonly List<Panel> _repairPanelList = new List<Panel>();\r
+ private readonly List<ShipLabel[]> _equipLabelList = new List<ShipLabel[]>();\r
+ private readonly List<Panel> _equipPanelList = new List<Panel>();\r
public const int GroupCount = 4;\r
private readonly HashSet<int>[] _groupSettings = new HashSet<int>[GroupCount];\r
private TreeNode _itemTreeNode;\r
if (InItemList())\r
{\r
HideShipLabels();\r
- if (CreateItemList())\r
+ if (CreateItemNodes())\r
SetTreeViewItem();\r
}\r
else\r
{\r
- CreateShipList();\r
+ if (InEquip())\r
+ CreateEquip();\r
+ else\r
+ CreateShipList();\r
CreateListLabels();\r
SetShipLabels();\r
}\r
_shipList = ships.Concat(types).OrderBy(s => s, new CompareShip(true, InRepairList())).ToArray();\r
}\r
\r
+ private void CreateEquip()\r
+ {\r
+ var list = new List<ShipStatus>();\r
+ var fleet = new[] {"第一艦隊", "第二艦隊", "第三艦隊", "第四艦隊"};\r
+ for (var i = 0; i < fleet.Length; i++)\r
+ {\r
+ list.Add(new ShipStatus {Spec = new ShipSpec {Name = fleet[i]}, Level = 1000});\r
+ foreach (var s in _sniffer.GetShipStatuses(i))\r
+ {\r
+ s.Fleet = -1;\r
+ list.Add(s);\r
+ list.AddRange(\r
+ s.Slot.Where(id => id != -1).Select(\r
+ id => CreateDummyEntry(_sniffer.Item.ItemDict[id].Spec.Name, 500))\r
+ .DefaultIfEmpty(CreateDummyEntry("なし", 500)));\r
+ }\r
+ }\r
+ _shipList = list.ToArray();\r
+ }\r
+\r
+ private ShipStatus CreateDummyEntry(string name, int level)\r
+ {\r
+ return new ShipStatus {Spec = new ShipSpec {Name = name}, Level = level};\r
+ }\r
+\r
private IEnumerable<ShipStatus> FilterByGroup(IEnumerable<ShipStatus> ships)\r
{\r
var g = Array.FindIndex(new[] {"A", "B", "C", "D"}, x => x == comboBoxGroup.Text);\r
}\r
}\r
\r
- private bool CreateItemList()\r
+ private bool CreateItemNodes()\r
{\r
var itemList = _sniffer.ItemList;\r
if (_prevItemList != null && _prevItemList.SequenceEqual(itemList, new ItemStatusComparer()))\r
CreateConfigComponents(i);\r
CreateRepairLabels(i);\r
CreateShipLabels(i);\r
+ CreateEquipLabels(i);\r
}\r
panelShipList.ResumeLayout();\r
}\r
}\r
}\r
\r
+ private void CreateEquipLabels(int i)\r
+ {\r
+ var y = 3 + (LineHeight - 2) * i;\r
+ var lbp = new Panel\r
+ {\r
+ Location = new Point(0, y - 2),\r
+ Size = new Size(PanelWidth, LineHeight - 2),\r
+ BackColor = ShipLabels.ColumnColors[(i + 1) % 2],\r
+ Visible = false\r
+ };\r
+ lbp.Scale(ShipLabel.ScaleFactor);\r
+ lbp.Tag = lbp.Location.Y;\r
+ var labels = new[]\r
+ {\r
+ new ShipLabel {Location = new Point(1, 2), AutoSize = true},\r
+ new ShipLabel {Location = new Point(10, 2), AutoSize = true},\r
+ new ShipLabel {Location = new Point(40, 2), AutoSize = true}\r
+ };\r
+ _equipLabelList.Add(labels);\r
+ _equipPanelList.Add(lbp);\r
+ // ReSharper disable once CoVariantArrayConversion\r
+ lbp.Controls.AddRange(labels);\r
+ panelShipList.Controls.Add(lbp);\r
+ foreach (var label in labels)\r
+ {\r
+ label.Scale();\r
+ label.PresetColor =\r
+ label.BackColor = ShipLabels.ColumnColors[(i + 1) % 2];\r
+ }\r
+ }\r
+\r
private void SetShipLabels()\r
{\r
panelGroupHeader.Visible = InGroupConfig();\r
panelRepairHeader.Visible = InRepairList();\r
- treeViewItem.Visible = InItemList();\r
+ panelItemHeader.Visible = InEquip();\r
panelShipList.SuspendLayout();\r
for (var i = 0; i < _shipList.Length; i++)\r
{\r
_checkBoxPanelList[i].Visible = false;\r
if (!InRepairList())\r
_repairPanelList[i].Visible = false;\r
+ if (!InEquip())\r
+ _equipPanelList[i].Visible = false;\r
}\r
for (var i = 0; i < _shipList.Length; i++)\r
{\r
SetGroupConfig(i);\r
if (InRepairList())\r
SetRepairList(i);\r
+ if (InEquip())\r
+ SetEquip(i);\r
}\r
for (var i = _shipList.Length; i < _labelPanelList.Count; i++)\r
{\r
- _labelPanelList[i].Visible = false;\r
- _checkBoxPanelList[i].Visible = false;\r
- _repairPanelList[i].Visible = false;\r
+ _labelPanelList[i].Visible = _checkBoxPanelList[i].Visible =\r
+ _repairPanelList[i].Visible = _equipPanelList[i].Visible = false;\r
}\r
panelShipList.ResumeLayout();\r
}\r
lbp.Location = new Point(lbp.Left, (int)lbp.Tag + panelShipList.AutoScrollPosition.Y);\r
var s = _shipList[i];\r
var labels = _labelList[i];\r
- for (var c = 0; c < 6; c++)\r
+ for (var c = 0; c < 4; c++)\r
{\r
labels[c].Text = "";\r
labels[c].BackColor = labels[c].PresetColor;\r
lbp.Visible = true;\r
}\r
\r
+ private void SetEquip(int i)\r
+ {\r
+ var lbp = _equipPanelList[i];\r
+ if (!lbp.Visible)\r
+ lbp.Location = new Point(lbp.Left, (int)lbp.Tag + panelShipList.AutoScrollPosition.Y);\r
+ var s = _shipList[i];\r
+ var labels = _equipLabelList[i];\r
+ switch (s.Level)\r
+ {\r
+ case 1000:\r
+ labels[0].Text = s.Name;\r
+ labels[1].SetName("");\r
+ labels[2].Text = "";\r
+ break;\r
+ case 500:\r
+ labels[2].Text = s.Name;\r
+ labels[0].Text = "";\r
+ labels[1].SetName("");\r
+ break;\r
+ default:\r
+ labels[1].SetName(s);\r
+ labels[0].Text = labels[2].Text = "";\r
+ break;\r
+ }\r
+ lbp.Visible = true;\r
+ }\r
+\r
private void SetGroupConfig(int i)\r
{\r
var cbp = _checkBoxPanelList[i];\r
{\r
panelShipList.SuspendLayout();\r
for (var i = 0; i < _shipList.Length; i++)\r
- _labelPanelList[i].Visible = _checkBoxPanelList[i].Visible = _repairPanelList[i].Visible = false;\r
+ _labelPanelList[i].Visible = _checkBoxPanelList[i].Visible =\r
+ _repairPanelList[i].Visible = _equipPanelList[i].Visible = false;\r
panelShipList.ResumeLayout();\r
}\r
\r
return comboBoxGroup.Text == "装備";\r
}\r
\r
+ private bool InEquip()\r
+ {\r
+ return comboBoxGroup.Text == "装着";\r
+ }\r
+\r
private void ShipListForm_Load(object sender, EventArgs e)\r
{\r
panelShipList.Width = (int)Math.Round(PanelWidth * ShipLabel.ScaleFactor.Width) + 3 +\r
\r
private void ShipListForm_KeyPress(object sender, KeyPressEventArgs e)\r
{\r
- var g = Array.FindIndex(new[] {'Z', 'A', 'B', 'C', 'D', 'G', 'R', 'W'}, x => x == char.ToUpper(e.KeyChar));\r
+ var g = Array.FindIndex(new[] {'Z', 'A', 'B', 'C', 'D', 'G', 'R', 'W', 'Q'},\r
+ x => x == char.ToUpper(e.KeyChar));\r
if (g == -1)\r
return;\r
comboBoxGroup.SelectedIndex = g;\r