リビジョン | 97f0c52e5af5915d5ed33a20daca7c27c94839c6 (tree) |
---|---|
日時 | 2019-01-14 17:43:28 |
作者 | Kazuhiro Fujieda <fujieda@user...> |
コミッター | Kazuhiro Fujieda |
戦況で支援が来るのをわかるようにする
@@ -72,6 +72,7 @@ namespace KancolleSniffer.Model | ||
72 | 72 | public BattleResult Result { get; set; } |
73 | 73 | public bool EnemyIsCombined => _enemyGuard.Length > 0; |
74 | 74 | public List<AirBattleResult> AirBattleResults { get; } = new List<AirBattleResult>(); |
75 | + public string SupportType { get; private set; } | |
75 | 76 | |
76 | 77 | public class RankPair |
77 | 78 | { |
@@ -104,6 +105,7 @@ namespace KancolleSniffer.Model | ||
104 | 105 | Formation = ((dynamic[])json.api_formation).Select(f => f is string ? (int)int.Parse(f) : (int)f) |
105 | 106 | .ToArray(); |
106 | 107 | AirControlLevel = CheckAirControlLevel(json); |
108 | + SetSupportType(json); | |
107 | 109 | ShowResult(false); // 昼戦の結果を夜戦のときに表示する |
108 | 110 | SetupResult(request, json, url.Contains("practice")); |
109 | 111 | FighterPower = CalcFighterPower(); |
@@ -220,6 +222,28 @@ namespace KancolleSniffer.Model | ||
220 | 222 | return (int)stage1.api_disp_seiku; |
221 | 223 | } |
222 | 224 | |
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 | + | |
223 | 247 | private int[] CalcFighterPower() |
224 | 248 | { |
225 | 249 | var fleets = _shipInfo.Fleets; |
@@ -31,10 +31,11 @@ namespace KancolleSniffer.View | ||
31 | 31 | private readonly List<Panel> _panelList = new List<Panel>(); |
32 | 32 | private readonly List<ShipLabel> _hpLabels = new List<ShipLabel>(); |
33 | 33 | private readonly BattleInfo.BattleResult[] _result = new BattleInfo.BattleResult[2]; |
34 | - private Label _phaseLabel, _rankLabel, _cellLabel; | |
34 | + private Label _phaseLabel, _rankLabel, _supportLabel, _cellLabel; | |
35 | 35 | private readonly BattleResultRank[] _rank = new BattleResultRank[2]; |
36 | 36 | private readonly InformationPanel _informationPanel; |
37 | 37 | private CellInfo _cellInfo; |
38 | + private string _supportType; | |
38 | 39 | |
39 | 40 | public Spoiler Spoilers { get; set; } |
40 | 41 |
@@ -81,6 +82,7 @@ namespace KancolleSniffer.View | ||
81 | 82 | case BattleState.Unknown: |
82 | 83 | return; |
83 | 84 | } |
85 | + _supportType = sniffer.Battle.SupportType; | |
84 | 86 | if ((Spoilers & Spoiler.BattleResult) != 0) |
85 | 87 | { |
86 | 88 | ShowResult(sniffer.Battle.Result); |
@@ -182,6 +184,7 @@ namespace KancolleSniffer.View | ||
182 | 184 | panel.Visible = false; |
183 | 185 | _informationPanel.Visible = false; |
184 | 186 | _rankLabel.Text = ""; |
187 | + _supportLabel.Text = ""; | |
185 | 188 | } |
186 | 189 | |
187 | 190 | private void ShowResult(BattleInfo.BattleResult result) |
@@ -292,6 +295,7 @@ namespace KancolleSniffer.View | ||
292 | 295 | { |
293 | 296 | var result = new[] {"完全S", "勝利S", "勝利A", "勝利B", "敗北C", "敗北D", "敗北E"}; |
294 | 297 | _rankLabel.Text = result[(int)rank]; |
298 | + _supportLabel.Text = _supportType; | |
295 | 299 | } |
296 | 300 | |
297 | 301 | public void UpdateCellInfo(CellInfo cellInfo) |
@@ -315,6 +319,12 @@ namespace KancolleSniffer.View | ||
315 | 319 | Size = new Size(42, 12) |
316 | 320 | }; |
317 | 321 | Controls.Add(_rankLabel); |
322 | + _supportLabel = new Label | |
323 | + { | |
324 | + Location = new Point(77, 4), | |
325 | + AutoSize = true | |
326 | + }; | |
327 | + Controls.Add(_supportLabel); | |
318 | 328 | _cellLabel = new Label |
319 | 329 | { |
320 | 330 | Location = new Point(0, 4), |