コミットメタ情報

リビジョンfa1c54aacd6df699c8f1c764e1ad02454c9ae7ce (tree)
日時2018-04-03 22:21:31
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

戦況で敵のスロットが余計に表示されるのを直す

変更サマリ

差分

--- a/KancolleSniffer/BattleResultPanel.cs
+++ b/KancolleSniffer/BattleResultPanel.cs
@@ -214,7 +214,7 @@ namespace KancolleSniffer
214214 var ship = enemy.Main[i];
215215 labels[0].SetHp(ship);
216216 labels[1].SetName(ShortenName(ship.Name));
217- _toolTip.SetToolTip(labels[1], string.Join("\r\n", ship.Slot.Select(item => item.Spec.Name)));
217+ _toolTip.SetToolTip(labels[1], GetEqipString(ship));
218218 }
219219 if (enemy.Guard.Length > 0)
220220 {
@@ -226,8 +226,7 @@ namespace KancolleSniffer
226226 var ship = enemy.Guard[i];
227227 labels[0].SetHp(ship);
228228 labels[1].SetName(ShortenName(ship.Name));
229- _toolTip.SetToolTip(labels[1],
230- string.Join("\r\n", ship.Slot.Select(item => item.Spec.Name)));
229+ _toolTip.SetToolTip(labels[1], GetEqipString(ship));
231230 }
232231 }
233232 var enemyLines = enemy.Main.Length + (enemy.Guard.Length > 0 ? enemy.Guard.Length + 1 : 0);
@@ -261,18 +260,15 @@ namespace KancolleSniffer
261260
262261 private string GetEqipString(ShipStatus ship)
263262 {
264- var result = new List<string>();
265- for (var i = 0; i < ship.Slot.Length; i++)
266- {
267- var item = ship.Slot[i];
268- var onslot = ship.OnSlot[i];
269- var max = ship.Spec.MaxEq[i];
270- if (item.Id == -1)
271- continue;
272- result.Add(item.Spec.Name + (item.Spec.IsAircraft ? $" {onslot}/{max}" : ""));
273- }
274- if (ship.SlotEx.Id != 0 && ship.SlotEx.Id != -1)
275- result.Add(ship.SlotEx.Spec.Name);
263+ var result =
264+ (from i in Enumerable.Range(0, ship.Slot.Length)
265+ let item = ship.Slot[i]
266+ where item.Id != -1
267+ select item.Spec.Name + (item.Spec.IsAircraft && ship.OnSlot.Length > 0 && ship.Spec.MaxEq.Length > 0
268+ ? $"{ship.OnSlot[i]}/{ship.Spec.MaxEq[i]}"
269+ : ""));
270+ if (ship.SlotEx.Id > 0)
271+ result = result.Concat(new[] {ship.SlotEx.Spec.Name});
276272 return string.Join("\r\n", result);
277273 }
278274
旧リポジトリブラウザで表示