1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-22 22:12:45 +01:00

Fix Vanilla planning screen

This commit is contained in:
AnthonyFuller 2023-01-29 04:37:49 +00:00
parent 3a0b9d4a3e
commit 8e0711d7e9
2 changed files with 10 additions and 0 deletions

View File

@ -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<string, any>()
@ -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 || []

View File

@ -305,6 +305,7 @@ export async function planningView(
contractData.Data.Objectives,
contractData.Data.GameChangers || [],
contractData.Metadata.GroupObjectiveDisplayOrder || [],
contractData.Metadata.IsEvergreenSafehouse,
),
GroupData: groupData,
Entrances: