Skip to content

Commit ddc0106

Browse files
authored
feat(options): add flag to disable challenge-unassociated items (#608)
<!-- Thanks for contributing to Peacock! Here's a bit of a template to help make sure everything relevant is covered. --> ## Scope Adds an option flag `enableIsolatedItems`, paired with `enableMasteryProgression` one. When both are set to `true`, the inventory will function as before. When this flag is `false`, the inventory will not handle items with no unlocking approaches, like the official server, which is also the default option. Disabling mastery progression makes this flag of no use. It can be one of default options of Peacock imo. Meanwhile, takes Banker Pack into Peacock's consideration. ## Test Plan Can "remove" newest items, and when flag's changed to `false` they come back again. ## Checklist <!-- Just a few reminders to make sure everything is perfect. You can place an "X" in the boxes to tick them off. If you have not completed one of the steps below, you can create the pull request as a draft, and then check off the items as you go. When you have completed the checklist, press the "Ready for review" button. --> - [x] I have run Prettier to reformat any changed files - [x] I have verified my changes work
2 parents fa8b16f + 5e365b4 commit ddc0106

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

components/flags.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ export const defaultFlags: Flags = {
5555
desc: "When set to false, mastery progression will be disabled and all unlockables will be awarded at the beginning",
5656
default: true,
5757
},
58+
enableIsolatedUnlockables: {
59+
category: "Gameplay",
60+
title: "enableIsolatedUnlockables",
61+
desc: "Decides if items are unlocked when there are no associated unlocking approaches. Requires enableMasteryProgression to be true.",
62+
default: false,
63+
},
5864
elusivesAreShown: {
5965
category: "Gameplay",
6066
title: "elusivesAreShown",

components/inventory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const DELUXE_DATA = [
7474
...PENICILLIN_UNLOCKABLES,
7575
...TOMORROWLAND_UNLOCKABLES,
7676
...LAMBIC_UNLOCKABLES,
77+
...FRENCHMARTINI_UNLOCKABLES,
7778
]
7879

7980
/**
@@ -197,9 +198,9 @@ function filterUnlockedContent(
197198

198199
if (isEvergreen || isDeluxe) {
199200
acc[0].push(unlockable)
200-
} else {
201+
} else if (getFlag("enableIsolatedUnlockables")) {
201202
/**
202-
* List of untracked items (to award to user until they are tracked to corresponding challenges)
203+
* List of untracked items when they are enabled (to award to user until they are tracked to corresponding challenges)
203204
*/
204205
acc[1].push(unlockable)
205206
}

0 commit comments

Comments
 (0)