コミットメタ情報

リビジョン97f0c52e5af5915d5ed33a20daca7c27c94839c6 (tree)
日時2019-01-14 17:43:28
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

戦況で支援が来るのをわかるようにする

変更サマリ

差分

--- a/KancolleSniffer/Model/BattleInfo.cs
+++ b/KancolleSniffer/Model/BattleInfo.cs
@@ -72,6 +72,7 @@ namespace KancolleSniffer.Model
7272 public BattleResult Result { get; set; }
7373 public bool EnemyIsCombined => _enemyGuard.Length > 0;
7474 public List<AirBattleResult> AirBattleResults { get; } = new List<AirBattleResult>();
75+ public string SupportType { get; private set; }
7576
7677 public class RankPair
7778 {
@@ -104,6 +105,7 @@ namespace KancolleSniffer.Model
104105 Formation = ((dynamic[])json.api_formation).Select(f => f is string ? (int)int.Parse(f) : (int)f)
105106 .ToArray();
106107 AirControlLevel = CheckAirControlLevel(json);
108+ SetSupportType(json);
107109 ShowResult(false); // 昼戦の結果を夜戦のときに表示する
108110 SetupResult(request, json, url.Contains("practice"));
109111 FighterPower = CalcFighterPower();
@@ -220,6 +222,28 @@ namespace KancolleSniffer.Model
220222 return (int)stage1.api_disp_seiku;
221223 }
222224
225+ private void SetSupportType(dynamic json)
226+ {
227+ SupportType = "";
228+ if (!json.api_support_flag())
229+ return;
230+ switch ((int)json.api_support_flag)
231+ {
232+ case 1:
233+ SupportType = "空支援";
234+ break;
235+ case 2:
236+ SupportType = "砲支援";
237+ break;
238+ case 3:
239+ SupportType = "雷支援";
240+ break;
241+ case 4:
242+ SupportType = "潜支援";
243+ break;
244+ }
245+ }
246+
223247 private int[] CalcFighterPower()
224248 {
225249 var fleets = _shipInfo.Fleets;
--- a/KancolleSniffer/View/BattleResultPanel.cs
+++ b/KancolleSniffer/View/BattleResultPanel.cs
@@ -31,10 +31,11 @@ namespace KancolleSniffer.View
3131 private readonly List<Panel> _panelList = new List<Panel>();
3232 private readonly List<ShipLabel> _hpLabels = new List<ShipLabel>();
3333 private readonly BattleInfo.BattleResult[] _result = new BattleInfo.BattleResult[2];
34- private Label _phaseLabel, _rankLabel, _cellLabel;
34+ private Label _phaseLabel, _rankLabel, _supportLabel, _cellLabel;
3535 private readonly BattleResultRank[] _rank = new BattleResultRank[2];
3636 private readonly InformationPanel _informationPanel;
3737 private CellInfo _cellInfo;
38+ private string _supportType;
3839
3940 public Spoiler Spoilers { get; set; }
4041
@@ -81,6 +82,7 @@ namespace KancolleSniffer.View
8182 case BattleState.Unknown:
8283 return;
8384 }
85+ _supportType = sniffer.Battle.SupportType;
8486 if ((Spoilers & Spoiler.BattleResult) != 0)
8587 {
8688 ShowResult(sniffer.Battle.Result);
@@ -182,6 +184,7 @@ namespace KancolleSniffer.View
182184 panel.Visible = false;
183185 _informationPanel.Visible = false;
184186 _rankLabel.Text = "";
187+ _supportLabel.Text = "";
185188 }
186189
187190 private void ShowResult(BattleInfo.BattleResult result)
@@ -292,6 +295,7 @@ namespace KancolleSniffer.View
292295 {
293296 var result = new[] {"完全S", "勝利S", "勝利A", "勝利B", "敗北C", "敗北D", "敗北E"};
294297 _rankLabel.Text = result[(int)rank];
298+ _supportLabel.Text = _supportType;
295299 }
296300
297301 public void UpdateCellInfo(CellInfo cellInfo)
@@ -315,6 +319,12 @@ namespace KancolleSniffer.View
315319 Size = new Size(42, 12)
316320 };
317321 Controls.Add(_rankLabel);
322+ _supportLabel = new Label
323+ {
324+ Location = new Point(77, 4),
325+ AutoSize = true
326+ };
327+ Controls.Add(_supportLabel);
318328 _cellLabel = new Label
319329 {
320330 Location = new Point(0, 4),
旧リポジトリブラウザで表示