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

Add overrideIndex for plugins adding PlayNext data

This commit is contained in:
AnthonyFuller 2023-04-21 13:17:21 +01:00
parent 1e9406a493
commit 6ecf5b0efb
2 changed files with 21 additions and 5 deletions

View File

@ -21,8 +21,8 @@ import {
contractCreationTutorialId,
DEFAULT_MASTERY_MAXLEVEL,
gameDifficulty,
isSuit,
getMaxProfileLevel,
isSuit,
PEACOCKVERSTRING,
unlockOrderComparer,
uuidRegex,
@ -1407,14 +1407,23 @@ menuDataRouter.get(
)
if (pluginData) {
cats.push(
createPlayNextTile(
if (pluginData.overrideIndex !== undefined) {
cats[pluginData.overrideIndex] = createPlayNextTile(
req.jwt.unique_name,
pluginData.nextContractId,
req.gameVersion,
pluginData.campaignDetails,
),
)
)
} else {
cats.push(
createPlayNextTile(
req.jwt.unique_name,
pluginData.nextContractId,
req.gameVersion,
pluginData.campaignDetails,
),
)
}
}
//#endregion

View File

@ -1408,6 +1408,13 @@ export interface PlayNextGetCampaignsHookReturn {
* An object containing the campaign's details.
*/
campaignDetails: PlayNextCampaignDetails
/**
* An array index for plugins to override play next tiles that Peacock
* internally added
*
* @since v6.3.0
*/
overrideIndex?: number
}
export type SafehouseCategory = {