1
mirror of https://github.com/thepeacockproject/Peacock synced 2025-02-23 03:35:25 +01:00

Fixed location mastery from not always properly showing in the menus

This commit is contained in:
Lennard Fonteijn 2023-04-02 01:47:08 +02:00 committed by Lennard Fonteijn
parent 307ab08d89
commit bb63c06b31
2 changed files with 17 additions and 15 deletions

View File

@ -170,16 +170,22 @@ export function generateUserCentric(
const played = userData.Extensions?.PeacockPlayedContracts
const id = contractData.Metadata.Id
const completionData = generateCompletionData(
contractData.Metadata.Location,
userId,
gameVersion,
)
const uc: UserCentricContract = {
Contract: contractData,
Data: {
IsLocked: subLocation?.Properties?.IsLocked || false,
LockedReason: "",
LocationLevel: 1,
LocationMaxLevel: 1,
LocationCompletion: 1,
LocationXpLeft: 0,
LocationHideProgression: false,
LocationLevel: completionData.Level,
LocationMaxLevel: completionData.MaxLevel,
LocationCompletion: completionData.Completion,
LocationXpLeft: completionData.XpLeft,
LocationHideProgression: completionData.HideProgression,
ElusiveContractState: "",
IsFeatured: false,
LastPlayedAt:
@ -196,11 +202,7 @@ export function generateUserCentric(
Completed: played[id] === undefined ? false : played[id]?.Completed,
LocationId: subLocation.Id,
ParentLocationId: subLocation.Properties.ParentLocation!,
CompletionData: generateCompletionData(
contractData.Metadata.Location,
userId,
gameVersion,
),
CompletionData: completionData,
DlcName: subLocation.Properties.DlcName!,
DlcImage: subLocation.Properties.DlcImage!,
},

View File

@ -1305,11 +1305,11 @@ export function contractIdToHitObject(
SubLocation: subLocation,
ChallengesCompleted: challengeCompletion.CompletedChallengesCount,
ChallengesTotal: challengeCompletion.ChallengesCount,
LocationLevel: 1,
LocationMaxLevel: 1,
LocationCompletion: 0,
LocationXPLeft: 6000,
LocationHideProgression: false,
LocationLevel: userCentric.Data.LocationLevel,
LocationMaxLevel: userCentric.Data.LocationMaxLevel,
LocationCompletion: userCentric.Data.LocationCompletion,
LocationXPLeft: userCentric.Data.LocationXpLeft,
LocationHideProgression: userCentric.Data.LocationHideProgression,
}
}