@amxts/menu-core 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PAWN.md +4 -2
- package/PAWN.ru.md +4 -2
- package/README.md +69 -27
- package/README.ru.md +70 -28
- package/package.json +3 -3
- package/prebuilt/linux/menu-core.aot +0 -0
- package/prebuilt/manifest.json +19 -11
- package/prebuilt/windows/menu-core.aot +0 -0
- package/scripts/docs/src/{index.ts → menus.ts} +35 -21
- package/scripts/docs/src/types.ts +102 -52
- package/src/index.ts +3 -1598
- package/src/internal.ts +350 -328
- package/src/menus.ts +1744 -0
- package/src/natives.ts +11 -11
- package/src/types.ts +69 -39
package/prebuilt/manifest.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": 1,
|
|
3
3
|
"module": "@amxts/menu-core",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"from": {
|
|
6
6
|
"@amxts/core": {
|
|
7
|
-
"version": "0.
|
|
8
|
-
"hash": "
|
|
7
|
+
"version": "0.2.0",
|
|
8
|
+
"hash": "86146344f98b3f7285b3307a254d359d7080ae7c"
|
|
9
9
|
},
|
|
10
10
|
"@amxts/config-core": {
|
|
11
|
-
"version": "0.1.
|
|
12
|
-
"hash": "
|
|
11
|
+
"version": "0.1.1",
|
|
12
|
+
"hash": "1e49ebcfbf431b802df05bacaae593ab563b5119"
|
|
13
13
|
},
|
|
14
14
|
"@amxts/menu-core": {
|
|
15
|
-
"version": "0.
|
|
16
|
-
"hash": "
|
|
15
|
+
"version": "0.2.0",
|
|
16
|
+
"hash": "04c36a880b6e5ac46711963027edc28ae4ef2be9"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"options": {
|
|
@@ -32,8 +32,10 @@
|
|
|
32
32
|
"entities.ts",
|
|
33
33
|
"events.ts",
|
|
34
34
|
"facade.ts",
|
|
35
|
+
"fetch.ts",
|
|
35
36
|
"flags.ts",
|
|
36
37
|
"fs.ts",
|
|
38
|
+
"hlds.ts",
|
|
37
39
|
"hooks.ts",
|
|
38
40
|
"kit.ts",
|
|
39
41
|
"menu-core.ts",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"modules/menu-core.ts",
|
|
50
52
|
"modules/menu-core/src/internal.ts",
|
|
51
53
|
"modules/menu-core/src/menu-file.ts",
|
|
54
|
+
"modules/menu-core/src/menus.ts",
|
|
52
55
|
"modules/menu-core/src/types.ts",
|
|
53
56
|
"natives.ts",
|
|
54
57
|
"os.ts",
|
|
@@ -691,13 +694,18 @@
|
|
|
691
694
|
"systems": {
|
|
692
695
|
"windows": {
|
|
693
696
|
"file": "prebuilt/windows/menu-core.aot",
|
|
694
|
-
"size":
|
|
695
|
-
"sha256": "
|
|
697
|
+
"size": 1548430,
|
|
698
|
+
"sha256": "a3c287f0f4138e240a16eb529418f39f85431653e762be00d16be7bcfa0cb8c1"
|
|
696
699
|
},
|
|
697
700
|
"linux": {
|
|
698
701
|
"file": "prebuilt/linux/menu-core.aot",
|
|
699
|
-
"size":
|
|
700
|
-
"sha256": "
|
|
702
|
+
"size": 1564122,
|
|
703
|
+
"sha256": "2709f65cd2f365ee9e64dcb20de3c9c2fb6def22b743a3fe76b19965e5981cae"
|
|
701
704
|
}
|
|
705
|
+
},
|
|
706
|
+
"surface": {
|
|
707
|
+
"proxy": "// GENERATED by scripts/shared-modules.ts: ~/modules/menu-core in a plugin that does not own it.\n// Each function runs in menu-core.aot, the one instance on the server.\nimport { Reader as __Reader, Writer as __Writer, beginCallback as __beginCallback, callBack as __callBack, receiveFunction as __receiveFunction, remoteTarget as __remoteTarget, sendFunction as __sendFunction, Service as __Service } from \"~/remote\";\nimport { Player as __Player } from \"~/facade\";\nimport { Player, lang } from \"~/facade\";\n\nexport class MenuEvent {\n\t/** A mark of `preventDefault()`: `true` once it was called. */\n\tdefaultPrevented = false;\n\n\tconstructor(\n\t\t/** The player whose menu it is. */\n\t\tpublic player: Player,\n\t\t/** The menu the event is about. */\n\t\tpublic menu: Menu,\n\t\t/** On `\"close\"`: `true` when the menu closed because its time ran out. */\n\t\tpublic timeout: boolean,\n\t) {}\n\n\t/** On `\"show\"`: keeps the menu from opening. */\n\tpreventDefault() {\n\t\tthis.defaultPrevented = true;\n\t}\n}\n\nexport type MenuListener = (event: MenuEvent) => void;\n\nexport type MenuKind = \"items\" | \"list\";\n\nexport interface MenuContext {\n\t/** The player the menu is shown to: who looks at it, and who chooses. */\n\tplayer: Player;\n\t/** The player the menu is about: the row's in a list menu, the one `show()` was given as `target` in an items menu; `player` himself when there is none. */\n\ttarget: Player;\n\t/** The row's number in a list menu, as `listRow()` gave it - e.g. an entity or an index of the source's own; a player's `id` in a list of players. In an items menu, the `id` of the menu's target, `0` without one. */\n\trow: number;\n\t/** The menu the function is asked for. */\n\tmenu: Menu;\n}\n\nexport interface NamedContext extends MenuContext {\n\t/** The name it is asked by: an action's or a placeholder's, a restriction's whole token - `\"NAME:param\"` included; for an action check, the item's action. */\n\tname: string;\n}\n\nexport type MenuText = string | ((context: MenuContext) => string);\n\nexport interface ListRow {\n\t/** The row's kind, one of `\"item\"` (a row to choose) or `\"text\"` (a line of text, not a choice). */\n\tkind: \"item\" | \"text\";\n\t/** The row's number, `row` of the context its item's functions get: e.g. a player's `id`, an entity or an index of the source's own; `0` for a line of text. */\n\ttarget: number;\n\t/** The row's text, put for `%name%` in the menu's row template. */\n\ttext: string;\n\t/** Action names of the row's own, run instead of the template's; `\"\"` for the template's. */\n\taction: string;\n\t/** Restriction names, space-separated: the row is greyed out unless each passes. */\n\trestriction: string;\n\t/** The text beside the row while it is greyed out; `\"\"` for the restriction's own message. */\n\trestrictionMessage: string;\n}\n\nexport interface MenuOptions {\n\t/** The menu's title: the text - a lang key too - or a function that gives it for the menu's context; left out, the menu's name. */\n\ttitle?: MenuText;\n\t/** Seconds on the countdown when the menu opens, e.g. `10`; left out, none. */\n\ttime?: number;\n\t/** Hiding of the `\"Back\"` button: `true` leaves it out. */\n\thideBack?: boolean;\n\t/** Hiding of the `\"Exit\"` button: `true` leaves it out. */\n\thideExit?: boolean;\n\t/** A lock on the menu: while `true`, items cannot be chosen and no other menu replaces this one. */\n\tlocked?: boolean;\n\t/** A test the menu opens under: while it says no, the menu does not open for the player. */\n\tactiveWhen?: (context: MenuContext) => boolean;\n}\n\nexport interface MenuShowOptions {\n\t/** Seconds on the countdown; left out, the countdown running goes on, or the menu's own starts. */\n\ttime?: number;\n\t/** The player the menu is about: `target` of the context its functions get, and `%target%`. */\n\ttarget?: Player;\n\t/** A new way back: `true` forgets the menus this one was opened from. */\n\tresetHistory?: boolean;\n\t/** Opening over a menu that holds on - a countdown, a lock: `true` opens anyway. */\n\tforce?: boolean;\n\t/** Leaving the menu out of the way back: `true` does not remember it. */\n\tskipHistory?: boolean;\n}\n\nexport interface MenuItemOptions {\n\t/** The item's text - a lang key too - or a function that gives it for the menu's context. */\n\ttitle: MenuText;\n\t/** The function run when the item is chosen; the menu is drawn again after it, while it stays open. */\n\tonSelect?: (context: MenuContext) => void;\n\t/** A test the item is shown under: while it says no, the item is left out and takes no slot. */\n\tvisible?: (context: MenuContext) => boolean;\n\t/**\n\t * A test the item can be chosen under - while it says no, the item is\n\t * greyed out with `message` beside it; or a list of requirements, each with\n\t * a message of its own - the first that fails gives its message.\n\t *\n\t * enabled: [\n\t * { when: ({ player }) => player.frags >= 5, message: \"5 frags needed\" },\n\t * { when: ({ player }) => player.armor < 100, message: ({ player }) => `(${player.armor} already)` },\n\t * ],\n\t */\n\tenabled?: ((context: MenuContext) => boolean) | Requirement[];\n\t/** The text beside the item while `enabled` greys it out, for a requirement without a message of its own: the text, e.g. `\"(full)\"`, or a function that gives it for the menu's context. */\n\tmessage?: MenuText;\n\t/** The text after the item's title, for items of menu files and Pawn plugins, placeholders and all, e.g. `\"%hp%\"`; in code the title is a function instead. */\n\tplaceholder?: string;\n\t/** Action names from `addAction()` run when the item is chosen, or a built-in one: `\"SHOW_<MENU>\"`, `\"CLOSE_MENU\"`. */\n\taction?: string;\n\t/** The item's place among the items, from `0`; left out, the end. */\n\tat?: number;\n\t/** Blank lines before the item. */\n\tspaceBefore?: number;\n\t/** Blank lines after the item. */\n\tspaceAfter?: number;\n}\n\nexport interface Requirement {\n\t/** A test the requirement holds under, given the menu's context. */\n\twhen: (context: MenuContext) => boolean;\n\t/** The text beside the item while `when` says no: the text, a lang key, or a function that gives it for the menu's context; left out, the item's `message`. */\n\tmessage?: MenuText;\n}\n\nexport type ConditionTest = (player: Player, viewer: Player, name: string) => boolean;\n\nexport type ActionHandler = (context: NamedContext) => void;\n\nexport type PlaceholderValue = (context: NamedContext) => string;\n\nexport type RestrictionTest = (context: NamedContext) => boolean;\n\nexport type ActionTest = (context: NamedContext) => boolean;\n\nexport type ConditionFilter = (player: Player, viewer: Player, name: string, value: boolean) => boolean;\n\nexport type RowTest = (context: MenuContext) => boolean;\n\nexport type ListSource = (context: MenuContext) => ListRow[] | null;\n\nexport type MenuEventType = \"open\" | \"close\" | \"show\";\n\nexport interface MenuCoreOptions {\n\t/** The menu file, from `configs/`: e.g. `\"menu\"` is `configs/menu.ini`, `menu.yaml`, `menu.yml`, `menu.json` or `menu.jsonc` - the first that is there; `\"myserver/menu.yaml\"` is that file. */\n\tfile: string;\n\t/** The file read instead when `file` is empty or not there, e.g. `\"menu\"` for `configs/menu.ini` or `menu.yaml`; `\"\"` is none. */\n\tfallback: string;\n}\n\n/** Menu in menu-core's plugin: each field is read and written there, each method runs there. */\nexport class Menu {\n\tconstructor(public __handle: i32) {}\n\n\tget kind(): string {\n\t\tconst w = __service.begin(27);\n\t\tw.i32(this.__handle);\n\t\treturn __r0(__service.call(w));\n\t}\n\n\tget hideBack(): bool {\n\t\tconst w = __service.begin(28);\n\t\tw.i32(this.__handle);\n\t\treturn __r1(__service.call(w));\n\t}\n\tset hideBack(value: bool) {\n\t\tconst w = __service.begin(29);\n\t\tw.i32(this.__handle);\n\t\t__w1(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget hideExit(): bool {\n\t\tconst w = __service.begin(30);\n\t\tw.i32(this.__handle);\n\t\treturn __r1(__service.call(w));\n\t}\n\tset hideExit(value: bool) {\n\t\tconst w = __service.begin(31);\n\t\tw.i32(this.__handle);\n\t\t__w1(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget locked(): bool {\n\t\tconst w = __service.begin(32);\n\t\tw.i32(this.__handle);\n\t\treturn __r1(__service.call(w));\n\t}\n\tset locked(value: bool) {\n\t\tconst w = __service.begin(33);\n\t\tw.i32(this.__handle);\n\t\t__w1(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget sharedTimer(): bool {\n\t\tconst w = __service.begin(34);\n\t\tw.i32(this.__handle);\n\t\treturn __r1(__service.call(w));\n\t}\n\tset sharedTimer(value: bool) {\n\t\tconst w = __service.begin(35);\n\t\tw.i32(this.__handle);\n\t\t__w1(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget time(): f64 {\n\t\tconst w = __service.begin(36);\n\t\tw.i32(this.__handle);\n\t\treturn __r2(__service.call(w));\n\t}\n\tset time(value: f64) {\n\t\tconst w = __service.begin(37);\n\t\tw.i32(this.__handle);\n\t\t__w2(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget onTimeout(): string {\n\t\tconst w = __service.begin(38);\n\t\tw.i32(this.__handle);\n\t\treturn __r0(__service.call(w));\n\t}\n\tset onTimeout(value: string) {\n\t\tconst w = __service.begin(39);\n\t\tw.i32(this.__handle);\n\t\t__w0(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget activeOn(): string {\n\t\tconst w = __service.begin(40);\n\t\tw.i32(this.__handle);\n\t\treturn __r0(__service.call(w));\n\t}\n\tset activeOn(value: string) {\n\t\tconst w = __service.begin(41);\n\t\tw.i32(this.__handle);\n\t\t__w0(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget countdown(): f64 {\n\t\tconst w = __service.begin(42);\n\t\tw.i32(this.__handle);\n\t\treturn __r2(__service.call(w));\n\t}\n\tset countdown(value: f64) {\n\t\tconst w = __service.begin(43);\n\t\tw.i32(this.__handle);\n\t\t__w2(w, value);\n\t\t__service.call(w);\n\t}\n\n\tget name(): string {\n\t\tconst w = __service.begin(44);\n\t\tw.i32(this.__handle);\n\t\treturn __r0(__service.call(w));\n\t}\n\n\tget title(): (a0: MenuContext) => string {\n\t\tconst w = __service.begin(45);\n\t\tw.i32(this.__handle);\n\t\treturn __r3(__service.call(w));\n\t}\n\tset title(value: string | ((context: MenuContext) => string)) {\n\t\tconst w = __service.begin(46);\n\t\tw.i32(this.__handle);\n\t\t__w3(w, value);\n\t\t__service.call(w);\n\t}\n\n\taddItem(item: MenuItemOptions): void {\n\t\tconst __w = __service.begin(47);\n\t\t__w.i32(this.__handle);\n\t\t__w4(__w, item);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\taddFixedItem(slot: number, item: MenuItemOptions): void {\n\t\tconst __w = __service.begin(48);\n\t\t__w.i32(this.__handle);\n\t\t__w2(__w, slot);\n\t\t__w4(__w, item);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\tclearItems(): void {\n\t\tconst __w = __service.begin(49);\n\t\t__w.i32(this.__handle);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\taddFilter(test: RowTest, message?: string): void {\n\t\tconst __w = __service.begin(50);\n\t\t__w.i32(this.__handle);\n\t\t__w8(__w, test);\n\t\t__w13(__w, message);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\taddPlaceholder(name: string, value: PlaceholderValue): void {\n\t\tconst __w = __service.begin(51);\n\t\t__w.i32(this.__handle);\n\t\t__w0(__w, name);\n\t\t__w14(__w, value);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\tsetListSource(rows: ListSource): void {\n\t\tconst __w = __service.begin(52);\n\t\t__w.i32(this.__handle);\n\t\t__w15(__w, rows);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\taddEventListener(type: MenuEventType, listener: MenuListener): void {\n\t\tconst __w = __service.begin(53);\n\t\t__w.i32(this.__handle);\n\t\t__w0(__w, type);\n\t\t__w16(__w, listener);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\tshow(player: Player, options: MenuShowOptions = {}): bool {\n\t\tconst __w = __service.begin(54);\n\t\t__w.i32(this.__handle);\n\t\t__w17(__w, player);\n\t\t__w18(__w, options);\n\t\tconst __r = __service.call(__w);\n\t\treturn __r1(__r);\n\t}\n\n\trunActions(player: Player, line: string, target?: Player): void {\n\t\tconst __w = __service.begin(55);\n\t\t__w.i32(this.__handle);\n\t\t__w17(__w, player);\n\t\t__w0(__w, line);\n\t\t__w19(__w, target);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\trefresh(): f64 {\n\t\tconst __w = __service.begin(56);\n\t\t__w.i32(this.__handle);\n\t\tconst __r = __service.call(__w);\n\t\treturn __r2(__r);\n\t}\n\n\tclose(): void {\n\t\tconst __w = __service.begin(57);\n\t\t__w.i32(this.__handle);\n\t\tconst __r = __service.call(__w);\n\t}\n\n\tsetTimer(seconds: number): bool {\n\t\tconst __w = __service.begin(58);\n\t\t__w.i32(this.__handle);\n\t\t__w2(__w, seconds);\n\t\tconst __r = __service.call(__w);\n\t\treturn __r1(__r);\n\t}\n\n\tcancelTimer(): bool {\n\t\tconst __w = __service.begin(59);\n\t\t__w.i32(this.__handle);\n\t\tconst __r = __service.call(__w);\n\t\treturn __r1(__r);\n\t}\n}\n\n\n\nconst __service = new __Service(\"menu-core\", 1989640665);\n\nfunction __w0(w: __Writer, v: string): void { w.str(v); }\n\nfunction __r0(r: __Reader): string { return r.str(); }\n\nfunction __w1(w: __Writer, v: bool): void { w.bool(v); }\n\nfunction __r1(r: __Reader): bool { return r.bool(); }\n\nfunction __w2(w: __Writer, v: f64): void { w.f64(<f64>v); }\n\nfunction __r2(r: __Reader): f64 { return <f64>r.f64(); }\n\nfunction __w3(w: __Writer, v: (a0: MenuContext) => string): void { w.i32(__sendFunction(changetype<usize>(v), 0, __invoke)); }\n\nfunction __r3(r: __Reader): (a0: MenuContext) => string { return changetype<(a0: MenuContext) => string>(__receiveFunction(r, changetype<usize>(__stub0))); }\n\nfunction __w6(w: __Writer, v: (a0: MenuContext) => void): void { w.i32(__sendFunction(changetype<usize>(v), 9, __invoke)); }\n\nfunction __r6(r: __Reader): (a0: MenuContext) => void { return changetype<(a0: MenuContext) => void>(__receiveFunction(r, changetype<usize>(__stub9))); }\n\nfunction __w5(w: __Writer, v: ((a0: MenuContext) => void) | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w6(w, v!);\n}\n\nfunction __r5(r: __Reader): ((a0: MenuContext) => void) | null {\n\tif (!r.bool()) return null;\n\treturn __r6(r);\n}\n\nfunction __w8(w: __Writer, v: (a0: MenuContext) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 1, __invoke)); }\n\nfunction __r8(r: __Reader): (a0: MenuContext) => bool { return changetype<(a0: MenuContext) => bool>(__receiveFunction(r, changetype<usize>(__stub1))); }\n\nfunction __w7(w: __Writer, v: ((a0: MenuContext) => bool) | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w8(w, v!);\n}\n\nfunction __r7(r: __Reader): ((a0: MenuContext) => bool) | null {\n\tif (!r.bool()) return null;\n\treturn __r8(r);\n}\n\nfunction __w12(w: __Writer, v: ((a0: MenuContext) => string) | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w3(w, v!);\n}\n\nfunction __r12(r: __Reader): ((a0: MenuContext) => string) | null {\n\tif (!r.bool()) return null;\n\treturn __r3(r);\n}\n\nfunction __w11(w: __Writer, v: Requirement): void {\n\t__w8(w, v.when);\n\t__w12(w, v.message);\n}\n\nfunction __u11(r: __Reader, o: Requirement): void {\n\to.when = __r8(r);\n\to.message = __r12(r);\n}\n\nfunction __r11(r: __Reader): Requirement {\n\tconst o = changetype<Requirement>(__new(offsetof<Requirement>(), idof<Requirement>()));\n\t__u11(r, o);\n\treturn o;\n}\n\nfunction __w10(w: __Writer, v: Array<Requirement>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w11(w, v[i]);\n}\n\nfunction __r10(r: __Reader): Array<Requirement> {\n\tconst count = r.i32();\n\tconst list = new Array<Requirement>();\n\tfor (let i: i32 = 0; i < count; i++) list.push(__r11(r));\n\treturn list;\n}\n\nfunction __w9(w: __Writer, v: Array<Requirement> | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w10(w, v!);\n}\n\nfunction __r9(r: __Reader): Array<Requirement> | null {\n\tif (!r.bool()) return null;\n\treturn __r10(r);\n}\n\nfunction __w13(w: __Writer, v: string | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w0(w, v!);\n}\n\nfunction __r13(r: __Reader): string | null {\n\tif (!r.bool()) return null;\n\treturn __r0(r);\n}\n\nfunction __w4(w: __Writer, v: MenuItemOptions): void {\n\t__w3(w, v.title);\n\t__w5(w, v.onSelect);\n\t__w7(w, v.visible);\n\t__w9(w, v.enabled);\n\t__w12(w, v.message);\n\t__w13(w, v.placeholder);\n\t__w13(w, v.action);\n\t__w2(w, v.at);\n\t__w2(w, v.spaceBefore);\n\t__w2(w, v.spaceAfter);\n}\n\nfunction __u4(r: __Reader, o: MenuItemOptions): void {\n\to.title = __r3(r);\n\to.onSelect = __r5(r);\n\to.visible = __r7(r);\n\to.enabled = __r9(r);\n\to.message = __r12(r);\n\to.placeholder = __r13(r);\n\to.action = __r13(r);\n\to.at = __r2(r);\n\to.spaceBefore = __r2(r);\n\to.spaceAfter = __r2(r);\n}\n\nfunction __r4(r: __Reader): MenuItemOptions {\n\tconst o = changetype<MenuItemOptions>(__new(offsetof<MenuItemOptions>(), idof<MenuItemOptions>()));\n\t__u4(r, o);\n\treturn o;\n}\n\nfunction __w14(w: __Writer, v: (a0: NamedContext) => string): void { w.i32(__sendFunction(changetype<usize>(v), 4, __invoke)); }\n\nfunction __r14(r: __Reader): (a0: NamedContext) => string { return changetype<(a0: NamedContext) => string>(__receiveFunction(r, changetype<usize>(__stub4))); }\n\nfunction __w15(w: __Writer, v: (a0: MenuContext) => Array<ListRow> | null): void { w.i32(__sendFunction(changetype<usize>(v), 7, __invoke)); }\n\nfunction __r15(r: __Reader): (a0: MenuContext) => Array<ListRow> | null { return changetype<(a0: MenuContext) => Array<ListRow> | null>(__receiveFunction(r, changetype<usize>(__stub7))); }\n\nfunction __w16(w: __Writer, v: (a0: MenuEvent) => void): void { w.i32(__sendFunction(changetype<usize>(v), 8, __invoke)); }\n\nfunction __r16(r: __Reader): (a0: MenuEvent) => void { return changetype<(a0: MenuEvent) => void>(__receiveFunction(r, changetype<usize>(__stub8))); }\n\nfunction __w17(w: __Writer, v: __Player): void { w.i32(<i32>v.id); }\n\nfunction __r17(r: __Reader): __Player { return new __Player(r.i32()); }\n\nfunction __w19(w: __Writer, v: __Player | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w17(w, v!);\n}\n\nfunction __r19(r: __Reader): __Player | null {\n\tif (!r.bool()) return null;\n\treturn __r17(r);\n}\n\nfunction __w18(w: __Writer, v: MenuShowOptions): void {\n\t__w2(w, v.time);\n\t__w19(w, v.target);\n\tw.bool(v.resetHistory !== undefined);\n\tif (v.resetHistory !== undefined) __w1(w, v.resetHistory);\n\tw.bool(v.force !== undefined);\n\tif (v.force !== undefined) __w1(w, v.force);\n\tw.bool(v.skipHistory !== undefined);\n\tif (v.skipHistory !== undefined) __w1(w, v.skipHistory);\n}\n\nfunction __u18(r: __Reader, o: MenuShowOptions): void {\n\to.time = __r2(r);\n\to.target = __r19(r);\n\tif (r.bool()) o.resetHistory = __r1(r);\n\telse o.resetHistory = undefined;\n\tif (r.bool()) o.force = __r1(r);\n\telse o.force = undefined;\n\tif (r.bool()) o.skipHistory = __r1(r);\n\telse o.skipHistory = undefined;\n}\n\nfunction __r18(r: __Reader): MenuShowOptions {\n\tconst o = changetype<MenuShowOptions>(__new(offsetof<MenuShowOptions>(), idof<MenuShowOptions>()));\n\t__u18(r, o);\n\treturn o;\n}\n\nconst __h21 = new Map<i32, Menu>();\n\nfunction __w21(w: __Writer, v: Menu): void { w.i32(v.__handle); }\n\nfunction __r21(r: __Reader): Menu {\n\tconst id = r.i32();\n\tif (__h21.has(id)) return __h21.get(id);\n\tconst o = new Menu(id);\n\t__h21.set(id, o);\n\treturn o;\n}\n\nfunction __w20(w: __Writer, v: Menu | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w21(w, v!);\n}\n\nfunction __r20(r: __Reader): Menu | null {\n\tif (!r.bool()) return null;\n\treturn __r21(r);\n}\n\nfunction __w22(w: __Writer, v: i32): void { w.f64(<f64>v); }\n\nfunction __r22(r: __Reader): i32 { return <i32>r.f64(); }\n\nfunction __w23(w: __Writer, v: MenuOptions): void {\n\t__w12(w, v.title);\n\t__w2(w, v.time);\n\tw.bool(v.hideBack !== undefined);\n\tif (v.hideBack !== undefined) __w1(w, v.hideBack);\n\tw.bool(v.hideExit !== undefined);\n\tif (v.hideExit !== undefined) __w1(w, v.hideExit);\n\tw.bool(v.locked !== undefined);\n\tif (v.locked !== undefined) __w1(w, v.locked);\n\t__w7(w, v.activeWhen);\n}\n\nfunction __u23(r: __Reader, o: MenuOptions): void {\n\to.title = __r12(r);\n\to.time = __r2(r);\n\tif (r.bool()) o.hideBack = __r1(r);\n\telse o.hideBack = undefined;\n\tif (r.bool()) o.hideExit = __r1(r);\n\telse o.hideExit = undefined;\n\tif (r.bool()) o.locked = __r1(r);\n\telse o.locked = undefined;\n\to.activeWhen = __r7(r);\n}\n\nfunction __r23(r: __Reader): MenuOptions {\n\tconst o = changetype<MenuOptions>(__new(offsetof<MenuOptions>(), idof<MenuOptions>()));\n\t__u23(r, o);\n\treturn o;\n}\n\nfunction __w24(w: __Writer, v: (a0: __Player, a1: __Player, a2: string) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 2, __invoke)); }\n\nfunction __r24(r: __Reader): (a0: __Player, a1: __Player, a2: string) => bool { return changetype<(a0: __Player, a1: __Player, a2: string) => bool>(__receiveFunction(r, changetype<usize>(__stub2))); }\n\nfunction __w25(w: __Writer, v: (a0: NamedContext) => void): void { w.i32(__sendFunction(changetype<usize>(v), 3, __invoke)); }\n\nfunction __r25(r: __Reader): (a0: NamedContext) => void { return changetype<(a0: NamedContext) => void>(__receiveFunction(r, changetype<usize>(__stub3))); }\n\nfunction __w26(w: __Writer, v: (a0: NamedContext) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 5, __invoke)); }\n\nfunction __r26(r: __Reader): (a0: NamedContext) => bool { return changetype<(a0: NamedContext) => bool>(__receiveFunction(r, changetype<usize>(__stub5))); }\n\nfunction __w27(w: __Writer, v: (a0: __Player, a1: __Player, a2: string, a3: bool) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 6, __invoke)); }\n\nfunction __r27(r: __Reader): (a0: __Player, a1: __Player, a2: string, a3: bool) => bool { return changetype<(a0: __Player, a1: __Player, a2: string, a3: bool) => bool>(__receiveFunction(r, changetype<usize>(__stub6))); }\n\nfunction __w28(w: __Writer, v: ListRow): void {\n\t__w0(w, v.kind);\n\t__w2(w, v.target);\n\t__w0(w, v.text);\n\t__w0(w, v.action);\n\t__w0(w, v.restriction);\n\t__w0(w, v.restrictionMessage);\n}\n\nfunction __u28(r: __Reader, o: ListRow): void {\n\to.kind = __r0(r);\n\to.target = __r2(r);\n\to.text = __r0(r);\n\to.action = __r0(r);\n\to.restriction = __r0(r);\n\to.restrictionMessage = __r0(r);\n}\n\nfunction __r28(r: __Reader): ListRow {\n\tconst o = changetype<ListRow>(__new(offsetof<ListRow>(), idof<ListRow>()));\n\t__u28(r, o);\n\treturn o;\n}\n\nfunction __w29(w: __Writer, v: MenuContext): void {\n\t__w17(w, v.player);\n\t__w17(w, v.target);\n\t__w2(w, v.row);\n\t__w21(w, v.menu);\n}\n\nfunction __u29(r: __Reader, o: MenuContext): void {\n\to.player = __r17(r);\n\to.target = __r17(r);\n\to.row = __r2(r);\n\to.menu = __r21(r);\n}\n\nfunction __r29(r: __Reader): MenuContext {\n\tconst o = changetype<MenuContext>(__new(offsetof<MenuContext>(), idof<MenuContext>()));\n\t__u29(r, o);\n\treturn o;\n}\n\nfunction __w30(w: __Writer, v: NamedContext): void {\n\t__w17(w, v.player);\n\t__w17(w, v.target);\n\t__w2(w, v.row);\n\t__w21(w, v.menu);\n\t__w0(w, v.name);\n}\n\nfunction __u30(r: __Reader, o: NamedContext): void {\n\to.player = __r17(r);\n\to.target = __r17(r);\n\to.row = __r2(r);\n\to.menu = __r21(r);\n\to.name = __r0(r);\n}\n\nfunction __r30(r: __Reader): NamedContext {\n\tconst o = changetype<NamedContext>(__new(offsetof<NamedContext>(), idof<NamedContext>()));\n\t__u30(r, o);\n\treturn o;\n}\n\nfunction __w32(w: __Writer, v: Array<ListRow>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w28(w, v[i]);\n}\n\nfunction __r32(r: __Reader): Array<ListRow> {\n\tconst count = r.i32();\n\tconst list = new Array<ListRow>();\n\tfor (let i: i32 = 0; i < count; i++) list.push(__r28(r));\n\treturn list;\n}\n\nfunction __w31(w: __Writer, v: Array<ListRow> | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w32(w, v!);\n}\n\nfunction __r31(r: __Reader): Array<ListRow> | null {\n\tif (!r.bool()) return null;\n\treturn __r32(r);\n}\n\nfunction __w33(w: __Writer, v: MenuEvent): void {\n\t__w1(w, v.defaultPrevented);\n\t__w17(w, v.player);\n\t__w21(w, v.menu);\n\t__w1(w, v.timeout);\n}\n\nfunction __u33(r: __Reader, o: MenuEvent): void {\n\to.defaultPrevented = __r1(r);\n\to.player = __r17(r);\n\to.menu = __r21(r);\n\to.timeout = __r1(r);\n}\n\nfunction __r33(r: __Reader): MenuEvent {\n\tconst o = changetype<MenuEvent>(__new(offsetof<MenuEvent>(), idof<MenuEvent>()));\n\t__u33(r, o);\n\treturn o;\n}\n\nfunction __stub0(a0: MenuContext): string {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r0(r);\n}\n\nfunction __stub1(a0: MenuContext): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r1(r);\n}\n\nfunction __stub2(a0: __Player, a1: __Player, a2: string): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w17(w, a0);\n\t__w17(w, a1);\n\t__w0(w, a2);\n\tconst r = __callBack(target, w);\n\treturn __r1(r);\n}\n\nfunction __stub3(a0: NamedContext): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w30(w, a0);\n\tconst r = __callBack(target, w);\n}\n\nfunction __stub4(a0: NamedContext): string {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w30(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r0(r);\n}\n\nfunction __stub5(a0: NamedContext): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w30(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r1(r);\n}\n\nfunction __stub6(a0: __Player, a1: __Player, a2: string, a3: bool): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w17(w, a0);\n\t__w17(w, a1);\n\t__w0(w, a2);\n\t__w1(w, a3);\n\tconst r = __callBack(target, w);\n\treturn __r1(r);\n}\n\nfunction __stub7(a0: MenuContext): Array<ListRow> | null {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r31(r);\n}\n\nfunction __stub8(a0: MenuEvent): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w33(w, a0);\n\tconst r = __callBack(target, w);\n\t__u33(r, a0);\n}\n\nfunction __stub9(a0: MenuContext): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n}\n\nfunction __invoke(fn: usize, sig: i32, r: __Reader, w: __Writer): void {\n\tswitch (sig) {\n\t\tcase 0: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: MenuContext) => string>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w0(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 1: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: MenuContext) => bool>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w1(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 2: {\n\t\t\tconst a0 = __r17(r);\n\t\t\tconst a1 = __r17(r);\n\t\t\tconst a2 = __r0(r);\n\t\t\tconst f = changetype<(a0: __Player, a1: __Player, a2: string) => bool>(fn);\n\t\t\tconst result = f(a0, a1, a2);\n\t\t\t__w1(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 3: {\n\t\t\tconst a0 = __r30(r);\n\t\t\tconst f = changetype<(a0: NamedContext) => void>(fn);\n\t\t\tf(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 4: {\n\t\t\tconst a0 = __r30(r);\n\t\t\tconst f = changetype<(a0: NamedContext) => string>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w0(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 5: {\n\t\t\tconst a0 = __r30(r);\n\t\t\tconst f = changetype<(a0: NamedContext) => bool>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w1(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 6: {\n\t\t\tconst a0 = __r17(r);\n\t\t\tconst a1 = __r17(r);\n\t\t\tconst a2 = __r0(r);\n\t\t\tconst a3 = __r1(r);\n\t\t\tconst f = changetype<(a0: __Player, a1: __Player, a2: string, a3: bool) => bool>(fn);\n\t\t\tconst result = f(a0, a1, a2, a3);\n\t\t\t__w1(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 7: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: MenuContext) => Array<ListRow> | null>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w31(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 8: {\n\t\t\tconst a0 = __r33(r);\n\t\t\tconst f = changetype<(a0: MenuEvent) => void>(fn);\n\t\t\tf(a0);\n\t\t\t__w33(w, a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: MenuContext) => void>(fn);\n\t\t\tf(a0);\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nexport function setConfigFile(file: string, fallback?: string): void {\n\tconst __w = __service.begin(0);\n\t__w0(__w, file);\n\t__w13(__w, fallback);\n\tconst __r = __service.call(__w);\n}\n\nexport function find(name: string): Menu | null {\n\tconst __w = __service.begin(1);\n\t__w0(__w, name);\n\tconst __r = __service.call(__w);\n\treturn __r20(__r);\n}\n\nexport function indexOf(menu: Menu | null): i32 {\n\tconst __w = __service.begin(2);\n\t__w20(__w, menu);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function menuAt(index: number): Menu | null {\n\tconst __w = __service.begin(3);\n\t__w2(__w, index);\n\tconst __r = __service.call(__w);\n\treturn __r20(__r);\n}\n\nexport function register(name: string): Menu | null {\n\tconst __w = __service.begin(4);\n\t__w0(__w, name);\n\tconst __r = __service.call(__w);\n\treturn __r20(__r);\n}\n\nexport function create(name: string, options: MenuOptions = {}): Menu {\n\tconst __w = __service.begin(5);\n\t__w0(__w, name);\n\t__w23(__w, options);\n\tconst __r = __service.call(__w);\n\treturn __r21(__r);\n}\n\nexport function addCondition(name: string, test: ConditionTest): i32 {\n\tconst __w = __service.begin(6);\n\t__w0(__w, name);\n\t__w24(__w, test);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function addAction(name: string, run: ActionHandler): i32 {\n\tconst __w = __service.begin(7);\n\t__w0(__w, name);\n\t__w25(__w, run);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function addPlaceholder(name: string, value: PlaceholderValue): i32 {\n\tconst __w = __service.begin(8);\n\t__w0(__w, name);\n\t__w14(__w, value);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function addRestriction(name: string, test: RestrictionTest, message?: string): i32 {\n\tconst __w = __service.begin(9);\n\t__w0(__w, name);\n\t__w26(__w, test);\n\t__w13(__w, message);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function addActionCheck(menu: string, action: string, test: ActionTest): i32 {\n\tconst __w = __service.begin(10);\n\t__w0(__w, menu);\n\t__w0(__w, action);\n\t__w26(__w, test);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function addConditionFilter(name: string, filter: ConditionFilter): i32 {\n\tconst __w = __service.begin(11);\n\t__w0(__w, name);\n\t__w27(__w, filter);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function setListSource(menu: string, rows: ListSource): i32 {\n\tconst __w = __service.begin(12);\n\t__w0(__w, menu);\n\t__w15(__w, rows);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function addEventListener(type: MenuEventType, listener: MenuListener): i32 {\n\tconst __w = __service.begin(13);\n\t__w0(__w, type);\n\t__w16(__w, listener);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function listRow(target: number, text: string, action?: string, restriction?: string, restrictionMessage?: string): ListRow {\n\tconst __w = __service.begin(14);\n\t__w2(__w, target);\n\t__w0(__w, text);\n\t__w13(__w, action);\n\t__w13(__w, restriction);\n\t__w13(__w, restrictionMessage);\n\tconst __r = __service.call(__w);\n\treturn __r28(__r);\n}\n\nexport function textRow(text: string, centered = false): ListRow {\n\tconst __w = __service.begin(15);\n\t__w0(__w, text);\n\t__w1(__w, centered);\n\tconst __r = __service.call(__w);\n\treturn __r28(__r);\n}\n\nexport function show(player: Player, name: string, options: MenuShowOptions = {}): bool {\n\tconst __w = __service.begin(16);\n\t__w17(__w, player);\n\t__w0(__w, name);\n\t__w18(__w, options);\n\tconst __r = __service.call(__w);\n\treturn __r1(__r);\n}\n\nexport function close(player: Player, timeout = false): void {\n\tconst __w = __service.begin(17);\n\t__w17(__w, player);\n\t__w1(__w, timeout);\n\tconst __r = __service.call(__w);\n}\n\nexport function refresh(names: string): f64 {\n\tconst __w = __service.begin(18);\n\t__w0(__w, names);\n\tconst __r = __service.call(__w);\n\treturn __r2(__r);\n}\n\nexport function conditionChanged(name: string): void {\n\tconst __w = __service.begin(19);\n\t__w0(__w, name);\n\tconst __r = __service.call(__w);\n}\n\nexport function activeMenu(player: Player): Menu | null {\n\tconst __w = __service.begin(20);\n\t__w17(__w, player);\n\tconst __r = __service.call(__w);\n\treturn __r20(__r);\n}\n\nexport function shownText(player: Player): string {\n\tconst __w = __service.begin(21);\n\t__w17(__w, player);\n\tconst __r = __service.call(__w);\n\treturn __r0(__r);\n}\n\nexport function lock(player: Player, locked = true): void {\n\tconst __w = __service.begin(22);\n\t__w17(__w, player);\n\t__w1(__w, locked);\n\tconst __r = __service.call(__w);\n}\n\nexport function isLocked(player: Player): bool {\n\tconst __w = __service.begin(23);\n\t__w17(__w, player);\n\tconst __r = __service.call(__w);\n\treturn __r1(__r);\n}\n\nexport function setPage(player: Player, page: number): void {\n\tconst __w = __service.begin(24);\n\t__w17(__w, player);\n\t__w2(__w, page);\n\tconst __r = __service.call(__w);\n}\n\nexport function hasAction(name: string): bool {\n\tconst __w = __service.begin(25);\n\t__w0(__w, name);\n\tconst __r = __service.call(__w);\n\treturn __r1(__r);\n}\n\nexport function hasText(name: string): bool {\n\tconst __w = __service.begin(26);\n\t__w0(__w, name);\n\tconst __r = __service.call(__w);\n\treturn __r1(__r);\n}\n",
|
|
708
|
+
"serve": "// GENERATED by scripts/shared-modules.ts: ~/modules/menu-core, run by this plugin for every other.\nimport { Reader as __Reader, Writer as __Writer, beginCallback as __beginCallback, callBack as __callBack, receiveFunction as __receiveFunction, remoteTarget as __remoteTarget, sendFunction as __sendFunction, Handles as __Handles, serve as __serve } from \"~/remote\";\nimport * as __m from \"~/modules/menu-core\";\nimport { Player as __Player } from \"~/facade\";\nimport { Menu as __M_Menu, MenuContext as __M_MenuContext, MenuOptions as __M_MenuOptions, NamedContext as __M_NamedContext, ListRow as __M_ListRow, MenuEvent as __M_MenuEvent, MenuShowOptions as __M_MenuShowOptions, MenuItemOptions as __M_MenuItemOptions, Requirement as __M_Requirement } from \"~/modules/menu-core\";\n\nconst __handles = new __Handles();\n// The exported objects are handles 1, 2, ... - the numbers the proxies have.\n\nfunction __dispatch(op: i32, r: __Reader, w: __Writer): void {\n\tswitch (op) {\n\t\tcase 0: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r1(r);\n\t\t\t__m.setConfigFile(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 1: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst result = __m.find(a0);\n\t\t\t__w2(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 2: {\n\t\t\tconst a0 = __r2(r);\n\t\t\tconst result = __m.indexOf(a0);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 3: {\n\t\t\tconst a0 = __r5(r);\n\t\t\tconst result = __m.menuAt(a0);\n\t\t\t__w2(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 4: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst result = __m.register(a0);\n\t\t\t__w2(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 5: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r6(r);\n\t\t\tconst result = __m.create(a0, a1);\n\t\t\t__w3(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 6: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r12(r);\n\t\t\tconst result = __m.addCondition(a0, a1);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 7: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r13(r);\n\t\t\tconst result = __m.addAction(a0, a1);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 8: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r14(r);\n\t\t\tconst result = __m.addPlaceholder(a0, a1);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r15(r);\n\t\t\tconst a2 = __r1(r);\n\t\t\tconst result = __m.addRestriction(a0, a1, a2);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 10: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r0(r);\n\t\t\tconst a2 = __r15(r);\n\t\t\tconst result = __m.addActionCheck(a0, a1, a2);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 11: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r16(r);\n\t\t\tconst result = __m.addConditionFilter(a0, a1);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 12: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r17(r);\n\t\t\tconst result = __m.setListSource(a0, a1);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 13: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r18(r);\n\t\t\tconst result = __m.addEventListener(a0, a1);\n\t\t\t__w4(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 14: {\n\t\t\tconst a0 = __r5(r);\n\t\t\tconst a1 = __r0(r);\n\t\t\tconst a2 = __r1(r);\n\t\t\tconst a3 = __r1(r);\n\t\t\tconst a4 = __r1(r);\n\t\t\tconst result = __m.listRow(a0, a1, a2, a3, a4);\n\t\t\t__w19(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 15: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r9(r);\n\t\t\tconst result = __m.textRow(a0, a1);\n\t\t\t__w19(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 16: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r0(r);\n\t\t\tconst a2 = __r21(r);\n\t\t\tconst result = __m.show(a0, a1, a2);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 17: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r9(r);\n\t\t\t__m.close(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 18: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst result = __m.refresh(a0);\n\t\t\t__w5(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 19: {\n\t\t\tconst a0 = __r0(r);\n\t\t\t__m.conditionChanged(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 20: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst result = __m.activeMenu(a0);\n\t\t\t__w2(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 21: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst result = __m.shownText(a0);\n\t\t\t__w0(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 22: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r9(r);\n\t\t\t__m.lock(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 23: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst result = __m.isLocked(a0);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 24: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r5(r);\n\t\t\t__m.setPage(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 25: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst result = __m.hasAction(a0);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 26: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst result = __m.hasText(a0);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 27: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w0(w, o.kind);\n\t\t\tbreak;\n\t\t}\n\t\tcase 28: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w9(w, o.hideBack);\n\t\t\tbreak;\n\t\t}\n\t\tcase 29: {\n\t\t\tconst o = __r3(r);\n\t\t\to.hideBack = __r9(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 30: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w9(w, o.hideExit);\n\t\t\tbreak;\n\t\t}\n\t\tcase 31: {\n\t\t\tconst o = __r3(r);\n\t\t\to.hideExit = __r9(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 32: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w9(w, o.locked);\n\t\t\tbreak;\n\t\t}\n\t\tcase 33: {\n\t\t\tconst o = __r3(r);\n\t\t\to.locked = __r9(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 34: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w9(w, o.sharedTimer);\n\t\t\tbreak;\n\t\t}\n\t\tcase 35: {\n\t\t\tconst o = __r3(r);\n\t\t\to.sharedTimer = __r9(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 36: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w5(w, o.time);\n\t\t\tbreak;\n\t\t}\n\t\tcase 37: {\n\t\t\tconst o = __r3(r);\n\t\t\to.time = __r5(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 38: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w0(w, o.onTimeout);\n\t\t\tbreak;\n\t\t}\n\t\tcase 39: {\n\t\t\tconst o = __r3(r);\n\t\t\to.onTimeout = __r0(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 40: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w0(w, o.activeOn);\n\t\t\tbreak;\n\t\t}\n\t\tcase 41: {\n\t\t\tconst o = __r3(r);\n\t\t\to.activeOn = __r0(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 42: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w5(w, o.countdown);\n\t\t\tbreak;\n\t\t}\n\t\tcase 43: {\n\t\t\tconst o = __r3(r);\n\t\t\to.countdown = __r5(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 44: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w0(w, o.name);\n\t\t\tbreak;\n\t\t}\n\t\tcase 45: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w8(w, o.title);\n\t\t\tbreak;\n\t\t}\n\t\tcase 46: {\n\t\t\tconst o = __r3(r);\n\t\t\to.title = __r8(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 47: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r23(r);\n\t\t\to.addItem(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 48: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r5(r);\n\t\t\tconst a1 = __r23(r);\n\t\t\to.addFixedItem(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 49: {\n\t\t\tconst o = __r3(r);\n\t\t\to.clearItems();\n\t\t\tbreak;\n\t\t}\n\t\tcase 50: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r11(r);\n\t\t\tconst a1 = __r1(r);\n\t\t\to.addFilter(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 51: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r14(r);\n\t\t\to.addPlaceholder(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 52: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r17(r);\n\t\t\to.setListSource(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 53: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r18(r);\n\t\t\to.addEventListener(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 54: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r21(r);\n\t\t\tconst result = o.show(a0, a1);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 55: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r0(r);\n\t\t\tconst a2 = __r22(r);\n\t\t\to.runActions(a0, a1, a2);\n\t\t\tbreak;\n\t\t}\n\t\tcase 56: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst result = o.refresh();\n\t\t\t__w5(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 57: {\n\t\t\tconst o = __r3(r);\n\t\t\to.close();\n\t\t\tbreak;\n\t\t}\n\t\tcase 58: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r5(r);\n\t\t\tconst result = o.setTimer(a0);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 59: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst result = o.cancelTimer();\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction __stub0(a0: __M_MenuContext): string {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r0(r);\n}\n\nfunction __stub1(a0: __M_MenuContext): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r9(r);\n}\n\nfunction __stub2(a0: __Player, a1: __Player, a2: string): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w20(w, a0);\n\t__w20(w, a1);\n\t__w0(w, a2);\n\tconst r = __callBack(target, w);\n\treturn __r9(r);\n}\n\nfunction __stub3(a0: __M_NamedContext): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w30(w, a0);\n\tconst r = __callBack(target, w);\n}\n\nfunction __stub4(a0: __M_NamedContext): string {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w30(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r0(r);\n}\n\nfunction __stub5(a0: __M_NamedContext): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w30(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r9(r);\n}\n\nfunction __stub6(a0: __Player, a1: __Player, a2: string, a3: bool): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w20(w, a0);\n\t__w20(w, a1);\n\t__w0(w, a2);\n\t__w9(w, a3);\n\tconst r = __callBack(target, w);\n\treturn __r9(r);\n}\n\nfunction __stub7(a0: __M_MenuContext): Array<__M_ListRow> | null {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r31(r);\n}\n\nfunction __stub8(a0: __M_MenuEvent): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w33(w, a0);\n\tconst r = __callBack(target, w);\n\t__u33(r, a0);\n}\n\nfunction __stub9(a0: __M_MenuContext): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w29(w, a0);\n\tconst r = __callBack(target, w);\n}\n\nfunction __invoke(fn: usize, sig: i32, r: __Reader, w: __Writer): void {\n\tswitch (sig) {\n\t\tcase 0: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: __M_MenuContext) => string>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w0(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 1: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: __M_MenuContext) => bool>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 2: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r20(r);\n\t\t\tconst a2 = __r0(r);\n\t\t\tconst f = changetype<(a0: __Player, a1: __Player, a2: string) => bool>(fn);\n\t\t\tconst result = f(a0, a1, a2);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 3: {\n\t\t\tconst a0 = __r30(r);\n\t\t\tconst f = changetype<(a0: __M_NamedContext) => void>(fn);\n\t\t\tf(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 4: {\n\t\t\tconst a0 = __r30(r);\n\t\t\tconst f = changetype<(a0: __M_NamedContext) => string>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w0(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 5: {\n\t\t\tconst a0 = __r30(r);\n\t\t\tconst f = changetype<(a0: __M_NamedContext) => bool>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 6: {\n\t\t\tconst a0 = __r20(r);\n\t\t\tconst a1 = __r20(r);\n\t\t\tconst a2 = __r0(r);\n\t\t\tconst a3 = __r9(r);\n\t\t\tconst f = changetype<(a0: __Player, a1: __Player, a2: string, a3: bool) => bool>(fn);\n\t\t\tconst result = f(a0, a1, a2, a3);\n\t\t\t__w9(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 7: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: __M_MenuContext) => Array<__M_ListRow> | null>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w31(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 8: {\n\t\t\tconst a0 = __r33(r);\n\t\t\tconst f = changetype<(a0: __M_MenuEvent) => void>(fn);\n\t\t\tf(a0);\n\t\t\t__w33(w, a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: {\n\t\t\tconst a0 = __r29(r);\n\t\t\tconst f = changetype<(a0: __M_MenuContext) => void>(fn);\n\t\t\tf(a0);\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction __w0(w: __Writer, v: string): void { w.str(v); }\n\nfunction __r0(r: __Reader): string { return r.str(); }\n\nfunction __w1(w: __Writer, v: string | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w0(w, v!);\n}\n\nfunction __r1(r: __Reader): string | null {\n\tif (!r.bool()) return null;\n\treturn __r0(r);\n}\n\nfunction __w3(w: __Writer, v: __M_Menu): void { w.i32(__handles.id(changetype<usize>(v))); }\n\nfunction __r3(r: __Reader): __M_Menu { return changetype<__M_Menu>(__handles.at(r.i32())); }\n\nfunction __w2(w: __Writer, v: __M_Menu | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w3(w, v!);\n}\n\nfunction __r2(r: __Reader): __M_Menu | null {\n\tif (!r.bool()) return null;\n\treturn __r3(r);\n}\n\nfunction __w4(w: __Writer, v: i32): void { w.f64(<f64>v); }\n\nfunction __r4(r: __Reader): i32 { return <i32>r.f64(); }\n\nfunction __w5(w: __Writer, v: f64): void { w.f64(<f64>v); }\n\nfunction __r5(r: __Reader): f64 { return <f64>r.f64(); }\n\nfunction __w8(w: __Writer, v: (a0: __M_MenuContext) => string): void { w.i32(__sendFunction(changetype<usize>(v), 0, __invoke)); }\n\nfunction __r8(r: __Reader): (a0: __M_MenuContext) => string { return changetype<(a0: __M_MenuContext) => string>(__receiveFunction(r, changetype<usize>(__stub0))); }\n\nfunction __w7(w: __Writer, v: ((a0: __M_MenuContext) => string) | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w8(w, v!);\n}\n\nfunction __r7(r: __Reader): ((a0: __M_MenuContext) => string) | null {\n\tif (!r.bool()) return null;\n\treturn __r8(r);\n}\n\nfunction __w9(w: __Writer, v: bool): void { w.bool(v); }\n\nfunction __r9(r: __Reader): bool { return r.bool(); }\n\nfunction __w11(w: __Writer, v: (a0: __M_MenuContext) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 1, __invoke)); }\n\nfunction __r11(r: __Reader): (a0: __M_MenuContext) => bool { return changetype<(a0: __M_MenuContext) => bool>(__receiveFunction(r, changetype<usize>(__stub1))); }\n\nfunction __w10(w: __Writer, v: ((a0: __M_MenuContext) => bool) | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w11(w, v!);\n}\n\nfunction __r10(r: __Reader): ((a0: __M_MenuContext) => bool) | null {\n\tif (!r.bool()) return null;\n\treturn __r11(r);\n}\n\nfunction __w6(w: __Writer, v: __M_MenuOptions): void {\n\t__w7(w, v.title);\n\t__w5(w, v.time);\n\tw.bool(v.hideBack !== undefined);\n\tif (v.hideBack !== undefined) __w9(w, v.hideBack);\n\tw.bool(v.hideExit !== undefined);\n\tif (v.hideExit !== undefined) __w9(w, v.hideExit);\n\tw.bool(v.locked !== undefined);\n\tif (v.locked !== undefined) __w9(w, v.locked);\n\t__w10(w, v.activeWhen);\n}\n\nfunction __u6(r: __Reader, o: __M_MenuOptions): void {\n\to.title = __r7(r);\n\to.time = __r5(r);\n\tif (r.bool()) o.hideBack = __r9(r);\n\telse o.hideBack = undefined;\n\tif (r.bool()) o.hideExit = __r9(r);\n\telse o.hideExit = undefined;\n\tif (r.bool()) o.locked = __r9(r);\n\telse o.locked = undefined;\n\to.activeWhen = __r10(r);\n}\n\nfunction __r6(r: __Reader): __M_MenuOptions {\n\tconst o = changetype<__M_MenuOptions>(__new(offsetof<__M_MenuOptions>(), idof<__M_MenuOptions>()));\n\t__u6(r, o);\n\treturn o;\n}\n\nfunction __w12(w: __Writer, v: (a0: __Player, a1: __Player, a2: string) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 2, __invoke)); }\n\nfunction __r12(r: __Reader): (a0: __Player, a1: __Player, a2: string) => bool { return changetype<(a0: __Player, a1: __Player, a2: string) => bool>(__receiveFunction(r, changetype<usize>(__stub2))); }\n\nfunction __w13(w: __Writer, v: (a0: __M_NamedContext) => void): void { w.i32(__sendFunction(changetype<usize>(v), 3, __invoke)); }\n\nfunction __r13(r: __Reader): (a0: __M_NamedContext) => void { return changetype<(a0: __M_NamedContext) => void>(__receiveFunction(r, changetype<usize>(__stub3))); }\n\nfunction __w14(w: __Writer, v: (a0: __M_NamedContext) => string): void { w.i32(__sendFunction(changetype<usize>(v), 4, __invoke)); }\n\nfunction __r14(r: __Reader): (a0: __M_NamedContext) => string { return changetype<(a0: __M_NamedContext) => string>(__receiveFunction(r, changetype<usize>(__stub4))); }\n\nfunction __w15(w: __Writer, v: (a0: __M_NamedContext) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 5, __invoke)); }\n\nfunction __r15(r: __Reader): (a0: __M_NamedContext) => bool { return changetype<(a0: __M_NamedContext) => bool>(__receiveFunction(r, changetype<usize>(__stub5))); }\n\nfunction __w16(w: __Writer, v: (a0: __Player, a1: __Player, a2: string, a3: bool) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 6, __invoke)); }\n\nfunction __r16(r: __Reader): (a0: __Player, a1: __Player, a2: string, a3: bool) => bool { return changetype<(a0: __Player, a1: __Player, a2: string, a3: bool) => bool>(__receiveFunction(r, changetype<usize>(__stub6))); }\n\nfunction __w17(w: __Writer, v: (a0: __M_MenuContext) => Array<__M_ListRow> | null): void { w.i32(__sendFunction(changetype<usize>(v), 7, __invoke)); }\n\nfunction __r17(r: __Reader): (a0: __M_MenuContext) => Array<__M_ListRow> | null { return changetype<(a0: __M_MenuContext) => Array<__M_ListRow> | null>(__receiveFunction(r, changetype<usize>(__stub7))); }\n\nfunction __w18(w: __Writer, v: (a0: __M_MenuEvent) => void): void { w.i32(__sendFunction(changetype<usize>(v), 8, __invoke)); }\n\nfunction __r18(r: __Reader): (a0: __M_MenuEvent) => void { return changetype<(a0: __M_MenuEvent) => void>(__receiveFunction(r, changetype<usize>(__stub8))); }\n\nfunction __w19(w: __Writer, v: __M_ListRow): void {\n\t__w0(w, v.kind);\n\t__w5(w, v.target);\n\t__w0(w, v.text);\n\t__w0(w, v.action);\n\t__w0(w, v.restriction);\n\t__w0(w, v.restrictionMessage);\n}\n\nfunction __u19(r: __Reader, o: __M_ListRow): void {\n\to.kind = __r0(r);\n\to.target = __r5(r);\n\to.text = __r0(r);\n\to.action = __r0(r);\n\to.restriction = __r0(r);\n\to.restrictionMessage = __r0(r);\n}\n\nfunction __r19(r: __Reader): __M_ListRow {\n\tconst o = changetype<__M_ListRow>(__new(offsetof<__M_ListRow>(), idof<__M_ListRow>()));\n\t__u19(r, o);\n\treturn o;\n}\n\nfunction __w20(w: __Writer, v: __Player): void { w.i32(<i32>v.id); }\n\nfunction __r20(r: __Reader): __Player { return new __Player(r.i32()); }\n\nfunction __w22(w: __Writer, v: __Player | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w20(w, v!);\n}\n\nfunction __r22(r: __Reader): __Player | null {\n\tif (!r.bool()) return null;\n\treturn __r20(r);\n}\n\nfunction __w21(w: __Writer, v: __M_MenuShowOptions): void {\n\t__w5(w, v.time);\n\t__w22(w, v.target);\n\tw.bool(v.resetHistory !== undefined);\n\tif (v.resetHistory !== undefined) __w9(w, v.resetHistory);\n\tw.bool(v.force !== undefined);\n\tif (v.force !== undefined) __w9(w, v.force);\n\tw.bool(v.skipHistory !== undefined);\n\tif (v.skipHistory !== undefined) __w9(w, v.skipHistory);\n}\n\nfunction __u21(r: __Reader, o: __M_MenuShowOptions): void {\n\to.time = __r5(r);\n\to.target = __r22(r);\n\tif (r.bool()) o.resetHistory = __r9(r);\n\telse o.resetHistory = undefined;\n\tif (r.bool()) o.force = __r9(r);\n\telse o.force = undefined;\n\tif (r.bool()) o.skipHistory = __r9(r);\n\telse o.skipHistory = undefined;\n}\n\nfunction __r21(r: __Reader): __M_MenuShowOptions {\n\tconst o = changetype<__M_MenuShowOptions>(__new(offsetof<__M_MenuShowOptions>(), idof<__M_MenuShowOptions>()));\n\t__u21(r, o);\n\treturn o;\n}\n\nfunction __w25(w: __Writer, v: (a0: __M_MenuContext) => void): void { w.i32(__sendFunction(changetype<usize>(v), 9, __invoke)); }\n\nfunction __r25(r: __Reader): (a0: __M_MenuContext) => void { return changetype<(a0: __M_MenuContext) => void>(__receiveFunction(r, changetype<usize>(__stub9))); }\n\nfunction __w24(w: __Writer, v: ((a0: __M_MenuContext) => void) | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w25(w, v!);\n}\n\nfunction __r24(r: __Reader): ((a0: __M_MenuContext) => void) | null {\n\tif (!r.bool()) return null;\n\treturn __r25(r);\n}\n\nfunction __w28(w: __Writer, v: __M_Requirement): void {\n\t__w11(w, v.when);\n\t__w7(w, v.message);\n}\n\nfunction __u28(r: __Reader, o: __M_Requirement): void {\n\to.when = __r11(r);\n\to.message = __r7(r);\n}\n\nfunction __r28(r: __Reader): __M_Requirement {\n\tconst o = changetype<__M_Requirement>(__new(offsetof<__M_Requirement>(), idof<__M_Requirement>()));\n\t__u28(r, o);\n\treturn o;\n}\n\nfunction __w27(w: __Writer, v: Array<__M_Requirement>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w28(w, v[i]);\n}\n\nfunction __r27(r: __Reader): Array<__M_Requirement> {\n\tconst count = r.i32();\n\tconst list = new Array<__M_Requirement>();\n\tfor (let i: i32 = 0; i < count; i++) list.push(__r28(r));\n\treturn list;\n}\n\nfunction __w26(w: __Writer, v: Array<__M_Requirement> | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w27(w, v!);\n}\n\nfunction __r26(r: __Reader): Array<__M_Requirement> | null {\n\tif (!r.bool()) return null;\n\treturn __r27(r);\n}\n\nfunction __w23(w: __Writer, v: __M_MenuItemOptions): void {\n\t__w8(w, v.title);\n\t__w24(w, v.onSelect);\n\t__w10(w, v.visible);\n\t__w26(w, v.enabled);\n\t__w7(w, v.message);\n\t__w1(w, v.placeholder);\n\t__w1(w, v.action);\n\t__w5(w, v.at);\n\t__w5(w, v.spaceBefore);\n\t__w5(w, v.spaceAfter);\n}\n\nfunction __u23(r: __Reader, o: __M_MenuItemOptions): void {\n\to.title = __r8(r);\n\to.onSelect = __r24(r);\n\to.visible = __r10(r);\n\to.enabled = __r26(r);\n\to.message = __r7(r);\n\to.placeholder = __r1(r);\n\to.action = __r1(r);\n\to.at = __r5(r);\n\to.spaceBefore = __r5(r);\n\to.spaceAfter = __r5(r);\n}\n\nfunction __r23(r: __Reader): __M_MenuItemOptions {\n\tconst o = changetype<__M_MenuItemOptions>(__new(offsetof<__M_MenuItemOptions>(), idof<__M_MenuItemOptions>()));\n\t__u23(r, o);\n\treturn o;\n}\n\nfunction __w29(w: __Writer, v: __M_MenuContext): void {\n\t__w20(w, v.player);\n\t__w20(w, v.target);\n\t__w5(w, v.row);\n\t__w3(w, v.menu);\n}\n\nfunction __u29(r: __Reader, o: __M_MenuContext): void {\n\to.player = __r20(r);\n\to.target = __r20(r);\n\to.row = __r5(r);\n\to.menu = __r3(r);\n}\n\nfunction __r29(r: __Reader): __M_MenuContext {\n\tconst o = changetype<__M_MenuContext>(__new(offsetof<__M_MenuContext>(), idof<__M_MenuContext>()));\n\t__u29(r, o);\n\treturn o;\n}\n\nfunction __w30(w: __Writer, v: __M_NamedContext): void {\n\t__w20(w, v.player);\n\t__w20(w, v.target);\n\t__w5(w, v.row);\n\t__w3(w, v.menu);\n\t__w0(w, v.name);\n}\n\nfunction __u30(r: __Reader, o: __M_NamedContext): void {\n\to.player = __r20(r);\n\to.target = __r20(r);\n\to.row = __r5(r);\n\to.menu = __r3(r);\n\to.name = __r0(r);\n}\n\nfunction __r30(r: __Reader): __M_NamedContext {\n\tconst o = changetype<__M_NamedContext>(__new(offsetof<__M_NamedContext>(), idof<__M_NamedContext>()));\n\t__u30(r, o);\n\treturn o;\n}\n\nfunction __w32(w: __Writer, v: Array<__M_ListRow>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w19(w, v[i]);\n}\n\nfunction __r32(r: __Reader): Array<__M_ListRow> {\n\tconst count = r.i32();\n\tconst list = new Array<__M_ListRow>();\n\tfor (let i: i32 = 0; i < count; i++) list.push(__r19(r));\n\treturn list;\n}\n\nfunction __w31(w: __Writer, v: Array<__M_ListRow> | null): void {\n\tif (v == null) {\n\t\tw.bool(false);\n\t\treturn;\n\t}\n\tw.bool(true);\n\t__w32(w, v!);\n}\n\nfunction __r31(r: __Reader): Array<__M_ListRow> | null {\n\tif (!r.bool()) return null;\n\treturn __r32(r);\n}\n\nfunction __w33(w: __Writer, v: __M_MenuEvent): void {\n\t__w9(w, v.defaultPrevented);\n\t__w20(w, v.player);\n\t__w3(w, v.menu);\n\t__w9(w, v.timeout);\n}\n\nfunction __u33(r: __Reader, o: __M_MenuEvent): void {\n\to.defaultPrevented = __r9(r);\n\to.player = __r20(r);\n\to.menu = __r3(r);\n\to.timeout = __r9(r);\n}\n\nfunction __r33(r: __Reader): __M_MenuEvent {\n\tconst o = changetype<__M_MenuEvent>(__new(offsetof<__M_MenuEvent>(), idof<__M_MenuEvent>()));\n\t__u33(r, o);\n\treturn o;\n}\n\n__serve(\"menu-core\", 1989640665, __dispatch);\n",
|
|
709
|
+
"callbacks": true
|
|
702
710
|
}
|
|
703
711
|
}
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The tooltips of src/
|
|
1
|
+
// The tooltips of src/menus.ts, in both languages: scripts/apply-docs.ts writes the
|
|
2
2
|
// one AMXTS_DOCS_LANG picks into the JSDoc above each element.
|
|
3
3
|
export default {
|
|
4
4
|
"Menu": {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
the file sets; the methods fill the menu, open it and count it down.
|
|
8
8
|
|
|
9
9
|
const shop = menus.create("SHOP", { title: "Shop" });
|
|
10
|
-
shop.addItem("Heal",
|
|
10
|
+
shop.addItem({ title: "Heal", onSelect: ({ player }) => heal(player) });
|
|
11
11
|
shop.show(player);
|
|
12
12
|
`,
|
|
13
13
|
ru: `
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
что задаёт файл; методы наполняют меню, открывают его и ведут отсчёт.
|
|
16
16
|
|
|
17
17
|
const shop = menus.create("SHOP", { title: "Shop" });
|
|
18
|
-
shop.addItem("Heal",
|
|
18
|
+
shop.addItem({ title: "Heal", onSelect: ({ player }) => heal(player) });
|
|
19
19
|
shop.show(player);
|
|
20
20
|
`,
|
|
21
21
|
},
|
|
@@ -60,34 +60,48 @@ export default {
|
|
|
60
60
|
ru: `Имя меню — его имя в файле меню, например \`"MAIN_MENU"\`.`,
|
|
61
61
|
},
|
|
62
62
|
"Menu.title": {
|
|
63
|
-
en: `The menu's title: the text - a lang key too - or a function that gives it for the
|
|
64
|
-
ru: `Заголовок меню: сам текст — или ключ словаря — либо функция, которая даёт его
|
|
63
|
+
en: `The menu's title: the text - a lang key too - or a function that gives it for the menu's context.`,
|
|
64
|
+
ru: `Заголовок меню: сам текст — или ключ словаря — либо функция, которая даёт его по контексту меню.`,
|
|
65
65
|
},
|
|
66
66
|
"Menu.addItem": {
|
|
67
67
|
en: `
|
|
68
|
-
Adds an item: its
|
|
69
|
-
|
|
68
|
+
Adds an item: its title, when it is shown and can be chosen, and what
|
|
69
|
+
choosing it does - each a function of the menu's context where it
|
|
70
|
+
depends on who looks.
|
|
70
71
|
|
|
71
|
-
shop.addItem(
|
|
72
|
+
shop.addItem({
|
|
73
|
+
title: ({ player }) => \`Heal (\${player.health} HP)\`,
|
|
74
|
+
visible: ({ player }) => player.isAlive,
|
|
75
|
+
onSelect: ({ player }) => {
|
|
76
|
+
player.health = 100;
|
|
77
|
+
},
|
|
78
|
+
});
|
|
72
79
|
`,
|
|
73
80
|
ru: `
|
|
74
|
-
Добавляет пункт: его
|
|
75
|
-
|
|
81
|
+
Добавляет пункт: его заголовок, когда он показан и когда его можно
|
|
82
|
+
выбрать и что делает выбор, — каждое функцией контекста меню, если
|
|
83
|
+
зависит от того, кто смотрит.
|
|
76
84
|
|
|
77
|
-
shop.addItem(
|
|
85
|
+
shop.addItem({
|
|
86
|
+
title: ({ player }) => \`Heal (\${player.health} HP)\`,
|
|
87
|
+
visible: ({ player }) => player.isAlive,
|
|
88
|
+
onSelect: ({ player }) => {
|
|
89
|
+
player.health = 100;
|
|
90
|
+
},
|
|
91
|
+
});
|
|
78
92
|
`,
|
|
79
93
|
},
|
|
80
94
|
"Menu.addFixedItem": {
|
|
81
|
-
en: `Adds an item that takes the same slot on every page: \`slot\` is its key, \`1\` to \`7\`; the
|
|
82
|
-
ru: `Добавляет пункт, который на каждой странице занимает один слот: \`slot\` — его клавиша, от \`1\` до \`7\`;
|
|
95
|
+
en: `Adds an item that takes the same slot on every page: \`slot\` is its key, \`1\` to \`7\`; the item as \`addItem()\` takes it.`,
|
|
96
|
+
ru: `Добавляет пункт, который на каждой странице занимает один слот: \`slot\` — его клавиша, от \`1\` до \`7\`; пункт — как у \`addItem()\`.`,
|
|
83
97
|
},
|
|
84
98
|
"Menu.clearItems": {
|
|
85
99
|
en: `Removes every item of the menu, fixed ones too.`,
|
|
86
100
|
ru: `Удаляет все пункты меню, включая фиксированные.`,
|
|
87
101
|
},
|
|
88
102
|
"Menu.addFilter": {
|
|
89
|
-
en: `A filter of a list menu: rows \`test\` says no to are left out
|
|
90
|
-
ru: `Фильтр меню-списка: строки, на которые \`test\` отвечает «нет»,
|
|
103
|
+
en: `A filter of a list menu: rows \`test\` says no to are left out - \`target\` is the row's player - and \`message\` is said when none is left.`,
|
|
104
|
+
ru: `Фильтр меню-списка: строки, на которые \`test\` отвечает «нет», пропускаются — \`target\` — игрок строки, — а если не осталось ни одной, игрок получает \`message\`.`,
|
|
91
105
|
},
|
|
92
106
|
"Menu.addPlaceholder": {
|
|
93
107
|
en: `A placeholder of this menu, for menu files and Pawn plugins: the text \`%name%\` stands for, before the ones registered with \`addPlaceholder()\`. In code the text is a function instead.`,
|
|
@@ -111,6 +125,10 @@ export default {
|
|
|
111
125
|
обработчик \`"show"\`, оно не активно или меню игрока не уступает место.
|
|
112
126
|
`,
|
|
113
127
|
},
|
|
128
|
+
"Menu.runActions": {
|
|
129
|
+
en: `Runs an action line as a choice in this menu does: space-separated action names, \`CLOSE_MENU\` and \`SHOW_<MENU>\` among them; \`target\` is the player it is about.`,
|
|
130
|
+
ru: `Выполняет строку действий, как её выполняет выбор в этом меню: имена действий через пробел, в том числе \`CLOSE_MENU\` и \`SHOW_<MENU>\`; \`target\` — игрок, о котором речь.`,
|
|
131
|
+
},
|
|
114
132
|
"Menu.refresh": {
|
|
115
133
|
en: `Draws the menu again for whoever looks at it; the number of players it was drawn for.`,
|
|
116
134
|
ru: `Перерисовывает меню у всех, кто его смотрит; число игроков, у которых оно перерисовано.`,
|
|
@@ -236,8 +254,8 @@ export default {
|
|
|
236
254
|
ru: `Вызывает \`listener\` на каждое событие меню типа \`type\` — одно из \`"open"\`, \`"close"\` или \`"show"\` (до открытия меню).`,
|
|
237
255
|
},
|
|
238
256
|
"listRow": {
|
|
239
|
-
en: `A row for a list source: its
|
|
240
|
-
ru: `Строка для источника списка:
|
|
257
|
+
en: `A row for a list source: its number - \`row\` of the context its item's functions get - its text, and optionally an action, a restriction and its message.`,
|
|
258
|
+
ru: `Строка для источника списка: её номер — \`row\` в контексте, который получают функции её пункта, — текст и, если нужно, действие, ограничение и его сообщение.`,
|
|
241
259
|
},
|
|
242
260
|
"textRow": {
|
|
243
261
|
en: `A line of text among a list source's rows; \`centered\` pads it to the middle of the menu.`,
|
|
@@ -291,8 +309,4 @@ export default {
|
|
|
291
309
|
en: `Whether an action of that name is registered.`,
|
|
292
310
|
ru: `Зарегистрировано ли действие с этим именем.`,
|
|
293
311
|
},
|
|
294
|
-
"runActions": {
|
|
295
|
-
en: `Runs an action line: space-separated action names, \`CLOSE_MENU\` and \`SHOW_<MENU>\` among them.`,
|
|
296
|
-
ru: `Выполняет строку действий: имена действий через пробел, в том числе \`CLOSE_MENU\` и \`SHOW_<MENU>\`.`,
|
|
297
|
-
},
|
|
298
312
|
};
|
|
@@ -5,24 +5,62 @@ export default {
|
|
|
5
5
|
en: `A menu's kind, one of \`"items"\` (a list of items) or \`"list"\` (a row per player, or per row of a list source).`,
|
|
6
6
|
ru: `Вид меню, одно из \`"items"\` (список пунктов) или \`"list"\` (строка на игрока или на строку источника).`,
|
|
7
7
|
},
|
|
8
|
+
"MenuContext": {
|
|
9
|
+
en: `
|
|
10
|
+
A menu's context, which its functions get: the player who looks, who or
|
|
11
|
+
what the menu is about, and the menu.
|
|
12
|
+
|
|
13
|
+
shop.addItem({ title: ({ player }) => \`Heal (\${player.health} HP)\`, onSelect: ({ player }) => heal(player) });
|
|
14
|
+
`,
|
|
15
|
+
ru: `
|
|
16
|
+
Контекст меню, который получают его функции: игрок, который смотрит, о ком
|
|
17
|
+
или о чём меню и само меню.
|
|
18
|
+
|
|
19
|
+
shop.addItem({ title: ({ player }) => \`Heal (\${player.health} HP)\`, onSelect: ({ player }) => heal(player) });
|
|
20
|
+
`,
|
|
21
|
+
},
|
|
22
|
+
"MenuContext.player": {
|
|
23
|
+
en: `The player the menu is shown to: who looks at it, and who chooses.`,
|
|
24
|
+
ru: `Игрок, которому показано меню: тот, кто его смотрит и выбирает.`,
|
|
25
|
+
},
|
|
26
|
+
"MenuContext.target": {
|
|
27
|
+
en: `The player the menu is about: the row's in a list menu, the one \`show()\` was given as \`target\` in an items menu; \`player\` himself when there is none.`,
|
|
28
|
+
ru: `Игрок, о котором меню: игрок строки в меню-списке, тот, кого передали \`show()\` в \`target\`, в меню пунктов; сам \`player\`, если такого нет.`,
|
|
29
|
+
},
|
|
30
|
+
"MenuContext.row": {
|
|
31
|
+
en: `The row's number in a list menu, as \`listRow()\` gave it - e.g. an entity or an index of the source's own; a player's \`id\` in a list of players. In an items menu, the \`id\` of the menu's target, \`0\` without one.`,
|
|
32
|
+
ru: `Номер строки в меню-списке, как его дал \`listRow()\`, — например, сущность или индекс самого источника; в списке игроков — \`id\` игрока. В меню пунктов — \`id\` цели меню, \`0\`, если её нет.`,
|
|
33
|
+
},
|
|
34
|
+
"MenuContext.menu": {
|
|
35
|
+
en: `The menu the function is asked for.`,
|
|
36
|
+
ru: `Меню, для которого вызвана функция.`,
|
|
37
|
+
},
|
|
38
|
+
"NamedContext": {
|
|
39
|
+
en: `The context of a function registered by name - an action, a placeholder, a restriction, an action check: the menu's context, and the name it is asked by.`,
|
|
40
|
+
ru: `Контекст функции, зарегистрированной по имени, — действия, плейсхолдера, ограничения, проверки действия: контекст меню и имя, по которому её спросили.`,
|
|
41
|
+
},
|
|
42
|
+
"NamedContext.name": {
|
|
43
|
+
en: `The name it is asked by: an action's or a placeholder's, a restriction's whole token - \`"NAME:param"\` included; for an action check, the item's action.`,
|
|
44
|
+
ru: `Имя, по которому её спросили: имя действия или плейсхолдера, токен ограничения целиком — вместе с \`"NAME:param"\`; для проверки действия — действие пункта.`,
|
|
45
|
+
},
|
|
8
46
|
"MenuText": {
|
|
9
47
|
en: `
|
|
10
48
|
Text of a menu - a title, an item, a message: the text itself, or a
|
|
11
|
-
function that gives it for the
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
49
|
+
function that gives it for the menu's context. A lang key is translated
|
|
50
|
+
either way. Colour tags are chat's letters: \`!y\` yellow, \`!r\` red, \`!d\`
|
|
51
|
+
grey, \`!w\` white, \`!R\` to the right edge; chat's own \`!g\`, \`!b\` and \`!t\`
|
|
52
|
+
are dropped.
|
|
15
53
|
|
|
16
|
-
menus.create("SHOP", { title: (player) => \`Shop for \${player.name}\` });
|
|
54
|
+
menus.create("SHOP", { title: ({ player }) => \`Shop for \${player.name}\` });
|
|
17
55
|
`,
|
|
18
56
|
ru: `
|
|
19
57
|
Текст меню — заголовок, пункт, сообщение: сам текст или функция, которая
|
|
20
|
-
даёт его
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
58
|
+
даёт его по контексту меню. Ключ словаря переводится в обоих случаях.
|
|
59
|
+
Цветовые метки — буквы чата: \`!y\` жёлтый, \`!r\` красный, \`!d\`
|
|
60
|
+
серый, \`!w\` белый, \`!R\` — к правому краю; метки только для чата \`!g\`, \`!b\` и \`!t\`
|
|
61
|
+
убираются.
|
|
24
62
|
|
|
25
|
-
menus.create("SHOP", { title: (player) => \`Shop for \${player.name}\` });
|
|
63
|
+
menus.create("SHOP", { title: ({ player }) => \`Shop for \${player.name}\` });
|
|
26
64
|
`,
|
|
27
65
|
},
|
|
28
66
|
"ListRow": {
|
|
@@ -34,8 +72,8 @@ export default {
|
|
|
34
72
|
ru: `Вид строки, одно из \`"item"\` (строка для выбора) или \`"text"\` (строка текста, не выбор).`,
|
|
35
73
|
},
|
|
36
74
|
"ListRow.target": {
|
|
37
|
-
en: `The row's
|
|
38
|
-
ru:
|
|
75
|
+
en: `The row's number, \`row\` of the context its item's functions get: e.g. a player's \`id\`, an entity or an index of the source's own; \`0\` for a line of text.`,
|
|
76
|
+
ru: `Номер строки, \`row\` в контексте, который получают функции её пункта: например, \`id\` игрока, сущность или индекс самого источника; \`0\` у строки текста.`,
|
|
39
77
|
},
|
|
40
78
|
"ListRow.text": {
|
|
41
79
|
en: `The row's text, put for \`%name%\` in the menu's row template.`,
|
|
@@ -57,17 +95,17 @@ export default {
|
|
|
57
95
|
en: `
|
|
58
96
|
The options of a menu made with \`create()\`. Every field may be left out:
|
|
59
97
|
|
|
60
|
-
menus.create("SHOP", { title: "Shop", time: 30, activeWhen: player => player.isAlive });
|
|
98
|
+
menus.create("SHOP", { title: "Shop", time: 30, activeWhen: ({ player }) => player.isAlive });
|
|
61
99
|
`,
|
|
62
100
|
ru: `
|
|
63
101
|
Настройки меню, сделанного через \`create()\`. Любое поле можно не задавать:
|
|
64
102
|
|
|
65
|
-
menus.create("SHOP", { title: "Shop", time: 30, activeWhen: player => player.isAlive });
|
|
103
|
+
menus.create("SHOP", { title: "Shop", time: 30, activeWhen: ({ player }) => player.isAlive });
|
|
66
104
|
`,
|
|
67
105
|
},
|
|
68
106
|
"MenuOptions.title": {
|
|
69
|
-
en: `The menu's title: the text - a lang key too - or a function that gives it for the
|
|
70
|
-
ru: `Заголовок меню: сам текст — или ключ словаря — либо функция, которая даёт его
|
|
107
|
+
en: `The menu's title: the text - a lang key too - or a function that gives it for the menu's context; left out, the menu's name.`,
|
|
108
|
+
ru: `Заголовок меню: сам текст — или ключ словаря — либо функция, которая даёт его по контексту меню; если не задан — имя меню.`,
|
|
71
109
|
},
|
|
72
110
|
"MenuOptions.time": {
|
|
73
111
|
en: `Seconds on the countdown when the menu opens, e.g. \`10\`; left out, none.`,
|
|
@@ -86,8 +124,8 @@ export default {
|
|
|
86
124
|
ru: `Блокировка меню: пока \`true\`, пункты нельзя выбрать и другое меню не заменяет это.`,
|
|
87
125
|
},
|
|
88
126
|
"MenuOptions.activeWhen": {
|
|
89
|
-
en: `A test the menu opens under: while it says no
|
|
90
|
-
ru: `Проверка, при которой меню открывается: пока она отвечает
|
|
127
|
+
en: `A test the menu opens under: while it says no, the menu does not open for the player.`,
|
|
128
|
+
ru: `Проверка, при которой меню открывается: пока она отвечает «нет», меню игроку не открывается.`,
|
|
91
129
|
},
|
|
92
130
|
"MenuShowOptions": {
|
|
93
131
|
en: `
|
|
@@ -106,8 +144,8 @@ export default {
|
|
|
106
144
|
ru: `Секунды отсчёта; если не заданы, идущий отсчёт продолжается или начинается собственный отсчёт меню.`,
|
|
107
145
|
},
|
|
108
146
|
"MenuShowOptions.target": {
|
|
109
|
-
en: `The player the menu is about
|
|
110
|
-
ru: `Игрок, о котором
|
|
147
|
+
en: `The player the menu is about: \`target\` of the context its functions get, and \`%target%\`.`,
|
|
148
|
+
ru: `Игрок, о котором меню: \`target\` в контексте, который получают его функции, и \`%target%\`.`,
|
|
111
149
|
},
|
|
112
150
|
"MenuShowOptions.resetHistory": {
|
|
113
151
|
en: `A new way back: \`true\` forgets the menus this one was opened from.`,
|
|
@@ -123,25 +161,37 @@ export default {
|
|
|
123
161
|
},
|
|
124
162
|
"MenuItemOptions": {
|
|
125
163
|
en: `
|
|
126
|
-
|
|
164
|
+
An item: its title, when it is shown and can be chosen, and what choosing
|
|
165
|
+
it does. Every field but \`title\` may be left out:
|
|
127
166
|
|
|
128
|
-
shop.addItem(
|
|
129
|
-
|
|
130
|
-
|
|
167
|
+
shop.addItem({
|
|
168
|
+
title: ({ player }) => \`Heal (\${player.health} HP)\`,
|
|
169
|
+
visible: ({ player }) => player.health < 100,
|
|
170
|
+
onSelect: ({ player }) => {
|
|
171
|
+
player.health = 100;
|
|
172
|
+
},
|
|
131
173
|
});
|
|
132
174
|
`,
|
|
133
175
|
ru: `
|
|
134
|
-
|
|
176
|
+
Пункт: его заголовок, когда он показан и когда его можно выбрать и что
|
|
177
|
+
делает выбор. Любое поле, кроме \`title\`, можно не задавать:
|
|
135
178
|
|
|
136
|
-
shop.addItem(
|
|
137
|
-
|
|
138
|
-
|
|
179
|
+
shop.addItem({
|
|
180
|
+
title: ({ player }) => \`Heal (\${player.health} HP)\`,
|
|
181
|
+
visible: ({ player }) => player.health < 100,
|
|
182
|
+
onSelect: ({ player }) => {
|
|
183
|
+
player.health = 100;
|
|
184
|
+
},
|
|
139
185
|
});
|
|
140
186
|
`,
|
|
141
187
|
},
|
|
188
|
+
"MenuItemOptions.title": {
|
|
189
|
+
en: `The item's text - a lang key too - or a function that gives it for the menu's context.`,
|
|
190
|
+
ru: `Текст пункта — или ключ словаря — либо функция, которая даёт его по контексту меню.`,
|
|
191
|
+
},
|
|
142
192
|
"MenuItemOptions.onSelect": {
|
|
143
|
-
en: `The function run when the item is chosen
|
|
144
|
-
ru: `Функция, которая выполняется при выборе
|
|
193
|
+
en: `The function run when the item is chosen; the menu is drawn again after it, while it stays open.`,
|
|
194
|
+
ru: `Функция, которая выполняется при выборе пункта; после неё меню перерисовывается, если осталось открытым.`,
|
|
145
195
|
},
|
|
146
196
|
"MenuItemOptions.visible": {
|
|
147
197
|
en: `A test the item is shown under: while it says no, the item is left out and takes no slot.`,
|
|
@@ -154,8 +204,8 @@ export default {
|
|
|
154
204
|
a message of its own - the first that fails gives its message.
|
|
155
205
|
|
|
156
206
|
enabled: [
|
|
157
|
-
{ when: (player) => player.frags >= 5, message: "5 frags needed" },
|
|
158
|
-
{ when: (player) => player.armor < 100, message: (player) => \`(\${player.armor} already)\` },
|
|
207
|
+
{ when: ({ player }) => player.frags >= 5, message: "5 frags needed" },
|
|
208
|
+
{ when: ({ player }) => player.armor < 100, message: ({ player }) => \`(\${player.armor} already)\` },
|
|
159
209
|
],
|
|
160
210
|
`,
|
|
161
211
|
ru: `
|
|
@@ -164,18 +214,18 @@ export default {
|
|
|
164
214
|
сообщение, — первое невыполненное даёт своё.
|
|
165
215
|
|
|
166
216
|
enabled: [
|
|
167
|
-
{ when: (player) => player.frags >= 5, message: "5 frags needed" },
|
|
168
|
-
{ when: (player) => player.armor < 100, message: (player) => \`(\${player.armor} already)\` },
|
|
217
|
+
{ when: ({ player }) => player.frags >= 5, message: "5 frags needed" },
|
|
218
|
+
{ when: ({ player }) => player.armor < 100, message: ({ player }) => \`(\${player.armor} already)\` },
|
|
169
219
|
],
|
|
170
220
|
`,
|
|
171
221
|
},
|
|
172
222
|
"MenuItemOptions.message": {
|
|
173
|
-
en: `The text beside the item while \`enabled\` greys it out, for a requirement without a message of its own: the text, e.g. \`"(full)"\`, or a function that gives it for the
|
|
174
|
-
ru: `Текст рядом с пунктом, пока его гасит \`enabled\`, — для требования без своего сообщения: сам текст, например \`"(full)"\`, или функция, которая даёт его
|
|
223
|
+
en: `The text beside the item while \`enabled\` greys it out, for a requirement without a message of its own: the text, e.g. \`"(full)"\`, or a function that gives it for the menu's context.`,
|
|
224
|
+
ru: `Текст рядом с пунктом, пока его гасит \`enabled\`, — для требования без своего сообщения: сам текст, например \`"(full)"\`, или функция, которая даёт его по контексту меню.`,
|
|
175
225
|
},
|
|
176
226
|
"MenuItemOptions.placeholder": {
|
|
177
|
-
en: `The text after the item's
|
|
178
|
-
ru: `Текст после
|
|
227
|
+
en: `The text after the item's title, for items of menu files and Pawn plugins, placeholders and all, e.g. \`"%hp%"\`; in code the title is a function instead.`,
|
|
228
|
+
ru: `Текст после заголовка пункта — для пунктов файлов меню и Pawn-плагинов, с плейсхолдерами, например \`"%hp%"\`; в коде заголовок — функция.`,
|
|
179
229
|
},
|
|
180
230
|
"MenuItemOptions.action": {
|
|
181
231
|
en: `Action names from \`addAction()\` run when the item is chosen, or a built-in one: \`"SHOW_<MENU>"\`, \`"CLOSE_MENU"\`.`,
|
|
@@ -198,50 +248,50 @@ export default {
|
|
|
198
248
|
A requirement of an item, in the list \`enabled\` takes: while \`when\` says
|
|
199
249
|
no, the item is greyed out with \`message\` beside it.
|
|
200
250
|
|
|
201
|
-
{ when: (player) => player.frags >= 5, message: "5 frags needed" }
|
|
251
|
+
{ when: ({ player }) => player.frags >= 5, message: "5 frags needed" }
|
|
202
252
|
`,
|
|
203
253
|
ru: `
|
|
204
254
|
Требование пункта в списке, который принимает \`enabled\`: пока \`when\`
|
|
205
255
|
отвечает «нет», пункт погашен, а рядом \`message\`.
|
|
206
256
|
|
|
207
|
-
{ when: (player) => player.frags >= 5, message: "5 frags needed" }
|
|
257
|
+
{ when: ({ player }) => player.frags >= 5, message: "5 frags needed" }
|
|
208
258
|
`,
|
|
209
259
|
},
|
|
210
260
|
"Requirement.when": {
|
|
211
|
-
en: `A test the requirement holds under
|
|
212
|
-
ru: `Проверка, при которой требование
|
|
261
|
+
en: `A test the requirement holds under, given the menu's context.`,
|
|
262
|
+
ru: `Проверка, при которой требование выполнено, по контексту меню.`,
|
|
213
263
|
},
|
|
214
264
|
"Requirement.message": {
|
|
215
|
-
en: `The text beside the item while \`when\` says no: the text, a lang key, or a function that gives it for the
|
|
216
|
-
ru: `Текст рядом с пунктом, пока \`when\` отвечает «нет»: сам текст, ключ словаря или функция, которая даёт его
|
|
265
|
+
en: `The text beside the item while \`when\` says no: the text, a lang key, or a function that gives it for the menu's context; left out, the item's \`message\`.`,
|
|
266
|
+
ru: `Текст рядом с пунктом, пока \`when\` отвечает «нет»: сам текст, ключ словаря или функция, которая даёт его по контексту меню; если не задан — \`message\` пункта.`,
|
|
217
267
|
},
|
|
218
268
|
"ConditionTest": {
|
|
219
269
|
en: `A condition's test, as \`addCondition()\` registers it. In a list menu \`player\` is the row's player and \`viewer\` whoever looks.`,
|
|
220
270
|
ru: `Проверка условия, как её регистрирует \`addCondition()\`. В меню-списке \`player\` — игрок строки, \`viewer\` — тот, кто смотрит.`,
|
|
221
271
|
},
|
|
222
272
|
"ActionHandler": {
|
|
223
|
-
en: `An action, as \`addAction()\` registers it:
|
|
224
|
-
ru: `Действие, как его регистрирует \`addAction()\`:
|
|
273
|
+
en: `An action, as \`addAction()\` registers it: run with the context of the item chosen, and the action's name.`,
|
|
274
|
+
ru: `Действие, как его регистрирует \`addAction()\`: выполняется с контекстом выбранного пункта и именем действия.`,
|
|
225
275
|
},
|
|
226
276
|
"PlaceholderValue": {
|
|
227
|
-
en: `A placeholder's value: the text \`%name%\` stands for.`,
|
|
228
|
-
ru: `Значение плейсхолдера: текст, которым заменяется \`%name
|
|
277
|
+
en: `A placeholder's value: the text \`%name%\` stands for, given the context of the text it is in.`,
|
|
278
|
+
ru: `Значение плейсхолдера: текст, которым заменяется \`%name%\`, по контексту текста, в котором он стоит.`,
|
|
229
279
|
},
|
|
230
280
|
"RestrictionTest": {
|
|
231
281
|
en: `A restriction's test, as \`addRestriction()\` registers it; \`name\` is the whole token, \`"NAME:param"\` included.`,
|
|
232
282
|
ru: `Проверка ограничения, как её регистрирует \`addRestriction()\`; \`name\` — токен целиком, вместе с \`"NAME:param"\`.`,
|
|
233
283
|
},
|
|
234
284
|
"ActionTest": {
|
|
235
|
-
en: `A test of an item's action, as \`addActionCheck()\` registers it: \`false\` greys the item out.`,
|
|
236
|
-
ru: `Проверка действия пункта, как её регистрирует \`addActionCheck()\`: \`false\` гасит пункт.`,
|
|
285
|
+
en: `A test of an item's action, as \`addActionCheck()\` registers it: \`name\` is the action, and \`false\` greys the item out.`,
|
|
286
|
+
ru: `Проверка действия пункта, как её регистрирует \`addActionCheck()\`: \`name\` — действие, а \`false\` гасит пункт.`,
|
|
237
287
|
},
|
|
238
288
|
"ConditionFilter": {
|
|
239
289
|
en: `A filter over a condition someone else registered: gets its value and returns the one to use.`,
|
|
240
290
|
ru: `Фильтр над условием, которое зарегистрировал кто-то другой: получает его значение и возвращает то, что будет использовано.`,
|
|
241
291
|
},
|
|
242
292
|
"RowTest": {
|
|
243
|
-
en: `A test of a row of a list menu, as \`addFilter()\` takes it: \`
|
|
244
|
-
ru: `Проверка строки меню-списка, как её принимает \`addFilter()\`: \`
|
|
293
|
+
en: `A test of a row of a list menu, as \`addFilter()\` takes it: \`target\` is the row's player, \`player\` whoever looks.`,
|
|
294
|
+
ru: `Проверка строки меню-списка, как её принимает \`addFilter()\`: \`target\` — игрок строки, \`player\` — тот, кто смотрит.`,
|
|
245
295
|
},
|
|
246
296
|
"ListSource": {
|
|
247
297
|
en: `A list source: the rows of a list menu for the player who looks; \`null\` lists the players instead.`,
|