@amxts/menu-core 0.1.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.
@@ -0,0 +1,298 @@
1
+ // The tooltips of src/index.ts, in both languages: scripts/apply-docs.ts writes the
2
+ // one AMXTS_DOCS_LANG picks into the JSDoc above each element.
3
+ export default {
4
+ "Menu": {
5
+ en: `
6
+ A menu: read from a menu file, or made with \`create()\`. The fields are what
7
+ the file sets; the methods fill the menu, open it and count it down.
8
+
9
+ const shop = menus.create("SHOP", { title: "Shop" });
10
+ shop.addItem("Heal", { onSelect: heal });
11
+ shop.show(player);
12
+ `,
13
+ ru: `
14
+ Меню: прочитанное из файла меню или сделанное через \`create()\`. Поля — то,
15
+ что задаёт файл; методы наполняют меню, открывают его и ведут отсчёт.
16
+
17
+ const shop = menus.create("SHOP", { title: "Shop" });
18
+ shop.addItem("Heal", { onSelect: heal });
19
+ shop.show(player);
20
+ `,
21
+ },
22
+ "Menu.kind": {
23
+ en: `The menu's kind, one of \`"items"\` (a list of items) or \`"list"\` (a row per player, or per row of a list source). A name starting with \`LIST_\` makes a list.`,
24
+ ru: `Вид меню, одно из \`"items"\` (список пунктов) или \`"list"\` (строка на игрока или на строку источника). Имя на \`LIST_\` даёт список.`,
25
+ },
26
+ "Menu.hideBack": {
27
+ en: `Hiding of the \`"Back"\` button: \`true\` leaves it out.`,
28
+ ru: `Скрытие кнопки \`"Назад"\`: \`true\` убирает её.`,
29
+ },
30
+ "Menu.hideExit": {
31
+ en: `Hiding of the \`"Exit"\` button: \`true\` leaves it out.`,
32
+ ru: `Скрытие кнопки \`"Выход"\`: \`true\` убирает её.`,
33
+ },
34
+ "Menu.locked": {
35
+ en: `A lock on the menu: while \`true\`, items cannot be chosen and no other menu replaces this one.`,
36
+ ru: `Блокировка меню: пока \`true\`, пункты нельзя выбрать и другое меню не заменяет это.`,
37
+ },
38
+ "Menu.sharedTimer": {
39
+ en: `One countdown for everyone looking at the menu (\`true\`), rather than one per player.`,
40
+ ru: `Один отсчёт на всех, кто смотрит меню (\`true\`), а не у каждого игрока свой.`,
41
+ },
42
+ "Menu.time": {
43
+ en: `Seconds on the countdown when the menu opens, e.g. \`10\`; \`0\` for none.`,
44
+ ru: `Секунды отсчёта при открытии меню, например \`10\`; \`0\` — без отсчёта.`,
45
+ },
46
+ "Menu.onTimeout": {
47
+ en: `Action names run when the countdown ends, e.g. \`"CLOSE_MENU"\`; \`""\` closes the menu.`,
48
+ ru: `Имена действий, которые выполняются, когда отсчёт кончился, например \`"CLOSE_MENU"\`; \`""\` закрывает меню.`,
49
+ },
50
+ "Menu.activeOn": {
51
+ en: `Condition names the menu opens only under, space-separated, e.g. \`"IS_ALIVE !IS_SPECTATOR"\`; \`""\` for always.`,
52
+ ru: `Имена условий, при которых меню открывается, через пробел, например \`"IS_ALIVE !IS_SPECTATOR"\`; \`""\` — всегда.`,
53
+ },
54
+ "Menu.countdown": {
55
+ en: `Seconds left on the shared countdown; \`0\` while none runs.`,
56
+ ru: `Секунды, оставшиеся на общем отсчёте; \`0\`, пока отсчёт не идёт.`,
57
+ },
58
+ "Menu.name": {
59
+ en: `The menu's name - its name in the menu file, e.g. \`"MAIN_MENU"\`.`,
60
+ ru: `Имя меню — его имя в файле меню, например \`"MAIN_MENU"\`.`,
61
+ },
62
+ "Menu.title": {
63
+ en: `The menu's title: the text - a lang key too - or a function that gives it for the player who looks.`,
64
+ ru: `Заголовок меню: сам текст — или ключ словаря — либо функция, которая даёт его для игрока, который смотрит.`,
65
+ },
66
+ "Menu.addItem": {
67
+ en: `
68
+ Adds an item: its text, or a function that gives it for the player -
69
+ \`target\` is the row's in a list menu, else the menu's.
70
+
71
+ shop.addItem((player) => \`Heal (\${player.health} HP)\`, { onSelect: heal });
72
+ `,
73
+ ru: `
74
+ Добавляет пункт: его текст или функцию, которая даёт текст для игрока, —
75
+ \`target\` — цель строки в меню-списке, иначе меню.
76
+
77
+ shop.addItem((player) => \`Heal (\${player.health} HP)\`, { onSelect: heal });
78
+ `,
79
+ },
80
+ "Menu.addFixedItem": {
81
+ en: `Adds an item that takes the same slot on every page: \`slot\` is its key, \`1\` to \`7\`; the text as \`addItem()\` takes it.`,
82
+ ru: `Добавляет пункт, который на каждой странице занимает один слот: \`slot\` — его клавиша, от \`1\` до \`7\`; текст — как у \`addItem()\`.`,
83
+ },
84
+ "Menu.clearItems": {
85
+ en: `Removes every item of the menu, fixed ones too.`,
86
+ ru: `Удаляет все пункты меню, включая фиксированные.`,
87
+ },
88
+ "Menu.addFilter": {
89
+ en: `A filter of a list menu: rows \`test\` says no to are left out, and \`message\` is said when none is left.`,
90
+ ru: `Фильтр меню-списка: строки, на которые \`test\` отвечает «нет», пропускаются, а если не осталось ни одной, игрок получает \`message\`.`,
91
+ },
92
+ "Menu.addPlaceholder": {
93
+ en: `A placeholder of this menu, for menu files and Pawn plugins: the text \`%name%\` stands for, before the ones registered with \`addPlaceholder()\`. In code the text is a function instead.`,
94
+ ru: `Плейсхолдер этого меню — для файлов меню и Pawn-плагинов: текст, которым заменяется \`%name%\`, раньше зарегистрированных через \`addPlaceholder()\`. В коде текст — функция.`,
95
+ },
96
+ "Menu.setListSource": {
97
+ en: `The source of this list menu's rows, instead of the players.`,
98
+ ru: `Источник строк этого меню-списка вместо игроков.`,
99
+ },
100
+ "Menu.addEventListener": {
101
+ en: `Calls \`listener\` on this menu's events of \`type\`, one of \`"open"\`, \`"close"\` or \`"show"\` (before it opens).`,
102
+ ru: `Вызывает \`listener\` на события этого меню типа \`type\` — одно из \`"open"\`, \`"close"\` или \`"show"\` (до открытия).`,
103
+ },
104
+ "Menu.show": {
105
+ en: `
106
+ Shows the menu to the player; \`false\` when it does not open - a \`"show"\`
107
+ listener stopped it, it is not active, or the player's menu holds on.
108
+ `,
109
+ ru: `
110
+ Показывает меню игроку; \`false\`, если оно не открылось — его отменил
111
+ обработчик \`"show"\`, оно не активно или меню игрока не уступает место.
112
+ `,
113
+ },
114
+ "Menu.refresh": {
115
+ en: `Draws the menu again for whoever looks at it; the number of players it was drawn for.`,
116
+ ru: `Перерисовывает меню у всех, кто его смотрит; число игроков, у которых оно перерисовано.`,
117
+ },
118
+ "Menu.close": {
119
+ en: `Closes the menu for whoever looks at it.`,
120
+ ru: `Закрывает меню у всех, кто его смотрит.`,
121
+ },
122
+ "Menu.setTimer": {
123
+ en: `
124
+ Sets the shared countdown: starts it when none runs, or changes the
125
+ seconds left - \`0\` stops it where it is. \`false\` when there is nothing to change.
126
+ `,
127
+ ru: `
128
+ Задаёт общий отсчёт: запускает его, если он не идёт, или меняет
129
+ оставшиеся секунды — \`0\` останавливает его на месте. \`false\`, если менять нечего.
130
+ `,
131
+ },
132
+ "Menu.cancelTimer": {
133
+ en: `Stops the shared countdown and closes the menu for everyone looking at it. \`false\` when none ran.`,
134
+ ru: `Останавливает общий отсчёт и закрывает меню у всех, кто его смотрит. \`false\`, если отсчёт не шёл.`,
135
+ },
136
+ "MenuEvent": {
137
+ en: `A menu event: the \`player\`, the \`menu\`, and on \`"close"\` whether its \`timeout\` ran out.`,
138
+ ru: `Событие меню: игрок \`player\`, меню \`menu\` и на \`"close"\` — вышло ли время (\`timeout\`).`,
139
+ },
140
+ "MenuEvent.defaultPrevented": {
141
+ en: `A mark of \`preventDefault()\`: \`true\` once it was called.`,
142
+ ru: `Отметка \`preventDefault()\`: \`true\`, если его вызвали.`,
143
+ },
144
+ "MenuEvent.player": {
145
+ en: `The player whose menu it is.`,
146
+ ru: `Игрок, чьё это меню.`,
147
+ },
148
+ "MenuEvent.menu": {
149
+ en: `The menu the event is about.`,
150
+ ru: `Меню, о котором событие.`,
151
+ },
152
+ "MenuEvent.timeout": {
153
+ en: `On \`"close"\`: \`true\` when the menu closed because its time ran out.`,
154
+ ru: `На \`"close"\`: \`true\`, если меню закрылось, потому что вышло время.`,
155
+ },
156
+ "MenuEvent.preventDefault": {
157
+ en: `On \`"show"\`: keeps the menu from opening.`,
158
+ ru: `На \`"show"\`: не даёт меню открыться.`,
159
+ },
160
+ "MenuListener": {
161
+ en: `A listener of menu events, as \`addEventListener()\` calls it.`,
162
+ ru: `Обработчик событий меню, как его вызывает \`addEventListener()\`.`,
163
+ },
164
+ "setConfigFile": {
165
+ en: `
166
+ Sets the file menus are read from, under \`configs/\`: without an extension,
167
+ the first of \`.ini\`, \`.yaml\`, \`.yml\`, \`.json\` and \`.jsonc\` that is there. Read when
168
+ a menu is first asked for; \`fallback\` is read instead when \`file\` is empty.
169
+ `,
170
+ ru: `
171
+ Задаёт файл, из которого читаются меню: путь от \`configs/\`; без расширения —
172
+ первый из \`.ini\`, \`.yaml\`, \`.yml\`, \`.json\` и \`.jsonc\`, который есть. Читается, когда
173
+ меню понадобится впервые; если \`file\` пуст, читается \`fallback\`.
174
+ `,
175
+ },
176
+ "find": {
177
+ en: `A menu by its name; \`null\` when there is none - \`register()\` reads one from the file.`,
178
+ ru: `Меню по имени; \`null\`, если такого нет — меню из файла читает \`register()\`.`,
179
+ },
180
+ "indexOf": {
181
+ en: `A menu's number among all of them - the one Pawn plugins know it by; \`-1\` for none.`,
182
+ ru: `Номер меню среди всех — тот, под которым его знают Pawn-плагины; \`-1\`, если меню нет.`,
183
+ },
184
+ "menuAt": {
185
+ en: `The menu with that number among all of them - the reverse of \`indexOf()\`; \`null\` when there is none.`,
186
+ ru: `Меню с этим номером среди всех — обратное к \`indexOf()\`; \`null\`, если такого нет.`,
187
+ },
188
+ "register": {
189
+ en: `The menu of that name in the menu file, read now if it is not yet; \`null\` when the file has no such menu, or no items in it.`,
190
+ ru: `Меню с этим именем из файла меню, прочитанное сейчас, если ещё не прочитано; \`null\`, если такого меню в файле нет или в нём нет пунктов.`,
191
+ },
192
+ "create": {
193
+ en: `
194
+ A menu made in code - or the one of that name already there, as it is. A
195
+ name starting with \`LIST_\` makes a list menu.
196
+ `,
197
+ ru: `
198
+ Меню из кода — или уже существующее с этим именем, как есть. Имя на \`LIST_\`
199
+ даёт меню-список.
200
+ `,
201
+ },
202
+ "addCondition": {
203
+ en: `Registers a condition by name, for menu files and Pawn plugins; the first one registered under a name is the one asked - a built-in one (\`IS_ALIVE\`, \`TEAM_CT\`, ...) too.`,
204
+ ru: `Регистрирует условие по имени — для файлов меню и Pawn-плагинов; спрашивается то, что зарегистрировано под именем первым, — и вместо встроенного (\`IS_ALIVE\`, \`TEAM_CT\`, ...) тоже.`,
205
+ },
206
+ "addAction": {
207
+ en: `Registers an action by name, for menu files and Pawn plugins; \`SHOW_<MENU>\` and \`CLOSE_MENU\` are built in.`,
208
+ ru: `Регистрирует действие по имени — для файлов меню и Pawn-плагинов; \`SHOW_<MENU>\` и \`CLOSE_MENU\` встроены.`,
209
+ },
210
+ "addPlaceholder": {
211
+ 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.`,
212
+ ru: `Регистрирует плейсхолдер для файлов меню и Pawn-плагинов: текст, которым заменяется \`%name%\` в заголовках и пунктах. Если имя зарегистрировано дважды, остаётся первое. В коде текст — функция.`,
213
+ },
214
+ "hasText": {
215
+ en: `Whether an item name of a menu file gives an item - e.g. \`"A|B"\` gives two variants; \`""\` and \`"|"\` give none.`,
216
+ ru: `Даёт ли имя пункта из файла меню пункт — например, \`"A|B"\` даёт два варианта; \`""\` и \`"|"\` не дают ни одного.`,
217
+ },
218
+ "addRestriction": {
219
+ en: `Registers a restriction by name, for menu files to name in \`enabled\` and \`when\`: \`message\` is said beside an item it greys out, unless the item or the requirement has its own; \`"*"\` answers for every name nothing else does.`,
220
+ ru: `Регистрирует ограничение по имени, которое файлы меню называют в \`enabled\` и \`when\`: \`message\` пишется рядом с пунктом, который оно гасит, если у пункта или требования нет своего; \`"*"\` отвечает за все имена, за которые не отвечает никто другой.`,
221
+ },
222
+ "addActionCheck": {
223
+ en: `Greys out items with \`action\` in \`menu\` while \`test\` says no; \`""\` for either means every one.`,
224
+ ru: `Гасит пункты с \`action\` в \`menu\`, пока \`test\` отвечает «нет»; \`""\` в любом из них означает «все».`,
225
+ },
226
+ "addConditionFilter": {
227
+ en: `Registers a filter over the condition \`name\`, whoever registered it: it gets the condition's value and returns the one to use.`,
228
+ ru: `Регистрирует фильтр над условием \`name\`, кто бы его ни зарегистрировал: получает значение условия и возвращает то, что будет использовано.`,
229
+ },
230
+ "setListSource": {
231
+ en: `Sets the source of the rows of the list menu of that name, instead of the players; a second source replaces the first.`,
232
+ ru: `Задаёт источник строк меню-списка с этим именем вместо игроков; второй источник заменяет первый.`,
233
+ },
234
+ "addEventListener": {
235
+ en: `Calls \`listener\` on every menu event of \`type\`, one of \`"open"\`, \`"close"\` or \`"show"\` (before a menu opens).`,
236
+ ru: `Вызывает \`listener\` на каждое событие меню типа \`type\` — одно из \`"open"\`, \`"close"\` или \`"show"\` (до открытия меню).`,
237
+ },
238
+ "listRow": {
239
+ en: `A row for a list source: its target, text, and optionally an action, a restriction and its message.`,
240
+ ru: `Строка для источника списка: цель, текст и, если нужно, действие, ограничение и его сообщение.`,
241
+ },
242
+ "textRow": {
243
+ en: `A line of text among a list source's rows; \`centered\` pads it to the middle of the menu.`,
244
+ ru: `Строка текста среди строк источника списка; \`centered\` выравнивает её по середине меню.`,
245
+ },
246
+ "show": {
247
+ en: `
248
+ Shows the menu of that name - one made in code, or one of the file;
249
+ \`false\` when it does not open: no such menu, a \`"show"\` listener stopped it,
250
+ it is not active, or the player's menu holds on.
251
+ `,
252
+ ru: `
253
+ Показывает меню с этим именем — из кода или из файла; \`false\`, если оно
254
+ не открылось: такого меню нет, его отменил обработчик \`"show"\`, оно не
255
+ активно или меню игрока не уступает место.
256
+ `,
257
+ },
258
+ "close": {
259
+ en: `Closes the player's menu; \`timeout\` tells the \`"close"\` listeners the time ran out.`,
260
+ ru: `Закрывает меню игрока; \`timeout\` сообщает обработчикам \`"close"\`, что вышло время.`,
261
+ },
262
+ "refresh": {
263
+ en: `Draws the menus again for whoever looks at them; \`names\` are space-separated. The number of players they were drawn for.`,
264
+ ru: `Перерисовывает меню у всех, кто их смотрит; \`names\` — через пробел. Число игроков, у которых меню перерисованы.`,
265
+ },
266
+ "conditionChanged": {
267
+ en: `Tells the menus a condition's value changed: the menus drawn with it are drawn again.`,
268
+ ru: `Сообщает меню, что значение условия изменилось: меню, нарисованные с ним, перерисовываются.`,
269
+ },
270
+ "activeMenu": {
271
+ en: `The menu the player looks at, or \`null\`.`,
272
+ ru: `Меню, которое смотрит игрок, или \`null\`.`,
273
+ },
274
+ "shownText": {
275
+ en: `The text of the player's menu, as it was last drawn; \`""\` when none is open.`,
276
+ ru: `Текст меню игрока, как оно было нарисовано в последний раз; \`""\`, если меню не открыто.`,
277
+ },
278
+ "lock": {
279
+ en: `Locks the player's menu: no item can be chosen and no other menu replaces it until it is unlocked or closed.`,
280
+ ru: `Блокирует меню игрока: пункты нельзя выбрать и другое меню его не заменяет, пока его не разблокируют или не закроют.`,
281
+ },
282
+ "isLocked": {
283
+ en: `Whether the player's menu is locked - see \`lock()\`.`,
284
+ ru: `Заблокировано ли меню игрока — см. \`lock()\`.`,
285
+ },
286
+ "setPage": {
287
+ en: `Sets the page the player's menu is drawn at next, from \`0\`.`,
288
+ ru: `Задаёт страницу, на которой меню игрока нарисуется в следующий раз, от \`0\`.`,
289
+ },
290
+ "hasAction": {
291
+ en: `Whether an action of that name is registered.`,
292
+ ru: `Зарегистрировано ли действие с этим именем.`,
293
+ },
294
+ "runActions": {
295
+ en: `Runs an action line: space-separated action names, \`CLOSE_MENU\` and \`SHOW_<MENU>\` among them.`,
296
+ ru: `Выполняет строку действий: имена действий через пробел, в том числе \`CLOSE_MENU\` и \`SHOW_<MENU>\`.`,
297
+ },
298
+ };
@@ -0,0 +1,266 @@
1
+ // The tooltips of src/types.ts, in both languages: scripts/apply-docs.ts writes the
2
+ // one AMXTS_DOCS_LANG picks into the JSDoc above each element.
3
+ export default {
4
+ "MenuKind": {
5
+ en: `A menu's kind, one of \`"items"\` (a list of items) or \`"list"\` (a row per player, or per row of a list source).`,
6
+ ru: `Вид меню, одно из \`"items"\` (список пунктов) или \`"list"\` (строка на игрока или на строку источника).`,
7
+ },
8
+ "MenuText": {
9
+ en: `
10
+ Text of a menu - a title, an item, a message: the text itself, or a
11
+ function that gives it for the player who looks; \`target\` is the row's
12
+ in a list menu, else the menu's. A lang key is translated either way.
13
+ Colour tags are chat's letters: \`!y\` yellow, \`!r\` red, \`!d\` grey, \`!w\`
14
+ white, \`!R\` to the right edge; chat's own \`!g\`, \`!b\` and \`!t\` are dropped.
15
+
16
+ menus.create("SHOP", { title: (player) => \`Shop for \${player.name}\` });
17
+ `,
18
+ ru: `
19
+ Текст меню — заголовок, пункт, сообщение: сам текст или функция, которая
20
+ даёт его для игрока, который смотрит; \`target\` — цель строки в
21
+ меню-списке, иначе меню. Ключ словаря переводится в обоих случаях.
22
+ Цветовые метки — буквы чата: \`!y\` жёлтый, \`!r\` красный, \`!d\` серый, \`!w\`
23
+ белый, \`!R\` — к правому краю; метки только для чата \`!g\`, \`!b\` и \`!t\` убираются.
24
+
25
+ menus.create("SHOP", { title: (player) => \`Shop for \${player.name}\` });
26
+ `,
27
+ },
28
+ "ListRow": {
29
+ en: `A row of a list menu, as a list source gives it - made with \`listRow()\` or \`textRow()\`.`,
30
+ ru: `Строка меню-списка, как её отдаёт источник, — из \`listRow()\` или \`textRow()\`.`,
31
+ },
32
+ "ListRow.kind": {
33
+ en: `The row's kind, one of \`"item"\` (a row to choose) or \`"text"\` (a line of text, not a choice).`,
34
+ ru: `Вид строки, одно из \`"item"\` (строка для выбора) или \`"text"\` (строка текста, не выбор).`,
35
+ },
36
+ "ListRow.target": {
37
+ en: `The row's target, handed to the action: e.g. a player's \`id\`, an entity or an index of the source's own; \`0\` for a line of text.`,
38
+ ru: `Цель строки, которую получает действие: например, номер игрока, сущность или индекс самого источника; \`0\` у строки текста.`,
39
+ },
40
+ "ListRow.text": {
41
+ en: `The row's text, put for \`%name%\` in the menu's row template.`,
42
+ ru: `Текст строки, который подставляется вместо \`%name%\` в шаблон строки меню.`,
43
+ },
44
+ "ListRow.action": {
45
+ en: `Action names of the row's own, run instead of the template's; \`""\` for the template's.`,
46
+ ru: `Собственные имена действий строки, вместо действий шаблона; \`""\` — действия шаблона.`,
47
+ },
48
+ "ListRow.restriction": {
49
+ en: `Restriction names, space-separated: the row is greyed out unless each passes.`,
50
+ ru: `Имена ограничений через пробел: строка погашена, пока не пройдено каждое.`,
51
+ },
52
+ "ListRow.restrictionMessage": {
53
+ en: `The text beside the row while it is greyed out; \`""\` for the restriction's own message.`,
54
+ ru: `Текст рядом со строкой, пока она погашена; \`""\` — сообщение самого ограничения.`,
55
+ },
56
+ "MenuOptions": {
57
+ en: `
58
+ The options of a menu made with \`create()\`. Every field may be left out:
59
+
60
+ menus.create("SHOP", { title: "Shop", time: 30, activeWhen: player => player.isAlive });
61
+ `,
62
+ ru: `
63
+ Настройки меню, сделанного через \`create()\`. Любое поле можно не задавать:
64
+
65
+ menus.create("SHOP", { title: "Shop", time: 30, activeWhen: player => player.isAlive });
66
+ `,
67
+ },
68
+ "MenuOptions.title": {
69
+ en: `The menu's title: the text - a lang key too - or a function that gives it for the player; left out, the menu's name.`,
70
+ ru: `Заголовок меню: сам текст — или ключ словаря — либо функция, которая даёт его для игрока; если не задан — имя меню.`,
71
+ },
72
+ "MenuOptions.time": {
73
+ en: `Seconds on the countdown when the menu opens, e.g. \`10\`; left out, none.`,
74
+ ru: `Секунды отсчёта при открытии меню, например \`10\`; если не задано — без отсчёта.`,
75
+ },
76
+ "MenuOptions.hideBack": {
77
+ en: `Hiding of the \`"Back"\` button: \`true\` leaves it out.`,
78
+ ru: `Скрытие кнопки \`"Назад"\`: \`true\` убирает её.`,
79
+ },
80
+ "MenuOptions.hideExit": {
81
+ en: `Hiding of the \`"Exit"\` button: \`true\` leaves it out.`,
82
+ ru: `Скрытие кнопки \`"Выход"\`: \`true\` убирает её.`,
83
+ },
84
+ "MenuOptions.locked": {
85
+ en: `A lock on the menu: while \`true\`, items cannot be chosen and no other menu replaces this one.`,
86
+ ru: `Блокировка меню: пока \`true\`, пункты нельзя выбрать и другое меню не заменяет это.`,
87
+ },
88
+ "MenuOptions.activeWhen": {
89
+ en: `A test the menu opens under: while it says no to the player, the menu does not open for him.`,
90
+ ru: `Проверка, при которой меню открывается: пока она отвечает игроку «нет», меню ему не открывается.`,
91
+ },
92
+ "MenuShowOptions": {
93
+ en: `
94
+ The options of showing a menu. Every field may be left out:
95
+
96
+ shop.show(player, { time: 10 });
97
+ `,
98
+ ru: `
99
+ Настройки показа меню. Любое поле можно не задавать:
100
+
101
+ shop.show(player, { time: 10 });
102
+ `,
103
+ },
104
+ "MenuShowOptions.time": {
105
+ en: `Seconds on the countdown; left out, the countdown running goes on, or the menu's own starts.`,
106
+ ru: `Секунды отсчёта; если не заданы, идущий отсчёт продолжается или начинается собственный отсчёт меню.`,
107
+ },
108
+ "MenuShowOptions.target": {
109
+ en: `The player the menu is about, by \`id\`: \`%target%\`, and the target an action gets; \`0\` when left out.`,
110
+ ru: `Игрок, о котором меню, — его номер: \`%target%\` и цель, которую получает действие; если не задан — \`0\`.`,
111
+ },
112
+ "MenuShowOptions.resetHistory": {
113
+ en: `A new way back: \`true\` forgets the menus this one was opened from.`,
114
+ ru: `Новый путь назад: \`true\` забывает меню, из которых открыто это.`,
115
+ },
116
+ "MenuShowOptions.force": {
117
+ en: `Opening over a menu that holds on - a countdown, a lock: \`true\` opens anyway.`,
118
+ ru: `Открытие поверх меню, которое держится, — с отсчётом или заблокированного: \`true\` открывает всё равно.`,
119
+ },
120
+ "MenuShowOptions.skipHistory": {
121
+ en: `Leaving the menu out of the way back: \`true\` does not remember it.`,
122
+ ru: `Пропуск меню на пути назад: \`true\` его не запоминает.`,
123
+ },
124
+ "MenuItemOptions": {
125
+ en: `
126
+ The options of an item, besides its text. Every field may be left out:
127
+
128
+ shop.addItem("Heal", {
129
+ visible: player => player.health < 100,
130
+ onSelect: (player) => { player.health = 100; },
131
+ });
132
+ `,
133
+ ru: `
134
+ Настройки пункта, кроме текста. Любое поле можно не задавать:
135
+
136
+ shop.addItem("Heal", {
137
+ visible: player => player.health < 100,
138
+ onSelect: (player) => { player.health = 100; },
139
+ });
140
+ `,
141
+ },
142
+ "MenuItemOptions.onSelect": {
143
+ en: `The function run when the item is chosen: the player who chose it, and the target - the row's in a list menu, else the menu's.`,
144
+ ru: `Функция, которая выполняется при выборе пункта: игрок, который выбрал, и цель — строки в меню-списке, иначе меню.`,
145
+ },
146
+ "MenuItemOptions.visible": {
147
+ en: `A test the item is shown under: while it says no, the item is left out and takes no slot.`,
148
+ ru: `Проверка, при которой пункт показан: пока она отвечает «нет», пункта нет и слот он не занимает.`,
149
+ },
150
+ "MenuItemOptions.enabled": {
151
+ en: `
152
+ A test the item can be chosen under - while it says no, the item is
153
+ greyed out with \`message\` beside it; or a list of requirements, each with
154
+ a message of its own - the first that fails gives its message.
155
+
156
+ enabled: [
157
+ { when: (player) => player.frags >= 5, message: "5 frags needed" },
158
+ { when: (player) => player.armor < 100, message: (player) => \`(\${player.armor} already)\` },
159
+ ],
160
+ `,
161
+ ru: `
162
+ Проверка, при которой пункт можно выбрать, — пока она отвечает «нет»,
163
+ пункт погашен, а рядом \`message\`; или список требований, у каждого своё
164
+ сообщение, — первое невыполненное даёт своё.
165
+
166
+ enabled: [
167
+ { when: (player) => player.frags >= 5, message: "5 frags needed" },
168
+ { when: (player) => player.armor < 100, message: (player) => \`(\${player.armor} already)\` },
169
+ ],
170
+ `,
171
+ },
172
+ "MenuItemOptions.message": {
173
+ en: `The text beside the item while \`enabled\` greys it out, for a requirement without a message of its own: the text, e.g. \`"(full)"\`, or a function that gives it for the player.`,
174
+ ru: `Текст рядом с пунктом, пока его гасит \`enabled\`, — для требования без своего сообщения: сам текст, например \`"(full)"\`, или функция, которая даёт его для игрока.`,
175
+ },
176
+ "MenuItemOptions.placeholder": {
177
+ en: `The text after the item's name, for items of menu files and Pawn plugins, placeholders and all, e.g. \`"%hp%"\`; in code the item's text is a function instead.`,
178
+ ru: `Текст после имени пункта — для пунктов файлов меню и Pawn-плагинов, с плейсхолдерами, например \`"%hp%"\`; в коде текст пункта — функция.`,
179
+ },
180
+ "MenuItemOptions.action": {
181
+ en: `Action names from \`addAction()\` run when the item is chosen, or a built-in one: \`"SHOW_<MENU>"\`, \`"CLOSE_MENU"\`.`,
182
+ ru: `Имена действий из \`addAction()\`, которые выполняются при выборе пункта, или встроенное: \`"SHOW_<MENU>"\`, \`"CLOSE_MENU"\`.`,
183
+ },
184
+ "MenuItemOptions.at": {
185
+ en: `The item's place among the items, from \`0\`; left out, the end.`,
186
+ ru: `Место пункта среди пунктов, от \`0\`; если не задано — в конце.`,
187
+ },
188
+ "MenuItemOptions.spaceBefore": {
189
+ en: `Blank lines before the item.`,
190
+ ru: `Пустые строки перед пунктом.`,
191
+ },
192
+ "MenuItemOptions.spaceAfter": {
193
+ en: `Blank lines after the item.`,
194
+ ru: `Пустые строки после пункта.`,
195
+ },
196
+ "Requirement": {
197
+ en: `
198
+ A requirement of an item, in the list \`enabled\` takes: while \`when\` says
199
+ no, the item is greyed out with \`message\` beside it.
200
+
201
+ { when: (player) => player.frags >= 5, message: "5 frags needed" }
202
+ `,
203
+ ru: `
204
+ Требование пункта в списке, который принимает \`enabled\`: пока \`when\`
205
+ отвечает «нет», пункт погашен, а рядом \`message\`.
206
+
207
+ { when: (player) => player.frags >= 5, message: "5 frags needed" }
208
+ `,
209
+ },
210
+ "Requirement.when": {
211
+ en: `A test the requirement holds under: the player who looks, and the target - the row's in a list menu, else the menu's.`,
212
+ ru: `Проверка, при которой требование выполнено: игрок, который смотрит, и цель — строки в меню-списке, иначе меню.`,
213
+ },
214
+ "Requirement.message": {
215
+ en: `The text beside the item while \`when\` says no: the text, a lang key, or a function that gives it for the player; left out, the item's \`message\`.`,
216
+ ru: `Текст рядом с пунктом, пока \`when\` отвечает «нет»: сам текст, ключ словаря или функция, которая даёт его для игрока; если не задан — \`message\` пункта.`,
217
+ },
218
+ "ConditionTest": {
219
+ en: `A condition's test, as \`addCondition()\` registers it. In a list menu \`player\` is the row's player and \`viewer\` whoever looks.`,
220
+ ru: `Проверка условия, как её регистрирует \`addCondition()\`. В меню-списке \`player\` — игрок строки, \`viewer\` — тот, кто смотрит.`,
221
+ },
222
+ "ActionHandler": {
223
+ en: `An action, as \`addAction()\` registers it: \`target\` is the row's in a list menu, else the menu's.`,
224
+ ru: `Действие, как его регистрирует \`addAction()\`: \`target\` — цель строки в меню-списке, иначе меню.`,
225
+ },
226
+ "PlaceholderValue": {
227
+ en: `A placeholder's value: the text \`%name%\` stands for.`,
228
+ ru: `Значение плейсхолдера: текст, которым заменяется \`%name%\`.`,
229
+ },
230
+ "RestrictionTest": {
231
+ en: `A restriction's test, as \`addRestriction()\` registers it; \`name\` is the whole token, \`"NAME:param"\` included.`,
232
+ ru: `Проверка ограничения, как её регистрирует \`addRestriction()\`; \`name\` — токен целиком, вместе с \`"NAME:param"\`.`,
233
+ },
234
+ "ActionTest": {
235
+ en: `A test of an item's action, as \`addActionCheck()\` registers it: \`false\` greys the item out.`,
236
+ ru: `Проверка действия пункта, как её регистрирует \`addActionCheck()\`: \`false\` гасит пункт.`,
237
+ },
238
+ "ConditionFilter": {
239
+ en: `A filter over a condition someone else registered: gets its value and returns the one to use.`,
240
+ ru: `Фильтр над условием, которое зарегистрировал кто-то другой: получает его значение и возвращает то, что будет использовано.`,
241
+ },
242
+ "RowTest": {
243
+ en: `A test of a row of a list menu, as \`addFilter()\` takes it: \`player\` is the row's player, \`viewer\` whoever looks.`,
244
+ ru: `Проверка строки меню-списка, как её принимает \`addFilter()\`: \`player\` — игрок строки, \`viewer\` — тот, кто смотрит.`,
245
+ },
246
+ "ListSource": {
247
+ en: `A list source: the rows of a list menu for the player who looks; \`null\` lists the players instead.`,
248
+ ru: `Источник списка: строки меню-списка для игрока, который смотрит; \`null\` — вместо них список игроков.`,
249
+ },
250
+ "MenuEventType": {
251
+ en: `A menu event's type, one of \`"open"\` and \`"close"\` as they happen, or \`"show"\` before a menu opens, to stop it.`,
252
+ ru: `Тип события меню, одно из \`"open"\` и \`"close"\` — когда это происходит, или \`"show"\` — до открытия меню, чтобы его остановить.`,
253
+ },
254
+ "MenuCoreOptions": {
255
+ en: `Menu Core's options: \`menus\` in \`amxts.config.ts\`.`,
256
+ ru: `Настройки Menu Core: \`menus\` в \`amxts.config.ts\`.`,
257
+ },
258
+ "MenuCoreOptions.file": {
259
+ en: `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.`,
260
+ ru: `Файл меню от \`configs/\`: например, \`"menu"\` — \`configs/menu.ini\`, \`menu.yaml\`, \`menu.yml\`, \`menu.json\` или \`menu.jsonc\` — первый, который есть; \`"myserver/menu.yaml"\` — этот файл.`,
261
+ },
262
+ "MenuCoreOptions.fallback": {
263
+ en: `The file read instead when \`file\` is empty or not there, e.g. \`"menu"\` for \`configs/menu.ini\` or \`menu.yaml\`; \`""\` is none.`,
264
+ ru: `Файл, который читается вместо \`file\`, если тот пуст или его нет, например \`"menu"\` — \`configs/menu.ini\` или \`menu.yaml\`; \`""\` — никакой.`,
265
+ },
266
+ };