@amxts/menu-core 0.2.1 → 0.3.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 +2 -2
- package/PAWN.ru.md +2 -2
- package/README.md +8 -5
- package/README.ru.md +8 -5
- package/package.json +3 -3
- package/prebuilt/linux/menu-core.aot +0 -0
- package/prebuilt/manifest.json +36 -35
- package/prebuilt/windows/menu-core.aot +0 -0
- package/scripts/docs/src/menus.ts +18 -2
- package/scripts/docs/src/types.ts +4 -4
- package/src/internal.ts +4 -0
- package/src/menu-file.ts +13 -5
- package/src/menus.ts +54 -15
- package/src/natives.ts +411 -411
- package/src/types.ts +4 -4
package/prebuilt/manifest.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 2,
|
|
3
3
|
"module": "@amxts/menu-core",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"from": {
|
|
6
6
|
"@amxts/core": {
|
|
7
|
-
"version": "0.
|
|
8
|
-
"hash": "
|
|
7
|
+
"version": "0.3.0",
|
|
8
|
+
"hash": "1930bb0d9b7e1fa4857f2a6a4a011df0fbcb63ca",
|
|
9
|
+
"abi": "0.3.0+abi.1ff73017\nArrayCreate (ii)i\nArrayDestroy (i)i [1>\nArrayGetArray (iiii)i v,v,[a3>,v\nArrayPushArray (iii)i v,[a2,v\nArraySize (i)i\nGetLangTransKey (i)i s leaf\nLookupLangKey (iiii)i t,v,s,[1 leaf\nabort (iiii)\namxts_owner (ii)i\namxts_rpc (iiii)i\namxts_rpc_reply (ii)\namxts_rpc_result (i)\namxts_rpc_take (i)\namxts_serve (ii)\narg (i)i\narg_array (iii)i\narg_string (iii)i\narg_text (iii)i\nargc ()i\ncall (iiii)i\ncaller ()i\ncallfunc_begin_i (ii)i\ncallfunc_buffer (ii)i\ncallfunc_finish ()i\ncallfunc_push_int (i)i\ncallfunc_text (i)i\nconsole.error (i)\nconsole.info (i)\nconsole.warn (i)\ncreate_cvar (iiiiiiii)i s,s,v,s,v,v,v,v\ncvar_hook (ii)i\nemit_local (iiii)\nexport (ii)i\nget_cvar_pointer (i)i s leaf\nget_func_id (ii)i s,v\nget_maxplayers ()i\nget_name (iii)i\nget_players (iiii)i [32>,[1>,s,s\nget_user_flags (ii)i\nget_user_msgid (i)i s leaf\nham (iiii)i\nhook_on (ii)\nis_user_alive (i)i\nis_user_bot (i)i\nis_user_connected (i)i\nmember_get (iii)i\nmember_slot (ii)i\nmsg_hook (ii)i\non (iii)\non_direct (iiiiii)\noutcome (i)\nplayer_data_set (iiF)\nplayer_names (i)\nplayer_slots (i)\nplugin (iiii)\nprecache_generic (i)i s\nprecache_model (i)i s\nprecache_sound (i)i s\nread_flags (i)i s leaf\nregister_menucmd (iii)i v,v,s\nregister_menuid (ii)i s,v\nsay_text (iii)\nset_arg_text (iii)i\nshow_menu (iiiii)i v,v,s,v,s\nslot (iiii)i\nstack_frames (ii)i\nstop_task (i)i\ntag (i)\ntask (iii)i"
|
|
9
10
|
},
|
|
10
11
|
"@amxts/config-core": {
|
|
11
|
-
"version": "0.
|
|
12
|
-
"hash": "
|
|
12
|
+
"version": "0.2.0",
|
|
13
|
+
"hash": "fc3b2c2731f6044d4ce8dab8fe1471b4441ad8c9"
|
|
13
14
|
},
|
|
14
15
|
"@amxts/menu-core": {
|
|
15
|
-
"version": "0.
|
|
16
|
-
"hash": "
|
|
16
|
+
"version": "0.3.0",
|
|
17
|
+
"hash": "bacd6b942fd000d79efbb809de7e4724f96ac3c3"
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
"options": {
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
}
|
|
75
76
|
],
|
|
76
77
|
"result": "int",
|
|
77
|
-
"doc": "/**\
|
|
78
|
+
"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 */"
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
81
|
"name": "mc_register_action",
|
|
@@ -96,7 +97,7 @@
|
|
|
96
97
|
}
|
|
97
98
|
],
|
|
98
99
|
"result": "int",
|
|
99
|
-
"doc": "/**\
|
|
100
|
+
"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 */"
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
103
|
"name": "mc_register_placeholder",
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
}
|
|
114
115
|
],
|
|
115
116
|
"result": "int",
|
|
116
|
-
"doc": "/**\
|
|
117
|
+
"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 */"
|
|
117
118
|
},
|
|
118
119
|
{
|
|
119
120
|
"name": "mc_register_menu",
|
|
@@ -125,7 +126,7 @@
|
|
|
125
126
|
}
|
|
126
127
|
],
|
|
127
128
|
"result": "int",
|
|
128
|
-
"doc": "/**\
|
|
129
|
+
"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 */"
|
|
129
130
|
},
|
|
130
131
|
{
|
|
131
132
|
"name": "mc_show_menu",
|
|
@@ -167,7 +168,7 @@
|
|
|
167
168
|
}
|
|
168
169
|
],
|
|
169
170
|
"result": "int",
|
|
170
|
-
"doc": "/**\
|
|
171
|
+
"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 */"
|
|
171
172
|
},
|
|
172
173
|
{
|
|
173
174
|
"name": "mc_set_menu_timer",
|
|
@@ -184,7 +185,7 @@
|
|
|
184
185
|
}
|
|
185
186
|
],
|
|
186
187
|
"result": "int",
|
|
187
|
-
"doc": "/**\
|
|
188
|
+
"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 */"
|
|
188
189
|
},
|
|
189
190
|
{
|
|
190
191
|
"name": "mc_notify_condition_changed",
|
|
@@ -230,7 +231,7 @@
|
|
|
230
231
|
}
|
|
231
232
|
],
|
|
232
233
|
"result": "int",
|
|
233
|
-
"doc": "/**\
|
|
234
|
+
"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 */"
|
|
234
235
|
},
|
|
235
236
|
{
|
|
236
237
|
"name": "mc_register_action_condition",
|
|
@@ -252,7 +253,7 @@
|
|
|
252
253
|
}
|
|
253
254
|
],
|
|
254
255
|
"result": "int",
|
|
255
|
-
"doc": "/**\
|
|
256
|
+
"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 */"
|
|
256
257
|
},
|
|
257
258
|
{
|
|
258
259
|
"name": "mc_register_condition_filter",
|
|
@@ -269,7 +270,7 @@
|
|
|
269
270
|
}
|
|
270
271
|
],
|
|
271
272
|
"result": "int",
|
|
272
|
-
"doc": "/**\
|
|
273
|
+
"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 */"
|
|
273
274
|
},
|
|
274
275
|
{
|
|
275
276
|
"name": "mc_register_list_data_source",
|
|
@@ -286,7 +287,7 @@
|
|
|
286
287
|
}
|
|
287
288
|
],
|
|
288
289
|
"result": "int",
|
|
289
|
-
"doc": "/**\
|
|
290
|
+
"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 */"
|
|
290
291
|
},
|
|
291
292
|
{
|
|
292
293
|
"name": "mc_register_menu_open_callback",
|
|
@@ -310,7 +311,7 @@
|
|
|
310
311
|
}
|
|
311
312
|
],
|
|
312
313
|
"result": "int",
|
|
313
|
-
"doc": "/**\
|
|
314
|
+
"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 */"
|
|
314
315
|
},
|
|
315
316
|
{
|
|
316
317
|
"name": "mc_register_show_filter",
|
|
@@ -322,7 +323,7 @@
|
|
|
322
323
|
}
|
|
323
324
|
],
|
|
324
325
|
"result": "int",
|
|
325
|
-
"doc": "/**\
|
|
326
|
+
"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 */"
|
|
326
327
|
},
|
|
327
328
|
{
|
|
328
329
|
"name": "mc_cancel_menu_timer",
|
|
@@ -405,7 +406,7 @@
|
|
|
405
406
|
}
|
|
406
407
|
],
|
|
407
408
|
"result": "string",
|
|
408
|
-
"doc": "/**\
|
|
409
|
+
"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 */"
|
|
409
410
|
},
|
|
410
411
|
{
|
|
411
412
|
"name": "mc_set_menu_property",
|
|
@@ -428,7 +429,7 @@
|
|
|
428
429
|
}
|
|
429
430
|
],
|
|
430
431
|
"result": "int",
|
|
431
|
-
"doc": "/**\
|
|
432
|
+
"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 */"
|
|
432
433
|
},
|
|
433
434
|
{
|
|
434
435
|
"name": "mc_set_menu_property_string",
|
|
@@ -451,7 +452,7 @@
|
|
|
451
452
|
}
|
|
452
453
|
],
|
|
453
454
|
"result": "int",
|
|
454
|
-
"doc": "/**\
|
|
455
|
+
"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 */"
|
|
455
456
|
},
|
|
456
457
|
{
|
|
457
458
|
"name": "mc_add_menu_item",
|
|
@@ -508,7 +509,7 @@
|
|
|
508
509
|
}
|
|
509
510
|
],
|
|
510
511
|
"result": "int",
|
|
511
|
-
"doc": "/**\
|
|
512
|
+
"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 */"
|
|
512
513
|
},
|
|
513
514
|
{
|
|
514
515
|
"name": "mc_add_fixed_menu_item",
|
|
@@ -560,7 +561,7 @@
|
|
|
560
561
|
}
|
|
561
562
|
],
|
|
562
563
|
"result": "int",
|
|
563
|
-
"doc": "/**\
|
|
564
|
+
"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 */"
|
|
564
565
|
},
|
|
565
566
|
{
|
|
566
567
|
"name": "mc_add_list_text",
|
|
@@ -582,7 +583,7 @@
|
|
|
582
583
|
}
|
|
583
584
|
],
|
|
584
585
|
"result": "int",
|
|
585
|
-
"doc": "/**\
|
|
586
|
+
"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 */"
|
|
586
587
|
},
|
|
587
588
|
{
|
|
588
589
|
"name": "mc_clear_menu_items",
|
|
@@ -611,7 +612,7 @@
|
|
|
611
612
|
}
|
|
612
613
|
],
|
|
613
614
|
"result": "int",
|
|
614
|
-
"doc": "/**\
|
|
615
|
+
"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 */"
|
|
615
616
|
},
|
|
616
617
|
{
|
|
617
618
|
"name": "mc_set_menu_page",
|
|
@@ -640,7 +641,7 @@
|
|
|
640
641
|
}
|
|
641
642
|
],
|
|
642
643
|
"result": "string",
|
|
643
|
-
"doc": "/**\
|
|
644
|
+
"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 */"
|
|
644
645
|
}
|
|
645
646
|
],
|
|
646
647
|
"beside": {
|
|
@@ -685,7 +686,7 @@
|
|
|
685
686
|
"value": 7
|
|
686
687
|
}
|
|
687
688
|
],
|
|
688
|
-
"doc": "/**\
|
|
689
|
+
"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 */"
|
|
689
690
|
}
|
|
690
691
|
],
|
|
691
692
|
"contract": null,
|
|
@@ -694,18 +695,18 @@
|
|
|
694
695
|
"systems": {
|
|
695
696
|
"windows": {
|
|
696
697
|
"file": "prebuilt/windows/menu-core.aot",
|
|
697
|
-
"size":
|
|
698
|
-
"sha256": "
|
|
698
|
+
"size": 1194156,
|
|
699
|
+
"sha256": "c6883d6548da2d06b254a070f4902c6a63e8e50ed22b1c2a2d673afacd58ba92"
|
|
699
700
|
},
|
|
700
701
|
"linux": {
|
|
701
702
|
"file": "prebuilt/linux/menu-core.aot",
|
|
702
|
-
"size":
|
|
703
|
-
"sha256": "
|
|
703
|
+
"size": 1202952,
|
|
704
|
+
"sha256": "d7721e2f624c6259375559d95502ad9af3dc73e11042e800f6ec211a4de8869e"
|
|
704
705
|
}
|
|
705
706
|
},
|
|
706
707
|
"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",
|
|
708
|
+
"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 & Player) => void;\n\nexport type PlaceholderValue = (context: NamedContext & Player) => 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(29);\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(30);\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(31);\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(32);\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(33);\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(34);\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(35);\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(36);\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(37);\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(38);\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(39);\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(40);\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(41);\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(42);\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(43);\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(44);\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(45);\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(46);\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(47);\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(48);\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(49);\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(50);\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(51);\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(52);\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(53);\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(54);\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(55);\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(56);\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(57);\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(58);\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(59);\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(60);\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(61);\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\", 184891291);\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: Array<string>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w0(w, v[i]);\n}\n\nfunction __r23(r: __Reader): Array<string> {\n\tconst count = r.i32();\n\tconst list = new Array<string>();\n\tfor (let i: i32 = 0; i < count; i++) list.push(__r0(r));\n\treturn list;\n}\n\nfunction __w24(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 __u24(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 __r24(r: __Reader): MenuOptions {\n\tconst o = changetype<MenuOptions>(__new(offsetof<MenuOptions>(), idof<MenuOptions>()));\n\t__u24(r, o);\n\treturn o;\n}\n\nfunction __w25(w: __Writer, v: (a0: __Player, a1: __Player, a2: string) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 2, __invoke)); }\n\nfunction __r25(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 __w26(w: __Writer, v: (a0: NamedContext) => void): void { w.i32(__sendFunction(changetype<usize>(v), 3, __invoke)); }\n\nfunction __r26(r: __Reader): (a0: NamedContext) => void { return changetype<(a0: NamedContext) => void>(__receiveFunction(r, changetype<usize>(__stub3))); }\n\nfunction __w27(w: __Writer, v: Record<string, (a0: NamedContext) => void>): void {\n\tconst keys = Object.keys(v);\n\tw.i32(keys.length);\n\tfor (let i: i32 = 0; i < keys.length; i++) {\n\t\tw.str(keys[i]);\n\t\t__w26(w, v[keys[i]]);\n\t}\n}\n\nfunction __r27(r: __Reader): Record<string, (a0: NamedContext) => void> {\n\tconst count = r.i32();\n\tconst record: Record<string, (a0: NamedContext) => void> = {};\n\tfor (let i: i32 = 0; i < count; i++) {\n\t\tconst key = r.str();\n\t\trecord[key] = __r26(r);\n\t}\n\treturn record;\n}\n\nfunction __w28(w: __Writer, v: Record<string, (a0: NamedContext) => string>): void {\n\tconst keys = Object.keys(v);\n\tw.i32(keys.length);\n\tfor (let i: i32 = 0; i < keys.length; i++) {\n\t\tw.str(keys[i]);\n\t\t__w14(w, v[keys[i]]);\n\t}\n}\n\nfunction __r28(r: __Reader): Record<string, (a0: NamedContext) => string> {\n\tconst count = r.i32();\n\tconst record: Record<string, (a0: NamedContext) => string> = {};\n\tfor (let i: i32 = 0; i < count; i++) {\n\t\tconst key = r.str();\n\t\trecord[key] = __r14(r);\n\t}\n\treturn record;\n}\n\nfunction __w29(w: __Writer, v: (a0: NamedContext) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 5, __invoke)); }\n\nfunction __r29(r: __Reader): (a0: NamedContext) => bool { return changetype<(a0: NamedContext) => bool>(__receiveFunction(r, changetype<usize>(__stub5))); }\n\nfunction __w30(w: __Writer, v: (a0: __Player, a1: __Player, a2: string, a3: bool) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 6, __invoke)); }\n\nfunction __r30(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 __w31(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 __u31(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 __r31(r: __Reader): ListRow {\n\tconst o = changetype<ListRow>(__new(offsetof<ListRow>(), idof<ListRow>()));\n\t__u31(r, o);\n\treturn o;\n}\n\nfunction __w32(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 __u32(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 __r32(r: __Reader): MenuContext {\n\tconst o = changetype<MenuContext>(__new(offsetof<MenuContext>(), idof<MenuContext>()));\n\t__u32(r, o);\n\treturn o;\n}\n\nfunction __w33(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 __u33(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 __r33(r: __Reader): NamedContext {\n\tconst o = changetype<NamedContext>(__new(offsetof<NamedContext>(), idof<NamedContext>()));\n\t__u33(r, o);\n\treturn o;\n}\n\nfunction __w35(w: __Writer, v: Array<ListRow>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w31(w, v[i]);\n}\n\nfunction __r35(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(__r31(r));\n\treturn list;\n}\n\nfunction __w34(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__w35(w, v!);\n}\n\nfunction __r34(r: __Reader): Array<ListRow> | null {\n\tif (!r.bool()) return null;\n\treturn __r35(r);\n}\n\nfunction __w36(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 __u36(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 __r36(r: __Reader): MenuEvent {\n\tconst o = changetype<MenuEvent>(__new(offsetof<MenuEvent>(), idof<MenuEvent>()));\n\t__u36(r, o);\n\treturn o;\n}\n\nfunction __stub0(a0: MenuContext): string {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w32(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__w32(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__w33(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__w33(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__w33(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__w32(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r34(r);\n}\n\nfunction __stub8(a0: MenuEvent): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w36(w, a0);\n\tconst r = __callBack(target, w);\n\t__u36(r, a0);\n}\n\nfunction __stub9(a0: MenuContext): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w32(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 = __r32(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 = __r32(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 = __r33(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 = __r33(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 = __r33(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 = __r32(r);\n\t\t\tconst f = changetype<(a0: MenuContext) => Array<ListRow> | null>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w34(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 8: {\n\t\t\tconst a0 = __r36(r);\n\t\t\tconst f = changetype<(a0: MenuEvent) => void>(fn);\n\t\t\tf(a0);\n\t\t\t__w36(w, a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: {\n\t\t\tconst a0 = __r32(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(...names: string[]): Menu | null {\n\tconst __w = __service.begin(4);\n\t__w23(__w, names);\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__w24(__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__w25(__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__w26(__w, run);\n\tconst __r = __service.call(__w);\n\treturn __r22(__r);\n}\n\nexport function addActions(actions: Record<string, ActionHandler>): void {\n\tconst __w = __service.begin(8);\n\t__w27(__w, actions);\n\tconst __r = __service.call(__w);\n}\n\nexport function addPlaceholders(placeholders: Record<string, PlaceholderValue>): void {\n\tconst __w = __service.begin(9);\n\t__w28(__w, placeholders);\n\tconst __r = __service.call(__w);\n}\n\nexport function addPlaceholder(name: string, value: PlaceholderValue): i32 {\n\tconst __w = __service.begin(10);\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(11);\n\t__w0(__w, name);\n\t__w29(__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(12);\n\t__w0(__w, menu);\n\t__w0(__w, action);\n\t__w29(__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(13);\n\t__w0(__w, name);\n\t__w30(__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(14);\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(15);\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(16);\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 __r31(__r);\n}\n\nexport function textRow(text: string, centered = false): ListRow {\n\tconst __w = __service.begin(17);\n\t__w0(__w, text);\n\t__w1(__w, centered);\n\tconst __r = __service.call(__w);\n\treturn __r31(__r);\n}\n\nexport function show(player: Player, name: string, options: MenuShowOptions = {}): bool {\n\tconst __w = __service.begin(18);\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(19);\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(20);\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(21);\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(22);\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(23);\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(24);\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(25);\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(26);\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(27);\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(28);\n\t__w0(__w, name);\n\tconst __r = __service.call(__w);\n\treturn __r1(__r);\n}\n",
|
|
709
|
+
"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 = __r6(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 = __r7(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 = __r13(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 = __r14(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 = __r15(r);\n\t\t\t__m.addActions(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: {\n\t\t\tconst a0 = __r16(r);\n\t\t\t__m.addPlaceholders(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 10: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r17(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 11: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r18(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 12: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r0(r);\n\t\t\tconst a2 = __r18(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 13: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r19(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 14: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r20(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 15: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r21(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 16: {\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__w22(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 17: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r10(r);\n\t\t\tconst result = __m.textRow(a0, a1);\n\t\t\t__w22(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 18: {\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst a1 = __r0(r);\n\t\t\tconst a2 = __r24(r);\n\t\t\tconst result = __m.show(a0, a1, a2);\n\t\t\t__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 19: {\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst a1 = __r10(r);\n\t\t\t__m.close(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 20: {\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 21: {\n\t\t\tconst a0 = __r0(r);\n\t\t\t__m.conditionChanged(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 22: {\n\t\t\tconst a0 = __r23(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 23: {\n\t\t\tconst a0 = __r23(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 24: {\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst a1 = __r10(r);\n\t\t\t__m.lock(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 25: {\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst result = __m.isLocked(a0);\n\t\t\t__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 26: {\n\t\t\tconst a0 = __r23(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 27: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst result = __m.hasAction(a0);\n\t\t\t__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 28: {\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst result = __m.hasText(a0);\n\t\t\t__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 29: {\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 30: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w10(w, o.hideBack);\n\t\t\tbreak;\n\t\t}\n\t\tcase 31: {\n\t\t\tconst o = __r3(r);\n\t\t\to.hideBack = __r10(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 32: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w10(w, o.hideExit);\n\t\t\tbreak;\n\t\t}\n\t\tcase 33: {\n\t\t\tconst o = __r3(r);\n\t\t\to.hideExit = __r10(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 34: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w10(w, o.locked);\n\t\t\tbreak;\n\t\t}\n\t\tcase 35: {\n\t\t\tconst o = __r3(r);\n\t\t\to.locked = __r10(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 36: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w10(w, o.sharedTimer);\n\t\t\tbreak;\n\t\t}\n\t\tcase 37: {\n\t\t\tconst o = __r3(r);\n\t\t\to.sharedTimer = __r10(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 38: {\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 39: {\n\t\t\tconst o = __r3(r);\n\t\t\to.time = __r5(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.onTimeout);\n\t\t\tbreak;\n\t\t}\n\t\tcase 41: {\n\t\t\tconst o = __r3(r);\n\t\t\to.onTimeout = __r0(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 42: {\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 43: {\n\t\t\tconst o = __r3(r);\n\t\t\to.activeOn = __r0(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 44: {\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 45: {\n\t\t\tconst o = __r3(r);\n\t\t\to.countdown = __r5(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 46: {\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 47: {\n\t\t\tconst o = __r3(r);\n\t\t\t__w9(w, o.title);\n\t\t\tbreak;\n\t\t}\n\t\tcase 48: {\n\t\t\tconst o = __r3(r);\n\t\t\to.title = __r9(r);\n\t\t\tbreak;\n\t\t}\n\t\tcase 49: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r26(r);\n\t\t\to.addItem(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 50: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r5(r);\n\t\t\tconst a1 = __r26(r);\n\t\t\to.addFixedItem(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 51: {\n\t\t\tconst o = __r3(r);\n\t\t\to.clearItems();\n\t\t\tbreak;\n\t\t}\n\t\tcase 52: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r12(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 53: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r17(r);\n\t\t\to.addPlaceholder(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\to.setListSource(a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 55: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r0(r);\n\t\t\tconst a1 = __r21(r);\n\t\t\to.addEventListener(a0, a1);\n\t\t\tbreak;\n\t\t}\n\t\tcase 56: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst a1 = __r24(r);\n\t\t\tconst result = o.show(a0, a1);\n\t\t\t__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 57: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst a1 = __r0(r);\n\t\t\tconst a2 = __r25(r);\n\t\t\to.runActions(a0, a1, a2);\n\t\t\tbreak;\n\t\t}\n\t\tcase 58: {\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 59: {\n\t\t\tconst o = __r3(r);\n\t\t\to.close();\n\t\t\tbreak;\n\t\t}\n\t\tcase 60: {\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__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 61: {\n\t\t\tconst o = __r3(r);\n\t\t\tconst result = o.cancelTimer();\n\t\t\t__w10(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__w32(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__w32(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r10(r);\n}\n\nfunction __stub2(a0: __Player, a1: __Player, a2: string): bool {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w23(w, a0);\n\t__w23(w, a1);\n\t__w0(w, a2);\n\tconst r = __callBack(target, w);\n\treturn __r10(r);\n}\n\nfunction __stub3(a0: __M_NamedContext): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w33(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__w33(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__w33(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r10(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__w23(w, a0);\n\t__w23(w, a1);\n\t__w0(w, a2);\n\t__w10(w, a3);\n\tconst r = __callBack(target, w);\n\treturn __r10(r);\n}\n\nfunction __stub7(a0: __M_MenuContext): Array<__M_ListRow> | null {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w32(w, a0);\n\tconst r = __callBack(target, w);\n\treturn __r34(r);\n}\n\nfunction __stub8(a0: __M_MenuEvent): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w36(w, a0);\n\tconst r = __callBack(target, w);\n\t__u36(r, a0);\n}\n\nfunction __stub9(a0: __M_MenuContext): void {\n\tconst target = __remoteTarget();\n\tconst w = __beginCallback(target);\n\t__w32(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 = __r32(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 = __r32(r);\n\t\t\tconst f = changetype<(a0: __M_MenuContext) => bool>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 2: {\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst a1 = __r23(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__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 3: {\n\t\t\tconst a0 = __r33(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 = __r33(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 = __r33(r);\n\t\t\tconst f = changetype<(a0: __M_NamedContext) => bool>(fn);\n\t\t\tconst result = f(a0);\n\t\t\t__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 6: {\n\t\t\tconst a0 = __r23(r);\n\t\t\tconst a1 = __r23(r);\n\t\t\tconst a2 = __r0(r);\n\t\t\tconst a3 = __r10(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__w10(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 7: {\n\t\t\tconst a0 = __r32(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__w34(w, result);\n\t\t\tbreak;\n\t\t}\n\t\tcase 8: {\n\t\t\tconst a0 = __r36(r);\n\t\t\tconst f = changetype<(a0: __M_MenuEvent) => void>(fn);\n\t\t\tf(a0);\n\t\t\t__w36(w, a0);\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: {\n\t\t\tconst a0 = __r32(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 __w6(w: __Writer, v: Array<string>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w0(w, v[i]);\n}\n\nfunction __r6(r: __Reader): Array<string> {\n\tconst count = r.i32();\n\tconst list = new Array<string>();\n\tfor (let i: i32 = 0; i < count; i++) list.push(__r0(r));\n\treturn list;\n}\n\nfunction __w9(w: __Writer, v: (a0: __M_MenuContext) => string): void { w.i32(__sendFunction(changetype<usize>(v), 0, __invoke)); }\n\nfunction __r9(r: __Reader): (a0: __M_MenuContext) => string { return changetype<(a0: __M_MenuContext) => string>(__receiveFunction(r, changetype<usize>(__stub0))); }\n\nfunction __w8(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__w9(w, v!);\n}\n\nfunction __r8(r: __Reader): ((a0: __M_MenuContext) => string) | null {\n\tif (!r.bool()) return null;\n\treturn __r9(r);\n}\n\nfunction __w10(w: __Writer, v: bool): void { w.bool(v); }\n\nfunction __r10(r: __Reader): bool { return r.bool(); }\n\nfunction __w12(w: __Writer, v: (a0: __M_MenuContext) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 1, __invoke)); }\n\nfunction __r12(r: __Reader): (a0: __M_MenuContext) => bool { return changetype<(a0: __M_MenuContext) => bool>(__receiveFunction(r, changetype<usize>(__stub1))); }\n\nfunction __w11(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__w12(w, v!);\n}\n\nfunction __r11(r: __Reader): ((a0: __M_MenuContext) => bool) | null {\n\tif (!r.bool()) return null;\n\treturn __r12(r);\n}\n\nfunction __w7(w: __Writer, v: __M_MenuOptions): void {\n\t__w8(w, v.title);\n\t__w5(w, v.time);\n\tw.bool(v.hideBack !== undefined);\n\tif (v.hideBack !== undefined) __w10(w, v.hideBack);\n\tw.bool(v.hideExit !== undefined);\n\tif (v.hideExit !== undefined) __w10(w, v.hideExit);\n\tw.bool(v.locked !== undefined);\n\tif (v.locked !== undefined) __w10(w, v.locked);\n\t__w11(w, v.activeWhen);\n}\n\nfunction __u7(r: __Reader, o: __M_MenuOptions): void {\n\to.title = __r8(r);\n\to.time = __r5(r);\n\tif (r.bool()) o.hideBack = __r10(r);\n\telse o.hideBack = undefined;\n\tif (r.bool()) o.hideExit = __r10(r);\n\telse o.hideExit = undefined;\n\tif (r.bool()) o.locked = __r10(r);\n\telse o.locked = undefined;\n\to.activeWhen = __r11(r);\n}\n\nfunction __r7(r: __Reader): __M_MenuOptions {\n\tconst o = changetype<__M_MenuOptions>(__new(offsetof<__M_MenuOptions>(), idof<__M_MenuOptions>()));\n\t__u7(r, o);\n\treturn o;\n}\n\nfunction __w13(w: __Writer, v: (a0: __Player, a1: __Player, a2: string) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 2, __invoke)); }\n\nfunction __r13(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 __w14(w: __Writer, v: (a0: __M_NamedContext) => void): void { w.i32(__sendFunction(changetype<usize>(v), 3, __invoke)); }\n\nfunction __r14(r: __Reader): (a0: __M_NamedContext) => void { return changetype<(a0: __M_NamedContext) => void>(__receiveFunction(r, changetype<usize>(__stub3))); }\n\nfunction __w15(w: __Writer, v: Record<string, (a0: __M_NamedContext) => void>): void {\n\tconst keys = Object.keys(v);\n\tw.i32(keys.length);\n\tfor (let i: i32 = 0; i < keys.length; i++) {\n\t\tw.str(keys[i]);\n\t\t__w14(w, v[keys[i]]);\n\t}\n}\n\nfunction __r15(r: __Reader): Record<string, (a0: __M_NamedContext) => void> {\n\tconst count = r.i32();\n\tconst record: Record<string, (a0: __M_NamedContext) => void> = {};\n\tfor (let i: i32 = 0; i < count; i++) {\n\t\tconst key = r.str();\n\t\trecord[key] = __r14(r);\n\t}\n\treturn record;\n}\n\nfunction __w17(w: __Writer, v: (a0: __M_NamedContext) => string): void { w.i32(__sendFunction(changetype<usize>(v), 4, __invoke)); }\n\nfunction __r17(r: __Reader): (a0: __M_NamedContext) => string { return changetype<(a0: __M_NamedContext) => string>(__receiveFunction(r, changetype<usize>(__stub4))); }\n\nfunction __w16(w: __Writer, v: Record<string, (a0: __M_NamedContext) => string>): void {\n\tconst keys = Object.keys(v);\n\tw.i32(keys.length);\n\tfor (let i: i32 = 0; i < keys.length; i++) {\n\t\tw.str(keys[i]);\n\t\t__w17(w, v[keys[i]]);\n\t}\n}\n\nfunction __r16(r: __Reader): Record<string, (a0: __M_NamedContext) => string> {\n\tconst count = r.i32();\n\tconst record: Record<string, (a0: __M_NamedContext) => string> = {};\n\tfor (let i: i32 = 0; i < count; i++) {\n\t\tconst key = r.str();\n\t\trecord[key] = __r17(r);\n\t}\n\treturn record;\n}\n\nfunction __w18(w: __Writer, v: (a0: __M_NamedContext) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 5, __invoke)); }\n\nfunction __r18(r: __Reader): (a0: __M_NamedContext) => bool { return changetype<(a0: __M_NamedContext) => bool>(__receiveFunction(r, changetype<usize>(__stub5))); }\n\nfunction __w19(w: __Writer, v: (a0: __Player, a1: __Player, a2: string, a3: bool) => bool): void { w.i32(__sendFunction(changetype<usize>(v), 6, __invoke)); }\n\nfunction __r19(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 __w20(w: __Writer, v: (a0: __M_MenuContext) => Array<__M_ListRow> | null): void { w.i32(__sendFunction(changetype<usize>(v), 7, __invoke)); }\n\nfunction __r20(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 __w21(w: __Writer, v: (a0: __M_MenuEvent) => void): void { w.i32(__sendFunction(changetype<usize>(v), 8, __invoke)); }\n\nfunction __r21(r: __Reader): (a0: __M_MenuEvent) => void { return changetype<(a0: __M_MenuEvent) => void>(__receiveFunction(r, changetype<usize>(__stub8))); }\n\nfunction __w22(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 __u22(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 __r22(r: __Reader): __M_ListRow {\n\tconst o = changetype<__M_ListRow>(__new(offsetof<__M_ListRow>(), idof<__M_ListRow>()));\n\t__u22(r, o);\n\treturn o;\n}\n\nfunction __w23(w: __Writer, v: __Player): void { w.i32(<i32>v.id); }\n\nfunction __r23(r: __Reader): __Player { return new __Player(r.i32()); }\n\nfunction __w25(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__w23(w, v!);\n}\n\nfunction __r25(r: __Reader): __Player | null {\n\tif (!r.bool()) return null;\n\treturn __r23(r);\n}\n\nfunction __w24(w: __Writer, v: __M_MenuShowOptions): void {\n\t__w5(w, v.time);\n\t__w25(w, v.target);\n\tw.bool(v.resetHistory !== undefined);\n\tif (v.resetHistory !== undefined) __w10(w, v.resetHistory);\n\tw.bool(v.force !== undefined);\n\tif (v.force !== undefined) __w10(w, v.force);\n\tw.bool(v.skipHistory !== undefined);\n\tif (v.skipHistory !== undefined) __w10(w, v.skipHistory);\n}\n\nfunction __u24(r: __Reader, o: __M_MenuShowOptions): void {\n\to.time = __r5(r);\n\to.target = __r25(r);\n\tif (r.bool()) o.resetHistory = __r10(r);\n\telse o.resetHistory = undefined;\n\tif (r.bool()) o.force = __r10(r);\n\telse o.force = undefined;\n\tif (r.bool()) o.skipHistory = __r10(r);\n\telse o.skipHistory = undefined;\n}\n\nfunction __r24(r: __Reader): __M_MenuShowOptions {\n\tconst o = changetype<__M_MenuShowOptions>(__new(offsetof<__M_MenuShowOptions>(), idof<__M_MenuShowOptions>()));\n\t__u24(r, o);\n\treturn o;\n}\n\nfunction __w28(w: __Writer, v: (a0: __M_MenuContext) => void): void { w.i32(__sendFunction(changetype<usize>(v), 9, __invoke)); }\n\nfunction __r28(r: __Reader): (a0: __M_MenuContext) => void { return changetype<(a0: __M_MenuContext) => void>(__receiveFunction(r, changetype<usize>(__stub9))); }\n\nfunction __w27(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__w28(w, v!);\n}\n\nfunction __r27(r: __Reader): ((a0: __M_MenuContext) => void) | null {\n\tif (!r.bool()) return null;\n\treturn __r28(r);\n}\n\nfunction __w31(w: __Writer, v: __M_Requirement): void {\n\t__w12(w, v.when);\n\t__w8(w, v.message);\n}\n\nfunction __u31(r: __Reader, o: __M_Requirement): void {\n\to.when = __r12(r);\n\to.message = __r8(r);\n}\n\nfunction __r31(r: __Reader): __M_Requirement {\n\tconst o = changetype<__M_Requirement>(__new(offsetof<__M_Requirement>(), idof<__M_Requirement>()));\n\t__u31(r, o);\n\treturn o;\n}\n\nfunction __w30(w: __Writer, v: Array<__M_Requirement>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w31(w, v[i]);\n}\n\nfunction __r30(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(__r31(r));\n\treturn list;\n}\n\nfunction __w29(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__w30(w, v!);\n}\n\nfunction __r29(r: __Reader): Array<__M_Requirement> | null {\n\tif (!r.bool()) return null;\n\treturn __r30(r);\n}\n\nfunction __w26(w: __Writer, v: __M_MenuItemOptions): void {\n\t__w9(w, v.title);\n\t__w27(w, v.onSelect);\n\t__w11(w, v.visible);\n\t__w29(w, v.enabled);\n\t__w8(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 __u26(r: __Reader, o: __M_MenuItemOptions): void {\n\to.title = __r9(r);\n\to.onSelect = __r27(r);\n\to.visible = __r11(r);\n\to.enabled = __r29(r);\n\to.message = __r8(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 __r26(r: __Reader): __M_MenuItemOptions {\n\tconst o = changetype<__M_MenuItemOptions>(__new(offsetof<__M_MenuItemOptions>(), idof<__M_MenuItemOptions>()));\n\t__u26(r, o);\n\treturn o;\n}\n\nfunction __w32(w: __Writer, v: __M_MenuContext): void {\n\t__w23(w, v.player);\n\t__w23(w, v.target);\n\t__w5(w, v.row);\n\t__w3(w, v.menu);\n}\n\nfunction __u32(r: __Reader, o: __M_MenuContext): void {\n\to.player = __r23(r);\n\to.target = __r23(r);\n\to.row = __r5(r);\n\to.menu = __r3(r);\n}\n\nfunction __r32(r: __Reader): __M_MenuContext {\n\tconst o = changetype<__M_MenuContext>(__new(offsetof<__M_MenuContext>(), idof<__M_MenuContext>()));\n\t__u32(r, o);\n\treturn o;\n}\n\nfunction __w33(w: __Writer, v: __M_NamedContext): void {\n\t__w23(w, v.player);\n\t__w23(w, v.target);\n\t__w5(w, v.row);\n\t__w3(w, v.menu);\n\t__w0(w, v.name);\n}\n\nfunction __u33(r: __Reader, o: __M_NamedContext): void {\n\to.player = __r23(r);\n\to.target = __r23(r);\n\to.row = __r5(r);\n\to.menu = __r3(r);\n\to.name = __r0(r);\n}\n\nfunction __r33(r: __Reader): __M_NamedContext {\n\tconst o = changetype<__M_NamedContext>(__new(offsetof<__M_NamedContext>(), idof<__M_NamedContext>()));\n\t__u33(r, o);\n\treturn o;\n}\n\nfunction __w35(w: __Writer, v: Array<__M_ListRow>): void {\n\tw.i32(v.length);\n\tfor (let i: i32 = 0; i < v.length; i++) __w22(w, v[i]);\n}\n\nfunction __r35(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(__r22(r));\n\treturn list;\n}\n\nfunction __w34(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__w35(w, v!);\n}\n\nfunction __r34(r: __Reader): Array<__M_ListRow> | null {\n\tif (!r.bool()) return null;\n\treturn __r35(r);\n}\n\nfunction __w36(w: __Writer, v: __M_MenuEvent): void {\n\t__w10(w, v.defaultPrevented);\n\t__w23(w, v.player);\n\t__w3(w, v.menu);\n\t__w10(w, v.timeout);\n}\n\nfunction __u36(r: __Reader, o: __M_MenuEvent): void {\n\to.defaultPrevented = __r10(r);\n\to.player = __r23(r);\n\to.menu = __r3(r);\n\to.timeout = __r10(r);\n}\n\nfunction __r36(r: __Reader): __M_MenuEvent {\n\tconst o = changetype<__M_MenuEvent>(__new(offsetof<__M_MenuEvent>(), idof<__M_MenuEvent>()));\n\t__u36(r, o);\n\treturn o;\n}\n\n__serve(\"menu-core\", 184891291, __dispatch);\n",
|
|
709
710
|
"callbacks": true
|
|
710
711
|
}
|
|
711
712
|
}
|
|
Binary file
|
|
@@ -204,8 +204,16 @@ export default {
|
|
|
204
204
|
ru: `Меню с этим номером среди всех — обратное к \`indexOf()\`; \`null\`, если такого нет.`,
|
|
205
205
|
},
|
|
206
206
|
"register": {
|
|
207
|
-
en: `
|
|
208
|
-
|
|
207
|
+
en: `
|
|
208
|
+
The menus of those names in the menu file, read now if they are not yet:
|
|
209
|
+
\`menus.register("SHOP", "SHOP_GUNS")\`. Returns the first one's menu;
|
|
210
|
+
\`null\` when the file has no such menu, or no items in it.
|
|
211
|
+
`,
|
|
212
|
+
ru: `
|
|
213
|
+
Меню с этими именами из файла меню, прочитанные сейчас, если ещё не
|
|
214
|
+
прочитаны: \`menus.register("SHOP", "SHOP_GUNS")\`. Возвращает меню первого;
|
|
215
|
+
\`null\`, если такого меню в файле нет или в нём нет пунктов.
|
|
216
|
+
`,
|
|
209
217
|
},
|
|
210
218
|
"create": {
|
|
211
219
|
en: `
|
|
@@ -225,6 +233,14 @@ export default {
|
|
|
225
233
|
en: `Registers an action by name, for menu files and Pawn plugins; \`SHOW_<MENU>\` and \`CLOSE_MENU\` are built in.`,
|
|
226
234
|
ru: `Регистрирует действие по имени — для файлов меню и Pawn-плагинов; \`SHOW_<MENU>\` и \`CLOSE_MENU\` встроены.`,
|
|
227
235
|
},
|
|
236
|
+
"addActions": {
|
|
237
|
+
en: `Registers actions by name, for menu files and Pawn plugins: \`menus.addActions({ SHOP_HEAL: heal, SHOP_ARMOR: (player) => player.armor = 100 })\`.`,
|
|
238
|
+
ru: `Регистрирует действия по именам — для файлов меню и Pawn-плагинов: \`menus.addActions({ SHOP_HEAL: heal, SHOP_ARMOR: (player) => player.armor = 100 })\`.`,
|
|
239
|
+
},
|
|
240
|
+
"addPlaceholders": {
|
|
241
|
+
en: `Registers placeholders for menu files and Pawn plugins: \`menus.addPlaceholders({ nick: (player) => player.name })\`. A name registered twice keeps the first.`,
|
|
242
|
+
ru: `Регистрирует плейсхолдеры для файлов меню и Pawn-плагинов: \`menus.addPlaceholders({ nick: (player) => player.name })\`. Если имя зарегистрировано дважды, остаётся первое.`,
|
|
243
|
+
},
|
|
228
244
|
"addPlaceholder": {
|
|
229
245
|
en: `Registers a placeholder for menu files and Pawn plugins: the text \`%name%\` stands for in titles and items. A name registered twice keeps the first. In code the text is a function instead.`,
|
|
230
246
|
ru: `Регистрирует плейсхолдер для файлов меню и Pawn-плагинов: текст, которым заменяется \`%name%\` в заголовках и пунктах. Если имя зарегистрировано дважды, остаётся первое. В коде текст — функция.`,
|
|
@@ -270,12 +270,12 @@ export default {
|
|
|
270
270
|
ru: `Проверка условия, как её регистрирует \`addCondition()\`. В меню-списке \`player\` — игрок строки, \`viewer\` — тот, кто смотрит.`,
|
|
271
271
|
},
|
|
272
272
|
"ActionHandler": {
|
|
273
|
-
en: `An action, as \`addAction()\` registers it: run with the context of the item chosen
|
|
274
|
-
ru: `Действие, как его регистрирует \`addAction()\`: выполняется с контекстом выбранного пункта и именем
|
|
273
|
+
en: `An action, as \`addAction()\` registers it: run with the context of the item chosen and the action's name - \`({ player, menu }) => ...\` - or with the player who chose it, \`(player) => ...\`.`,
|
|
274
|
+
ru: `Действие, как его регистрирует \`addAction()\`: выполняется с контекстом выбранного пункта и именем действия — \`({ player, menu }) => ...\` — или с игроком, который его выбрал, \`(player) => ...\`.`,
|
|
275
275
|
},
|
|
276
276
|
"PlaceholderValue": {
|
|
277
|
-
en: `A placeholder's value: the text \`%name%\` stands for, given the context of the text it is in
|
|
278
|
-
ru: `Значение плейсхолдера: текст, которым заменяется \`%name%\`, по контексту текста, в котором он
|
|
277
|
+
en: `A placeholder's value: the text \`%name%\` stands for, given the context of the text it is in - \`({ player, target }) => ...\` - or the player who reads it, \`(player) => ...\`.`,
|
|
278
|
+
ru: `Значение плейсхолдера: текст, которым заменяется \`%name%\`, по контексту текста, в котором он стоит, — \`({ player, target }) => ...\` — или по игроку, который его читает, \`(player) => ...\`.`,
|
|
279
279
|
},
|
|
280
280
|
"RestrictionTest": {
|
|
281
281
|
en: `A restriction's test, as \`addRestriction()\` registers it; \`name\` is the whole token, \`"NAME:param"\` included.`,
|
package/src/internal.ts
CHANGED
|
@@ -308,6 +308,10 @@ export interface Viewer {
|
|
|
308
308
|
/** The name of the menu he looks at; "" for none. */
|
|
309
309
|
menu: string;
|
|
310
310
|
page: number;
|
|
311
|
+
/** The page setPage() asked for, drawn at the next show; -1 for none. */
|
|
312
|
+
nextPage: number;
|
|
313
|
+
/** The menu whose item he chose, while its action runs; "" otherwise. */
|
|
314
|
+
choosing: string;
|
|
311
315
|
target: number;
|
|
312
316
|
history: HistoryStep[];
|
|
313
317
|
slots: ShownSlot[];
|