From 8e0711d7e998d4d8674c0a789b7f481676b249df Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Sun, 29 Jan 2023 04:37:49 +0000 Subject: [PATCH] Fix Vanilla planning screen --- components/contracts/dataGen.ts | 9 +++++++++ components/menus/planning.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/components/contracts/dataGen.ts b/components/contracts/dataGen.ts index dc70ac65..e3e75086 100644 --- a/components/contracts/dataGen.ts +++ b/components/contracts/dataGen.ts @@ -230,12 +230,14 @@ export function generateUserCentric( * @param objectives The objectives. * @param gameChangers The game changers. * @param displayOrder The order in which to display the objectives. + * @param isEvergreenSafehouse Is the contract the Safehouse? * @returns The converted objectives. */ export function mapObjectives( objectives: MissionManifestObjective[], gameChangers: string[], displayOrder: GroupObjectiveDisplayOrderItem[], + isEvergreenSafehouse = false, ): MissionManifestObjective[] { // eslint-disable-next-line @typescript-eslint/no-explicit-any const result = new Map() @@ -247,6 +249,7 @@ export function mapObjectives( true, ) for (const gamechangerId of gameChangers) { + if (isEvergreenSafehouse) break const gameChangerProps = gameChangerData[gamechangerId] if (gameChangerProps) { if (gameChangerProps.IsHidden) { @@ -406,6 +409,12 @@ export function mapObjectives( } } + // This is something to get the main objective to show on the planning menu - AF + if (isEvergreenSafehouse) { + sortedResult.push(result.get("f9cfcf80-9977-4ad1-b3c7-0228a2026b9c")) + resultIds.add("f9cfcf80-9977-4ad1-b3c7-0228a2026b9c") + } + // add each objective or gamechanger that is not already in the result for (const { Id, ExcludeFromScoring, ForceShowOnLoadingScreen } of ( objectives || [] diff --git a/components/menus/planning.ts b/components/menus/planning.ts index f32795d2..c64027d9 100644 --- a/components/menus/planning.ts +++ b/components/menus/planning.ts @@ -305,6 +305,7 @@ export async function planningView( contractData.Data.Objectives, contractData.Data.GameChangers || [], contractData.Metadata.GroupObjectiveDisplayOrder || [], + contractData.Metadata.IsEvergreenSafehouse, ), GroupData: groupData, Entrances: