@amxts/menu-core 0.1.0 → 0.2.1
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 +40 -32
- 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 +411 -411
- 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.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"from": {
|
|
6
6
|
"@amxts/core": {
|
|
7
|
-
"version": "0.
|
|
8
|
-
"hash": "
|
|
7
|
+
"version": "0.2.2",
|
|
8
|
+
"hash": "71afaf25b04163866b491556b2ae1740c8109576"
|
|
9
9
|
},
|
|
10
10
|
"@amxts/config-core": {
|
|
11
|
-
"version": "0.1.
|
|
12
|
-
"hash": "
|
|
11
|
+
"version": "0.1.2",
|
|
12
|
+
"hash": "d4f17332c3543c43e4c52535a89ca218a2af1742"
|
|
13
13
|
},
|
|
14
14
|
"@amxts/menu-core": {
|
|
15
|
-
"version": "0.1
|
|
16
|
-
"hash": "
|
|
15
|
+
"version": "0.2.1",
|
|
16
|
+
"hash": "a754b5002dbcf723b5b5fe3727b14600469c325d"
|
|
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",
|
|
@@ -71,7 +74,7 @@
|
|
|
71
74
|
}
|
|
72
75
|
],
|
|
73
76
|
"result": "int",
|
|
74
|
-
"doc": "/**\n * Registers a condition menus refer to - an item's condition, ACTIVE_ON, a\n * FILTER. The first plugin to register a name answers for it (case-insensitive).\n * Callback: public callback(id, viewerId, const name[]) - true when it holds.\n * Returns the condition's id.\n */"
|
|
77
|
+
"doc": "/**\r\n * Registers a condition menus refer to - an item's condition, ACTIVE_ON, a\r\n * FILTER. The first plugin to register a name answers for it (case-insensitive).\r\n * Callback: public callback(id, viewerId, const name[]) - true when it holds.\r\n * Returns the condition's id.\r\n */"
|
|
75
78
|
},
|
|
76
79
|
{
|
|
77
80
|
"name": "mc_register_action",
|
|
@@ -93,7 +96,7 @@
|
|
|
93
96
|
}
|
|
94
97
|
],
|
|
95
98
|
"result": "int",
|
|
96
|
-
"doc": "/**\n * Registers an action run when an item is chosen. Built in, not registered:\n * SHOW_<SECTION> opens that menu, CLOSE_MENU closes it; an action line may\n * list several, space-separated. Names are case-sensitive; the first wins.\n * Callback: public callback(id, const action[]) in an items menu,\n * public callback(id, targetId) in a LIST_ menu. isCritical is accepted and\n * does nothing. Returns the action's id.\n */"
|
|
99
|
+
"doc": "/**\r\n * Registers an action run when an item is chosen. Built in, not registered:\r\n * SHOW_<SECTION> opens that menu, CLOSE_MENU closes it; an action line may\r\n * list several, space-separated. Names are case-sensitive; the first wins.\r\n * Callback: public callback(id, const action[]) in an items menu,\r\n * public callback(id, targetId) in a LIST_ menu. isCritical is accepted and\r\n * does nothing. Returns the action's id.\r\n */"
|
|
97
100
|
},
|
|
98
101
|
{
|
|
99
102
|
"name": "mc_register_placeholder",
|
|
@@ -110,7 +113,7 @@
|
|
|
110
113
|
}
|
|
111
114
|
],
|
|
112
115
|
"result": "int",
|
|
113
|
-
"doc": "/**\n * Registers a placeholder, %name% in titles and items, without the %.\n * Callback: public callback(id, targetId, value[], len) - fills value[].\n * A name registered again keeps the first. Returns the placeholder's id.\n */"
|
|
116
|
+
"doc": "/**\r\n * Registers a placeholder, %name% in titles and items, without the %.\r\n * Callback: public callback(id, targetId, value[], len) - fills value[].\r\n * A name registered again keeps the first. Returns the placeholder's id.\r\n */"
|
|
114
117
|
},
|
|
115
118
|
{
|
|
116
119
|
"name": "mc_register_menu",
|
|
@@ -122,7 +125,7 @@
|
|
|
122
125
|
}
|
|
123
126
|
],
|
|
124
127
|
"result": "int",
|
|
125
|
-
"doc": "/**\n * Registers the config file's [section] as a menu. Returns the menu's id, or\n * -1 when the section is missing, has no TITLE or no items, or is MAIN.\n */"
|
|
128
|
+
"doc": "/**\r\n * Registers the config file's [section] as a menu. Returns the menu's id, or\r\n * -1 when the section is missing, has no TITLE or no items, or is MAIN.\r\n */"
|
|
126
129
|
},
|
|
127
130
|
{
|
|
128
131
|
"name": "mc_show_menu",
|
|
@@ -164,7 +167,7 @@
|
|
|
164
167
|
}
|
|
165
168
|
],
|
|
166
169
|
"result": "int",
|
|
167
|
-
"doc": "/**\n * Shows a menu. time: countdown seconds, -1 for the menu's TIME (or the\n * countdown running). targetId: who a LIST_ menu is about. resetHistory\n * starts the way back anew; forceOpen opens over a menu that holds on (a\n * countdown, a lock); ignoreHistory leaves this menu out of the way back.\n * Returns 1 when it opened; 0 when the player is not in the game, there is no\n * such menu, a show filter or ACTIVE_ON stopped it.\n */"
|
|
170
|
+
"doc": "/**\r\n * Shows a menu. time: countdown seconds, -1 for the menu's TIME (or the\r\n * countdown running). targetId: who a LIST_ menu is about. resetHistory\r\n * starts the way back anew; forceOpen opens over a menu that holds on (a\r\n * countdown, a lock); ignoreHistory leaves this menu out of the way back.\r\n * Returns 1 when it opened; 0 when the player is not in the game, there is no\r\n * such menu, a show filter or ACTIVE_ON stopped it.\r\n */"
|
|
168
171
|
},
|
|
169
172
|
{
|
|
170
173
|
"name": "mc_set_menu_timer",
|
|
@@ -181,7 +184,7 @@
|
|
|
181
184
|
}
|
|
182
185
|
],
|
|
183
186
|
"result": "int",
|
|
184
|
-
"doc": "/**\n * Sets the menu's shared countdown: starts one of `time` seconds when none\n * runs, or changes the seconds left (0 stops it). Returns 1, or 0 when there\n * is no such menu or nothing to change.\n */"
|
|
187
|
+
"doc": "/**\r\n * Sets the menu's shared countdown: starts one of `time` seconds when none\r\n * runs, or changes the seconds left (0 stops it). Returns 1, or 0 when there\r\n * is no such menu or nothing to change.\r\n */"
|
|
185
188
|
},
|
|
186
189
|
{
|
|
187
190
|
"name": "mc_notify_condition_changed",
|
|
@@ -227,7 +230,7 @@
|
|
|
227
230
|
}
|
|
228
231
|
],
|
|
229
232
|
"result": "int",
|
|
230
|
-
"doc": "/**\n * Registers a restriction items name in their restriction column; \"*\"\n * answers for every name no other restriction does. Callback:\n * public callback(id, const restrictName[], targetId) - true when the player\n * passes. message is said beside an item it greys out, when the item has no\n * message of its own. Returns the restriction's id.\n */"
|
|
233
|
+
"doc": "/**\r\n * Registers a restriction items name in their restriction column; \"*\"\r\n * answers for every name no other restriction does. Callback:\r\n * public callback(id, const restrictName[], targetId) - true when the player\r\n * passes. message is said beside an item it greys out, when the item has no\r\n * message of its own. Returns the restriction's id.\r\n */"
|
|
231
234
|
},
|
|
232
235
|
{
|
|
233
236
|
"name": "mc_register_action_condition",
|
|
@@ -249,7 +252,7 @@
|
|
|
249
252
|
}
|
|
250
253
|
],
|
|
251
254
|
"result": "int",
|
|
252
|
-
"doc": "/**\n * Greys out items whose action is actionName in menuSection while the\n * callback says no; \"\" for either matches all. Callback:\n * public callback(id, const menuSection[], const actionName[]). Returns 1.\n */"
|
|
255
|
+
"doc": "/**\r\n * Greys out items whose action is actionName in menuSection while the\r\n * callback says no; \"\" for either matches all. Callback:\r\n * public callback(id, const menuSection[], const actionName[]). Returns 1.\r\n */"
|
|
253
256
|
},
|
|
254
257
|
{
|
|
255
258
|
"name": "mc_register_condition_filter",
|
|
@@ -266,7 +269,7 @@
|
|
|
266
269
|
}
|
|
267
270
|
],
|
|
268
271
|
"result": "int",
|
|
269
|
-
"doc": "/**\n * Registers a filter over a condition someone else registered: it gets the\n * condition's value and returns the one to use. Callback:\n * public bool:callback(id, viewerId, const condition[], bool:currentVal).\n * Returns the filter's id.\n */"
|
|
272
|
+
"doc": "/**\r\n * Registers a filter over a condition someone else registered: it gets the\r\n * condition's value and returns the one to use. Callback:\r\n * public bool:callback(id, viewerId, const condition[], bool:currentVal).\r\n * Returns the filter's id.\r\n */"
|
|
270
273
|
},
|
|
271
274
|
{
|
|
272
275
|
"name": "mc_register_list_data_source",
|
|
@@ -283,7 +286,7 @@
|
|
|
283
286
|
}
|
|
284
287
|
],
|
|
285
288
|
"result": "int",
|
|
286
|
-
"doc": "/**\n * The rows of a LIST_ menu, instead of the players. Callback:\n * public callback(id, Array:items) - pushes 289-cell items and returns 1:\n * [0] the target the action gets (-2: a line of text), [1..64] an action of\n * its own, [65..128] the text (%name%), [129..160] a restriction,\n * [161..288] the message when it greys the row out. A second source for the\n * menu replaces the first. Returns the source's id.\n */"
|
|
289
|
+
"doc": "/**\r\n * The rows of a LIST_ menu, instead of the players. Callback:\r\n * public callback(id, Array:items) - pushes 289-cell items and returns 1:\r\n * [0] the target the action gets (-2: a line of text), [1..64] an action of\r\n * its own, [65..128] the text (%name%), [129..160] a restriction,\r\n * [161..288] the message when it greys the row out. A second source for the\r\n * menu replaces the first. Returns the source's id.\r\n */"
|
|
287
290
|
},
|
|
288
291
|
{
|
|
289
292
|
"name": "mc_register_menu_open_callback",
|
|
@@ -307,7 +310,7 @@
|
|
|
307
310
|
}
|
|
308
311
|
],
|
|
309
312
|
"result": "int",
|
|
310
|
-
"doc": "/**\n * Called when a menu closes - by a key, a timeout, another menu opening over\n * it, the player leaving. Callback: public callback(id, const section[], bool:isTimeout).\n * Returns its id.\n */"
|
|
313
|
+
"doc": "/**\r\n * Called when a menu closes - by a key, a timeout, another menu opening over\r\n * it, the player leaving. Callback: public callback(id, const section[], bool:isTimeout).\r\n * Returns its id.\r\n */"
|
|
311
314
|
},
|
|
312
315
|
{
|
|
313
316
|
"name": "mc_register_show_filter",
|
|
@@ -319,7 +322,7 @@
|
|
|
319
322
|
}
|
|
320
323
|
],
|
|
321
324
|
"result": "int",
|
|
322
|
-
"doc": "/**\n * Asked before any menu opens; returning false stops it (mc_show_menu returns\n * 0) - the place to tell the player why. Callback:\n * public bool:callback(id, const section[]). Returns its id.\n */"
|
|
325
|
+
"doc": "/**\r\n * Asked before any menu opens; returning false stops it (mc_show_menu returns\r\n * 0) - the place to tell the player why. Callback:\r\n * public bool:callback(id, const section[]). Returns its id.\r\n */"
|
|
323
326
|
},
|
|
324
327
|
{
|
|
325
328
|
"name": "mc_cancel_menu_timer",
|
|
@@ -402,7 +405,7 @@
|
|
|
402
405
|
}
|
|
403
406
|
],
|
|
404
407
|
"result": "string",
|
|
405
|
-
"doc": "/**\n * A string property of a menu by its id (mc_get_active_menu): MP_SECTION, the\n * section name, into out[]. Returns its length; 0 when the id or the property\n * is not one.\n */"
|
|
408
|
+
"doc": "/**\r\n * A string property of a menu by its id (mc_get_active_menu): MP_SECTION, the\r\n * section name, into out[]. Returns its length; 0 when the id or the property\r\n * is not one.\r\n */"
|
|
406
409
|
},
|
|
407
410
|
{
|
|
408
411
|
"name": "mc_set_menu_property",
|
|
@@ -425,7 +428,7 @@
|
|
|
425
428
|
}
|
|
426
429
|
],
|
|
427
430
|
"result": "int",
|
|
428
|
-
"doc": "/**\n * Sets MP_LOCKED, MP_GLOBAL_TIMER, MP_TIMER_DURATION, MP_HIDE_BACK or\n * MP_HIDE_EXIT. Returns 1, or 0 when there is no such menu or property.\n */"
|
|
431
|
+
"doc": "/**\r\n * Sets MP_LOCKED, MP_GLOBAL_TIMER, MP_TIMER_DURATION, MP_HIDE_BACK or\r\n * MP_HIDE_EXIT. Returns 1, or 0 when there is no such menu or property.\r\n */"
|
|
429
432
|
},
|
|
430
433
|
{
|
|
431
434
|
"name": "mc_set_menu_property_string",
|
|
@@ -448,7 +451,7 @@
|
|
|
448
451
|
}
|
|
449
452
|
],
|
|
450
453
|
"result": "int",
|
|
451
|
-
"doc": "/**\n * Sets MP_ON_TIMEOUT (the action when the countdown ends), MP_ACTIVE_ON (the\n * condition the menu opens under) or MP_FILTER (\"CONDITION|MESSAGE\", added to\n * a LIST_ menu's filters). Returns 1, or 0 when there is no such menu or\n * property.\n */"
|
|
454
|
+
"doc": "/**\r\n * Sets MP_ON_TIMEOUT (the action when the countdown ends), MP_ACTIVE_ON (the\r\n * condition the menu opens under) or MP_FILTER (\"CONDITION|MESSAGE\", added to\r\n * a LIST_ menu's filters). Returns 1, or 0 when there is no such menu or\r\n * property.\r\n */"
|
|
452
455
|
},
|
|
453
456
|
{
|
|
454
457
|
"name": "mc_add_menu_item",
|
|
@@ -505,7 +508,7 @@
|
|
|
505
508
|
}
|
|
506
509
|
],
|
|
507
510
|
"result": "int",
|
|
508
|
-
"doc": "/**\n * Adds an item to a menu. name, condition and action take \"A|B\" variants: the\n * first whose condition holds is shown. iPosition: its place among the items,\n * -1 the end; emptyBefore/emptyAfter: blank lines around it. Returns 1, or 0\n * when there is no such menu or the name gives no item.\n */"
|
|
511
|
+
"doc": "/**\r\n * Adds an item to a menu. name, condition and action take \"A|B\" variants: the\r\n * first whose condition holds is shown. iPosition: its place among the items,\r\n * -1 the end; emptyBefore/emptyAfter: blank lines around it. Returns 1, or 0\r\n * when there is no such menu or the name gives no item.\r\n */"
|
|
509
512
|
},
|
|
510
513
|
{
|
|
511
514
|
"name": "mc_add_fixed_menu_item",
|
|
@@ -557,7 +560,7 @@
|
|
|
557
560
|
}
|
|
558
561
|
],
|
|
559
562
|
"result": "int",
|
|
560
|
-
"doc": "/**\n * Adds an item that always takes slot 1-7 of every page. Returns 1, or 0 when\n * there is no such menu or the name gives no item.\n */"
|
|
563
|
+
"doc": "/**\r\n * Adds an item that always takes slot 1-7 of every page. Returns 1, or 0 when\r\n * there is no such menu or the name gives no item.\r\n */"
|
|
561
564
|
},
|
|
562
565
|
{
|
|
563
566
|
"name": "mc_add_list_text",
|
|
@@ -579,7 +582,7 @@
|
|
|
579
582
|
}
|
|
580
583
|
],
|
|
581
584
|
"result": "int",
|
|
582
|
-
"doc": "/**\n * Adds a line of text - a header, a separator - to the items a data source\n * fills; call it from the data source callback. Returns 1.\n */"
|
|
585
|
+
"doc": "/**\r\n * Adds a line of text - a header, a separator - to the items a data source\r\n * fills; call it from the data source callback. Returns 1.\r\n */"
|
|
583
586
|
},
|
|
584
587
|
{
|
|
585
588
|
"name": "mc_clear_menu_items",
|
|
@@ -608,7 +611,7 @@
|
|
|
608
611
|
}
|
|
609
612
|
],
|
|
610
613
|
"result": "int",
|
|
611
|
-
"doc": "/**\n * Makes a menu in code, without a config section; a name starting with LIST_\n * makes a list menu. Returns 1, or 0 when a menu of that name is there.\n */"
|
|
614
|
+
"doc": "/**\r\n * Makes a menu in code, without a config section; a name starting with LIST_\r\n * makes a list menu. Returns 1, or 0 when a menu of that name is there.\r\n */"
|
|
612
615
|
},
|
|
613
616
|
{
|
|
614
617
|
"name": "mc_set_menu_page",
|
|
@@ -637,7 +640,7 @@
|
|
|
637
640
|
}
|
|
638
641
|
],
|
|
639
642
|
"result": "string",
|
|
640
|
-
"doc": "/**\n * The text the player's menu shows at the moment, colour codes and all (\"\"\n * when none is open) - for a test or a log to see what the player sees.\n */"
|
|
643
|
+
"doc": "/**\r\n * The text the player's menu shows at the moment, colour codes and all (\"\"\r\n * when none is open) - for a test or a log to see what the player sees.\r\n */"
|
|
641
644
|
}
|
|
642
645
|
],
|
|
643
646
|
"beside": {
|
|
@@ -682,7 +685,7 @@
|
|
|
682
685
|
"value": 7
|
|
683
686
|
}
|
|
684
687
|
],
|
|
685
|
-
"doc": "/**\n * Menu properties: mc_set_menu_property takes MP_LOCKED .. MP_HIDE_EXIT,\n * mc_set_menu_property_string MP_ON_TIMEOUT .. MP_FILTER, and\n * mc_get_menu_property_string MP_SECTION.\n */"
|
|
688
|
+
"doc": "/**\r\n * Menu properties: mc_set_menu_property takes MP_LOCKED .. MP_HIDE_EXIT,\r\n * mc_set_menu_property_string MP_ON_TIMEOUT .. MP_FILTER, and\r\n * mc_get_menu_property_string MP_SECTION.\r\n */"
|
|
686
689
|
}
|
|
687
690
|
],
|
|
688
691
|
"contract": null,
|
|
@@ -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": "714b3746abb5da366478b330941d6454ff0080a20fcc31bf63361df58d662ef5"
|
|
696
699
|
},
|
|
697
700
|
"linux": {
|
|
698
701
|
"file": "prebuilt/linux/menu-core.aot",
|
|
699
|
-
"size":
|
|
700
|
-
"sha256": "
|
|
702
|
+
"size": 1564122,
|
|
703
|
+
"sha256": "f0cffdf136ea7e53fcf12b25ac4fe3894b1b830436a35fa34580f1db28729ffd"
|
|
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
|
};
|