var ship = enemy.Main[i];\r
labels[0].SetHp(ship);\r
labels[1].SetName(ShortenName(ship.Name));\r
- _toolTip.SetToolTip(labels[1], string.Join("\r\n", ship.Slot.Select(item => item.Spec.Name)));\r
+ _toolTip.SetToolTip(labels[1], GetEqipString(ship));\r
}\r
if (enemy.Guard.Length > 0)\r
{\r
var ship = enemy.Guard[i];\r
labels[0].SetHp(ship);\r
labels[1].SetName(ShortenName(ship.Name));\r
- _toolTip.SetToolTip(labels[1],\r
- string.Join("\r\n", ship.Slot.Select(item => item.Spec.Name)));\r
+ _toolTip.SetToolTip(labels[1], GetEqipString(ship));\r
}\r
}\r
var enemyLines = enemy.Main.Length + (enemy.Guard.Length > 0 ? enemy.Guard.Length + 1 : 0);\r
\r
private string GetEqipString(ShipStatus ship)\r
{\r
- var result = new List<string>();\r
- for (var i = 0; i < ship.Slot.Length; i++)\r
- {\r
- var item = ship.Slot[i];\r
- var onslot = ship.OnSlot[i];\r
- var max = ship.Spec.MaxEq[i];\r
- if (item.Id == -1)\r
- continue;\r
- result.Add(item.Spec.Name + (item.Spec.IsAircraft ? $" {onslot}/{max}" : ""));\r
- }\r
- if (ship.SlotEx.Id != 0 && ship.SlotEx.Id != -1)\r
- result.Add(ship.SlotEx.Spec.Name);\r
+ var result =\r
+ (from i in Enumerable.Range(0, ship.Slot.Length)\r
+ let item = ship.Slot[i]\r
+ where item.Id != -1\r
+ select item.Spec.Name + (item.Spec.IsAircraft && ship.OnSlot.Length > 0 && ship.Spec.MaxEq.Length > 0\r
+ ? $"{ship.OnSlot[i]}/{ship.Spec.MaxEq[i]}"\r
+ : ""));\r
+ if (ship.SlotEx.Id > 0)\r
+ result = result.Concat(new[] {ship.SlotEx.Spec.Name});\r
return string.Join("\r\n", result);\r
}\r
\r