コミットメタ情報

リビジョン9c7302cea2e6f46f0517a88356102cb6ac29c315 (tree)
日時2018-01-27 17:34:04
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

戦況にツールチップで味方の装備を表示する

変更サマリ

差分

--- a/KancolleSniffer/BattleResultPanel.cs
+++ b/KancolleSniffer/BattleResultPanel.cs
@@ -168,8 +168,11 @@ namespace KancolleSniffer
168168 _friendLabels[0][1].Text = fleet[friend.Main[0].Fleet];
169169 for (var i = 0; i < friend.Main.Length; i++)
170170 {
171- _friendLabels[i + 1][0].SetHp(friend.Main[i]);
172- _friendLabels[i + 1][1].SetName(friend.Main[i], ShipNameWidth.BattleResult);
171+ var labels = _friendLabels[i + 1];
172+ var ship = friend.Main[i];
173+ labels[0].SetHp(ship);
174+ labels[1].SetName(ship, ShipNameWidth.BattleResult);
175+ _toolTip.SetToolTip(labels[1], GetEqipString(ship));
173176 }
174177 if (friend.Guard.Length > 0)
175178 {
@@ -178,8 +181,10 @@ namespace KancolleSniffer
178181 for (var i = 0; i < friend.Guard.Length; i++)
179182 {
180183 var labels = _friendLabels[friend.Main.Length + 2 + i];
181- labels[0].SetHp(friend.Guard[i]);
182- labels[1].SetName(friend.Guard[i], ShipNameWidth.BattleResult);
184+ var ship = friend.Guard[i];
185+ labels[0].SetHp(ship);
186+ labels[1].SetName(ship, ShipNameWidth.BattleResult);
187+ _toolTip.SetToolTip(labels[1], GetEqipString(ship));
183188 }
184189 }
185190 var friendLines = 1 + friend.Main.Length + (friend.Guard.Length > 0 ? friend.Guard.Length + 1 : 0);
@@ -192,9 +197,10 @@ namespace KancolleSniffer
192197 for (var i = 0; i < enemy.Main.Length; i++)
193198 {
194199 var labels = _enemyLabels[i + 1];
195- labels[0].SetHp(enemy.Main[i]);
196- labels[1].SetName(ShortenName(enemy.Main[i].Name));
197- _toolTip.SetToolTip(labels[1], string.Join("\r\n", enemy.Main[i].Slot.Select(item => item.Spec.Name)));
200+ var ship = enemy.Main[i];
201+ labels[0].SetHp(ship);
202+ labels[1].SetName(ShortenName(ship.Name));
203+ _toolTip.SetToolTip(labels[1], string.Join("\r\n", ship.Slot.Select(item => item.Spec.Name)));
198204 }
199205 if (enemy.Guard.Length > 0)
200206 {
@@ -203,10 +209,11 @@ namespace KancolleSniffer
203209 for (var i = 0; i < enemy.Guard.Length; i++)
204210 {
205211 var labels = _enemyLabels[enemy.Main.Length + 2 + i];
206- labels[0].SetHp(enemy.Guard[i]);
207- labels[1].SetName(ShortenName(enemy.Guard[i].Name));
212+ var ship = enemy.Guard[i];
213+ labels[0].SetHp(ship);
214+ labels[1].SetName(ShortenName(ship.Name));
208215 _toolTip.SetToolTip(labels[1],
209- string.Join("\r\n", enemy.Guard[i].Slot.Select(item => item.Spec.Name)));
216+ string.Join("\r\n", ship.Slot.Select(item => item.Spec.Name)));
210217 }
211218 }
212219 var enemyLines = 1 + enemy.Main.Length + (enemy.Guard.Length > 0 ? enemy.Guard.Length + 1 : 0);
@@ -236,6 +243,21 @@ namespace KancolleSniffer
236243 _infomationPanel.Visible = true;
237244 }
238245
246+ private string GetEqipString(ShipStatus ship)
247+ {
248+ var result = new List<string>();
249+ for (var i = 0; i < ship.Slot.Length; i++)
250+ {
251+ var item = ship.Slot[i];
252+ var onslot = ship.OnSlot[i];
253+ var max = ship.Spec.MaxEq[i];
254+ if (item.Id == -1)
255+ continue;
256+ result.Add(item.Spec.Name + (item.Spec.IsAircraft ? $" {onslot}/{max}" : ""));
257+ }
258+ return string.Join("\r\n", result);
259+ }
260+
239261 private string ShortenName(string name)
240262 {
241263 return new Regex(@"\(elite\)|\(flagship\)").Replace(name,
旧リポジトリブラウザで表示