Expose sortie checklist group completion
This commit is contained in:
@@ -9582,6 +9582,8 @@ function assertSortieTacticalRoster(state, requiredUnitIds) {
|
|||||||
typeof state.sortieChecklistSummary?.total !== 'number' ||
|
typeof state.sortieChecklistSummary?.total !== 'number' ||
|
||||||
typeof state.sortieChecklistSummary?.completeCount !== 'number' ||
|
typeof state.sortieChecklistSummary?.completeCount !== 'number' ||
|
||||||
typeof state.sortieChecklistSummary?.complete !== 'boolean' ||
|
typeof state.sortieChecklistSummary?.complete !== 'boolean' ||
|
||||||
|
typeof state.sortieChecklistSummary?.requiredComplete !== 'boolean' ||
|
||||||
|
typeof state.sortieChecklistSummary?.recommendedComplete !== 'boolean' ||
|
||||||
typeof state.sortieChecklistSummary?.requiredRemainingCount !== 'number' ||
|
typeof state.sortieChecklistSummary?.requiredRemainingCount !== 'number' ||
|
||||||
typeof state.sortieChecklistSummary?.recommendedRemainingCount !== 'number' ||
|
typeof state.sortieChecklistSummary?.recommendedRemainingCount !== 'number' ||
|
||||||
(state.sortieChecklistSummary?.nextIncompleteLabel !== null && typeof state.sortieChecklistSummary?.nextIncompleteLabel !== 'string') ||
|
(state.sortieChecklistSummary?.nextIncompleteLabel !== null && typeof state.sortieChecklistSummary?.nextIncompleteLabel !== 'string') ||
|
||||||
|
|||||||
@@ -13799,13 +13799,17 @@ export class CampScene extends Phaser.Scene {
|
|||||||
|
|
||||||
private sortieChecklistSummary(checklist: SortieChecklistItem[]) {
|
private sortieChecklistSummary(checklist: SortieChecklistItem[]) {
|
||||||
const completeCount = checklist.filter((item) => item.complete).length;
|
const completeCount = checklist.filter((item) => item.complete).length;
|
||||||
|
const requiredRemainingCount = checklist.filter((item) => !item.complete && item.priority === 'required').length;
|
||||||
|
const recommendedRemainingCount = checklist.filter((item) => !item.complete && item.priority !== 'required').length;
|
||||||
const nextIncomplete = checklist.find((item) => !item.complete);
|
const nextIncomplete = checklist.find((item) => !item.complete);
|
||||||
return {
|
return {
|
||||||
total: checklist.length,
|
total: checklist.length,
|
||||||
completeCount,
|
completeCount,
|
||||||
complete: completeCount === checklist.length,
|
complete: completeCount === checklist.length,
|
||||||
requiredRemainingCount: checklist.filter((item) => !item.complete && item.priority === 'required').length,
|
requiredComplete: requiredRemainingCount === 0,
|
||||||
recommendedRemainingCount: checklist.filter((item) => !item.complete && item.priority !== 'required').length,
|
recommendedComplete: recommendedRemainingCount === 0,
|
||||||
|
requiredRemainingCount,
|
||||||
|
recommendedRemainingCount,
|
||||||
nextIncompleteLabel: nextIncomplete?.label ?? null,
|
nextIncompleteLabel: nextIncomplete?.label ?? null,
|
||||||
nextIncompleteDetail: nextIncomplete?.detail ?? null,
|
nextIncompleteDetail: nextIncomplete?.detail ?? null,
|
||||||
nextIncompletePriority: nextIncomplete?.priority ?? null
|
nextIncompletePriority: nextIncomplete?.priority ?? null
|
||||||
|
|||||||
Reference in New Issue
Block a user