From 97f0c52e5af5915d5ed33a20daca7c27c94839c6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Mon, 14 Jan 2019 17:42:17 +0900 Subject: [PATCH] =?utf8?q?=E6=88=A6=E6=B3=81=E3=81=A7=E6=94=AF=E6=8F=B4?= =?utf8?q?=E3=81=8C=E6=9D=A5=E3=82=8B=E3=81=AE=E3=82=92=E3=82=8F=E3=81=8B?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KancolleSniffer/Model/BattleInfo.cs | 24 ++++++++++++++++++++++++ KancolleSniffer/View/BattleResultPanel.cs | 12 +++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/KancolleSniffer/Model/BattleInfo.cs b/KancolleSniffer/Model/BattleInfo.cs index 5f20f6e..10db71c 100644 --- a/KancolleSniffer/Model/BattleInfo.cs +++ b/KancolleSniffer/Model/BattleInfo.cs @@ -72,6 +72,7 @@ namespace KancolleSniffer.Model public BattleResult Result { get; set; } public bool EnemyIsCombined => _enemyGuard.Length > 0; public List AirBattleResults { get; } = new List(); + public string SupportType { get; private set; } public class RankPair { @@ -104,6 +105,7 @@ namespace KancolleSniffer.Model Formation = ((dynamic[])json.api_formation).Select(f => f is string ? (int)int.Parse(f) : (int)f) .ToArray(); AirControlLevel = CheckAirControlLevel(json); + SetSupportType(json); ShowResult(false); // 昼戦の結果を夜戦のときに表示する SetupResult(request, json, url.Contains("practice")); FighterPower = CalcFighterPower(); @@ -220,6 +222,28 @@ namespace KancolleSniffer.Model return (int)stage1.api_disp_seiku; } + private void SetSupportType(dynamic json) + { + SupportType = ""; + if (!json.api_support_flag()) + return; + switch ((int)json.api_support_flag) + { + case 1: + SupportType = "空支援"; + break; + case 2: + SupportType = "砲支援"; + break; + case 3: + SupportType = "雷支援"; + break; + case 4: + SupportType = "潜支援"; + break; + } + } + private int[] CalcFighterPower() { var fleets = _shipInfo.Fleets; diff --git a/KancolleSniffer/View/BattleResultPanel.cs b/KancolleSniffer/View/BattleResultPanel.cs index cdba9c4..9b15679 100644 --- a/KancolleSniffer/View/BattleResultPanel.cs +++ b/KancolleSniffer/View/BattleResultPanel.cs @@ -31,10 +31,11 @@ namespace KancolleSniffer.View private readonly List _panelList = new List(); private readonly List _hpLabels = new List(); private readonly BattleInfo.BattleResult[] _result = new BattleInfo.BattleResult[2]; - private Label _phaseLabel, _rankLabel, _cellLabel; + private Label _phaseLabel, _rankLabel, _supportLabel, _cellLabel; private readonly BattleResultRank[] _rank = new BattleResultRank[2]; private readonly InformationPanel _informationPanel; private CellInfo _cellInfo; + private string _supportType; public Spoiler Spoilers { get; set; } @@ -81,6 +82,7 @@ namespace KancolleSniffer.View case BattleState.Unknown: return; } + _supportType = sniffer.Battle.SupportType; if ((Spoilers & Spoiler.BattleResult) != 0) { ShowResult(sniffer.Battle.Result); @@ -182,6 +184,7 @@ namespace KancolleSniffer.View panel.Visible = false; _informationPanel.Visible = false; _rankLabel.Text = ""; + _supportLabel.Text = ""; } private void ShowResult(BattleInfo.BattleResult result) @@ -292,6 +295,7 @@ namespace KancolleSniffer.View { var result = new[] {"完全S", "勝利S", "勝利A", "勝利B", "敗北C", "敗北D", "敗北E"}; _rankLabel.Text = result[(int)rank]; + _supportLabel.Text = _supportType; } public void UpdateCellInfo(CellInfo cellInfo) @@ -315,6 +319,12 @@ namespace KancolleSniffer.View Size = new Size(42, 12) }; Controls.Add(_rankLabel); + _supportLabel = new Label + { + Location = new Point(77, 4), + AutoSize = true + }; + Controls.Add(_supportLabel); _cellLabel = new Label { Location = new Point(0, 4), -- 2.11.0