this.toolTipFighterPower = new System.Windows.Forms.ToolTip(this.components);\r
this.toolTipLoS = new System.Windows.Forms.ToolTip(this.components);\r
this.panelRepairList = new KancolleSniffer.RepairListForMain();\r
+ this.panel7Ships = new System.Windows.Forms.Panel();\r
this.panelHeadquarters.SuspendLayout();\r
this.panelShipInfo.SuspendLayout();\r
this.panelBattleInfo.SuspendLayout();\r
this.panelShipInfo.Controls.Add(this.labelPresetAkashiTimer);\r
this.panelShipInfo.Controls.Add(this.labelGuide);\r
this.panelShipInfo.Controls.Add(this.panelCombinedFleet);\r
+ this.panelShipInfo.Controls.Add(this.panel7Ships);\r
this.panelShipInfo.Controls.Add(this.panelBattleInfo);\r
this.panelShipInfo.Controls.Add(this.labelLoS);\r
this.panelShipInfo.Controls.Add(this.labelLoSCaption);\r
this.panelRepairList.Visible = false;\r
this.panelRepairList.Click += new System.EventHandler(this.panelRepairList_Click);\r
// \r
+ // panel7Ships\r
+ // \r
+ this.panel7Ships.Location = new System.Drawing.Point(0, 0);\r
+ this.panel7Ships.Name = "panel7Ships";\r
+ this.panel7Ships.Size = new System.Drawing.Size(220, 115);\r
+ this.panel7Ships.TabIndex = 0;\r
+ this.panel7Ships.Visible = false;\r
+ // \r
// MainForm\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
private System.Windows.Forms.ToolTip toolTipFighterPower;\r
private System.Windows.Forms.ToolTip toolTipLoS;\r
private RepairListForMain panelRepairList;\r
+ private System.Windows.Forms.Panel panel7Ships;\r
}\r
}\r
\r
\r
public class ShipLabels\r
{\r
- private readonly ShipLabel[][] _labels = new ShipLabel[ShipInfo.MemberCount][];\r
+ private readonly ShipLabel[][] _shiplabels = new ShipLabel[ShipInfo.MemberCount][];\r
+ private readonly ShipLabel[][] _shipLabels7 = new ShipLabel[7][];\r
private readonly ShipLabel[][] _combinedLabels = new ShipLabel[ShipInfo.MemberCount * 2][];\r
private readonly ShipLabel[] _akashiTimers = new ShipLabel[ShipInfo.MemberCount];\r
+ private readonly ShipLabel[] _akashiTimers7 = new ShipLabel[ShipInfo.MemberCount];\r
private readonly ShipLabel[][] _ndockLabels = new ShipLabel[DockInfo.DockCount][];\r
public static Color[] ColumnColors = {SystemColors.Control, Color.FromArgb(255, 250, 250, 250)};\r
private readonly List<ShipLabel> _hpLables = new List<ShipLabel>();\r
\r
public void CreateShipLabels(Control parent, EventHandler onClick)\r
{\r
+ CreateShipLabels(parent, onClick, _shiplabels, 16);\r
+ }\r
+\r
+ public void CreateShipLabels7(Control parent, EventHandler onClick)\r
+ {\r
+ CreateShipLabels(parent, onClick, _shipLabels7, 14);\r
+ }\r
+\r
+ public void CreateShipLabels(Control parent, EventHandler onClick, ShipLabel[][] shipLabels, int lineHeight)\r
+ {\r
parent.SuspendLayout();\r
- const int top = 3, height = 12, lh = 16;\r
+ const int top = 3, height = 12;\r
ShipLabel[] headings;\r
parent.Controls.AddRange(headings = new[]\r
{\r
new ShipLabel {Location = new Point(128, top), Text = "cond", AutoSize = true},\r
new ShipLabel {Location = new Point(163, top), Text = "Lv", AutoSize = true},\r
new ShipLabel {Location = new Point(194, top), Text = "Exp", AutoSize = true},\r
- new ShipLabel {Location = new Point(0, 1), Size = new Size(parent.Width, lh - 1)}\r
+ new ShipLabel {Location = new Point(0, 1), Size = new Size(parent.Width, lineHeight - 1)}\r
});\r
foreach (var label in headings)\r
{\r
label.Scale();\r
label.BackColor = ColumnColors[1];\r
}\r
- for (var i = 0; i < _labels.Length; i++)\r
+ for (var i = 0; i < shipLabels.Length; i++)\r
{\r
- var y = top + lh * (i + 1);\r
- parent.Controls.AddRange(_labels[i] = new[]\r
+ var y = top + lineHeight * (i + 1);\r
+ parent.Controls.AddRange(shipLabels[i] = new[]\r
{\r
new ShipLabel {Location = new Point(129, y), AutoSize = true, AnchorRight = true},\r
new ShipLabel\r
TextAlign = ContentAlignment.MiddleRight\r
},\r
new ShipLabel {Location = new Point(2, y), AutoSize = true}, // 名前のZ-orderを下に\r
- new ShipLabel {Location = new Point(0, y - 2), Size = new Size(parent.Width, lh - 1)}\r
+ new ShipLabel {Location = new Point(0, y - 2), Size = new Size(parent.Width, lineHeight - 1)}\r
});\r
- foreach (var label in _labels[i])\r
+ foreach (var label in shipLabels[i])\r
{\r
label.Scale();\r
label.PresetColor = label.BackColor = ColumnColors[i % 2];\r
label.Click += onClick;\r
}\r
}\r
- _hpLables.AddRange(_labels.Select(record => record[0]));\r
+ _hpLables.AddRange(shipLabels.Select(labels => labels[0]));\r
headings[0].Cursor = Cursors.Hand;\r
headings[0].Click += (sender, ev) =>\r
{\r
\r
public void SetShipLabels(ShipStatus[] statuses)\r
{\r
- for (var i = 0; i < _labels.Length; i++)\r
+ SetShipLabels(statuses, statuses.Length == 7 ? _shipLabels7 : _shiplabels);\r
+ }\r
+\r
+ public void SetShipLabels(ShipStatus[] statuses, ShipLabel[][] shipLabels)\r
+ {\r
+ for (var i = 0; i < shipLabels.Length; i++)\r
{\r
- var labels = _labels[i];\r
+ var labels = shipLabels[i];\r
var s = i < statuses.Length ? statuses[i] : null;\r
labels[0].SetHp(s);\r
labels[1].SetCond(s);\r
\r
public void CreateAkashiTimers(Control parent)\r
{\r
+ CreateAkashiTimers(parent, _akashiTimers, 16);\r
+ }\r
+\r
+ public void CreateAkashiTimers7(Control parent)\r
+ {\r
+ CreateAkashiTimers(parent, _akashiTimers7, 14);\r
+ }\r
+\r
+ public void CreateAkashiTimers(Control parent, ShipLabel[] timerLabels, int lineHeight)\r
+ {\r
parent.SuspendLayout();\r
- for (var i = 0; i < _akashiTimers.Length; i++)\r
+ for (var i = 0; i < timerLabels.Length; i++)\r
{\r
const int x = 55;\r
- var y = 3 + 16 * (i + 1);\r
+ var y = 3 + lineHeight * (i + 1);\r
ShipLabel label;\r
parent.Controls.Add(\r
- label = _akashiTimers[i] =\r
+ label = timerLabels[i] =\r
new ShipLabel\r
{\r
Location = new Point(x, y),\r
});\r
label.BackColor = ColumnColors[i % 2];\r
}\r
- foreach (var label in _akashiTimers)\r
+ foreach (var label in timerLabels)\r
label.Scale();\r
parent.ResumeLayout();\r
}\r
\r
public void AdjustAkashiTimers()\r
{\r
+ AdjustAkashiTimers(_akashiTimers, 16);\r
+ AdjustAkashiTimers(_akashiTimers7, 14);\r
+ }\r
+\r
+ public void AdjustAkashiTimers(ShipLabel[] timers, int lineHeight)\r
+ {\r
var scale = ShipLabel.ScaleFactor;\r
if (scale.Height < 1.2)\r
return;\r
- for (var i = 0; i < _akashiTimers.Length; i++)\r
+ for (var i = 0; i < timers.Length; i++)\r
{\r
const int x = 55;\r
- var y = 3 + 16 * (i + 1);\r
- _akashiTimers[i].Location = new Point((int)Round(x * scale.Width) - 3, (int)Round(y * scale.Height));\r
- _akashiTimers[i].Size = new Size((int)Round(31 * scale.Width) + 1, (int)Round(12 * scale.Height));\r
+ var y = 3 + lineHeight * (i + 1);\r
+ timers[i].Location = new Point((int)Round(x * scale.Width) - 3, (int)Round(y * scale.Height));\r
+ timers[i].Size = new Size((int)Round(31 * scale.Width) + 1, (int)Round(12 * scale.Height));\r
}\r
}\r
\r
public void SetAkashiTimer(ShipStatus[] statuses, AkashiTimer.RepairSpan[] timers)\r
{\r
+ if (statuses.Length == 7)\r
+ {\r
+ SetAkashiTimer(statuses, timers, _akashiTimers7, _shipLabels7);\r
+ }\r
+ else\r
+ {\r
+\r
+ SetAkashiTimer(statuses, timers, _akashiTimers, _shiplabels);\r
+ }\r
+ }\r
+\r
+ public void SetAkashiTimer(ShipStatus[] statuses, AkashiTimer.RepairSpan[] timers, ShipLabel[] timerLabels, ShipLabel[][] shipLabels)\r
+ {\r
var shortest = -1;\r
for (var i = 0; i < timers.Length; i++)\r
{\r
if (shortest == -1 || timers[i].Span < timers[shortest].Span)\r
shortest = i;\r
}\r
- for (var i = 0; i < _akashiTimers.Length; i++)\r
+ for (var i = 0; i < timerLabels.Length; i++)\r
{\r
- var label = _akashiTimers[i];\r
- var labelHp = _labels[i][0];\r
- var labelName = _labels[i][4];\r
+ var label = timerLabels[i];\r
+ var labelHp = shipLabels[i][0];\r
+ var labelName = shipLabels[i][4];\r
if (i >= timers.Length || timers[i].Span == TimeSpan.MinValue)\r
{\r
label.Visible = false;\r