this repo has no description
1import { ExtensionWebpackModule, Patch } from "@moonlight-mod/types";
2
3export const patches: Patch[] = [
4 {
5 find: "Menu API only allows Items and groups of Items as children.",
6 replace: [
7 {
8 match: /(?<=let{navId[^}]+?}=(.),(.)=.\(.\))/,
9 replacement: (_, props, items) =>
10 `,__contextMenu=!${props}.__contextMenu_evilMenu&&require("contextMenu_contextMenu")._patchMenu(${props}, ${items})`
11 }
12 ]
13 },
14 {
15 find: ".getContextMenu(",
16 replace: [
17 {
18 match: /(?<=let\{[^}]+?\}=.;return ).\({[^}]+?}\)/,
19 replacement: (render) =>
20 `require("contextMenu_contextMenu")._saveProps(this,${render})`
21 }
22 ]
23 }
24];
25
26export const webpackModules: Record<string, ExtensionWebpackModule> = {
27 contextMenu: {
28 dependencies: [
29 { ext: "spacepack", id: "spacepack" },
30 "Menu API only allows Items and groups of Items as children."
31 ]
32 },
33 evilMenu: {
34 dependencies: [
35 { ext: "spacepack", id: "spacepack" },
36 "Menu API only allows Items and groups of Items as children."
37 ]
38 }
39};