Skip to content

Commit

Permalink
Merge pull request #35 from redstonekasi/experiments-good
Browse files Browse the repository at this point in the history
the good experiments patches:tm:
  • Loading branch information
Cynosphere authored Feb 8, 2024
2 parents cdb9dda + 5d13495 commit 7c4650c
Showing 1 changed file with 6 additions and 34 deletions.
40 changes: 6 additions & 34 deletions packages/core-extensions/src/experiments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,17 @@ import { Patch } from "@moonlight-mod/types";

export const patches: Patch[] = [
{
find: '.displayName="ExperimentStore"',
find: "isStaffEnv:",
replace: {
match: "window.GLOBAL_ENV.RELEASE_CHANNEL",
replacement: '"staging"'
match: /.\.isStaff\(\)/,
replacement: "!0"
}
},
{
find: '.displayName="DeveloperExperimentStore"',
replace: [
{
match: /CONNECTION_OPEN:.,OVERLAY_INITIALIZE:.,CURRENT_USER_UPDATE:./,
replacement: ""
},
{
match: '"production"',
replacement: '"development"'
},
{
match: /get:\(\)=>./,
replacement: "get:()=>true"
}
]
},

{
find: ".HEADER_BAR)",
replace: {
match:
/,(.)\?(\(0,.\.jsx\)\(.{1,3}\.default,{}\)):(\(0,.\.jsx\)\(.{1,3}\.default,{}\))\]/,
replacement: (_, isStaff, StaffHelpButton, HelpButton) =>
`,(moonlight.getConfigOption("experiments","staffSettings")??${isStaff})?${StaffHelpButton}:${HelpButton}]`
}
},
{
find: 'title:"Developer Flags"',
find: '"scientist:triggered"', // Scientist? Triggered.
replace: {
match: /\(null==.\?void 0:.\.isStaff\(\)\)/g,
replacement: (orig: string) =>
`(moonlight.getConfigOption("experiments","staffSettings")?true:${orig})`
match: /(?<=personal_connection_id\|\|)!1/,
replacement: "!0"
}
}
];

0 comments on commit 7c4650c

Please sign in to comment.