xray16 1.5.4 → 1.6.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/README.md +6 -0
- package/package.json +1 -1
- package/plugins/optimize_return_ternary.d.ts +6 -0
- package/plugins/optimize_return_ternary.js +65 -0
- package/types/internal.d.ts +6 -0
- package/types/xr_ai/xr_action.d.ts +2 -1
- package/types/xr_ai/xr_alife.d.ts +6 -4
- package/types/xr_ai/xr_goap.d.ts +8 -6
- package/types/xr_ai/xr_memory.d.ts +4 -2
- package/types/xr_lib/xr_debug.d.ts +4 -2
- package/types/xr_lib/xr_fs.d.ts +9 -7
- package/types/xr_lib/xr_game.d.ts +4 -4
- package/types/xr_lib/xr_hit.d.ts +3 -1
- package/types/xr_lib/xr_ini.d.ts +4 -2
- package/types/xr_lib/xr_level.d.ts +5 -3
- package/types/xr_lib/xr_map.d.ts +3 -1
- package/types/xr_lib/xr_multiplayer.d.ts +5 -3
- package/types/xr_lib/xr_properties.d.ts +3 -1
- package/types/xr_lib/xr_save.d.ts +3 -1
- package/types/xr_lib/xr_sound.d.ts +9 -7
- package/types/xr_lib/xr_stats.ts +3 -1
- package/types/xr_lib/xr_task.d.ts +3 -1
- package/types/xr_lib/xr_type.d.ts +0 -5
- package/types/xr_object/client/xr_level.d.ts +3 -1
- package/types/xr_object/script/xr_script_interface.d.ts +518 -195
- package/types/xr_object/script/xr_script_object.d.ts +46 -63
- package/types/xr_object/server/xr_server_object.d.ts +5 -3
- package/types/xr_ui/xr_ui_core.d.ts +33 -31
- package/types/xr_ui/xr_ui_interface.d.ts +18 -16
- package/types/xr_ui/xr_ui_menu.d.ts +20 -4
- package/types/xrf_plugin.d.ts +3 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Nillable } from "../../internal";
|
|
2
|
+
|
|
1
3
|
declare module "xray16" {
|
|
2
4
|
/**
|
|
3
5
|
* Cover point returned by cover search helpers.
|
|
@@ -94,146 +96,182 @@ declare module "xray16" {
|
|
|
94
96
|
* Default x-ray 16 callbacks.
|
|
95
97
|
*/
|
|
96
98
|
public static readonly trade_start: 0;
|
|
99
|
+
|
|
97
100
|
/**
|
|
98
101
|
* Engine enum value for `callback.trade_stop`.
|
|
99
102
|
*/
|
|
100
103
|
public static readonly trade_stop: 1;
|
|
104
|
+
|
|
101
105
|
/**
|
|
102
106
|
* Engine enum value for `callback.trade_sell_buy_item`.
|
|
103
107
|
*/
|
|
104
108
|
public static readonly trade_sell_buy_item: 2;
|
|
109
|
+
|
|
105
110
|
/**
|
|
106
111
|
* Engine enum value for `callback.trade_perform_operation`.
|
|
107
112
|
*/
|
|
108
113
|
public static readonly trade_perform_operation: 3;
|
|
114
|
+
|
|
109
115
|
/**
|
|
110
116
|
* Engine enum value for `callback.zone_enter`.
|
|
111
117
|
*/
|
|
112
118
|
public static readonly zone_enter: 4;
|
|
119
|
+
|
|
113
120
|
/**
|
|
114
121
|
* Engine enum value for `callback.zone_exit`.
|
|
115
122
|
*/
|
|
116
123
|
public static readonly zone_exit: 5;
|
|
124
|
+
|
|
117
125
|
/**
|
|
118
126
|
* Engine enum value for `callback.level_border_exit`.
|
|
119
127
|
*/
|
|
120
128
|
public static readonly level_border_exit: 6;
|
|
129
|
+
|
|
121
130
|
/**
|
|
122
131
|
* Engine enum value for `callback.level_border_enter`.
|
|
123
132
|
*/
|
|
124
133
|
public static readonly level_border_enter: 7;
|
|
134
|
+
|
|
125
135
|
/**
|
|
126
136
|
* Engine enum value for `callback.death`.
|
|
127
137
|
*/
|
|
128
138
|
public static readonly death: 8;
|
|
139
|
+
|
|
129
140
|
/**
|
|
130
141
|
* Engine enum value for `callback.patrol_path_in_point`.
|
|
131
142
|
*/
|
|
132
143
|
public static readonly patrol_path_in_point: 9;
|
|
144
|
+
|
|
133
145
|
/**
|
|
134
146
|
* Engine enum value for `callback.inventory_pda`.
|
|
135
147
|
*/
|
|
136
148
|
public static readonly inventory_pda: 10;
|
|
149
|
+
|
|
137
150
|
/**
|
|
138
151
|
* Engine enum value for `callback.inventory_info`.
|
|
139
152
|
*/
|
|
140
153
|
public static readonly inventory_info: 11;
|
|
154
|
+
|
|
141
155
|
/**
|
|
142
156
|
* Engine enum value for `callback.article_info`.
|
|
143
157
|
*/
|
|
144
158
|
public static readonly article_info: 12;
|
|
159
|
+
|
|
145
160
|
/**
|
|
146
161
|
* Engine enum value for `callback.task_state`.
|
|
147
162
|
*/
|
|
148
163
|
public static readonly task_state: 13;
|
|
164
|
+
|
|
149
165
|
/**
|
|
150
166
|
* Engine enum value for `callback.map_location_added`.
|
|
151
167
|
*/
|
|
152
168
|
public static readonly map_location_added: 14;
|
|
169
|
+
|
|
153
170
|
/**
|
|
154
171
|
* Engine enum value for `callback.use_object`.
|
|
155
172
|
*/
|
|
156
173
|
public static readonly use_object: 15;
|
|
174
|
+
|
|
157
175
|
/**
|
|
158
176
|
* Engine enum value for `callback.hit`.
|
|
159
177
|
*/
|
|
160
178
|
public static readonly hit: 16;
|
|
179
|
+
|
|
161
180
|
/**
|
|
162
181
|
* Engine enum value for `callback.sound`.
|
|
163
182
|
*/
|
|
164
183
|
public static readonly sound: 17;
|
|
184
|
+
|
|
165
185
|
/**
|
|
166
186
|
* Engine enum value for `callback.action_movement`.
|
|
167
187
|
*/
|
|
168
188
|
public static readonly action_movement: 18;
|
|
189
|
+
|
|
169
190
|
/**
|
|
170
191
|
* Engine enum value for `callback.action_watch`.
|
|
171
192
|
*/
|
|
172
193
|
public static readonly action_watch: 19;
|
|
194
|
+
|
|
173
195
|
/**
|
|
174
196
|
* Engine enum value for `callback.action_removed`.
|
|
175
197
|
*/
|
|
176
198
|
public static readonly action_removed: 20;
|
|
199
|
+
|
|
177
200
|
/**
|
|
178
201
|
* Engine enum value for `callback.action_animation`.
|
|
179
202
|
*/
|
|
180
203
|
public static readonly action_animation: 21;
|
|
204
|
+
|
|
181
205
|
/**
|
|
182
206
|
* Engine enum value for `callback.action_sound`.
|
|
183
207
|
*/
|
|
184
208
|
public static readonly action_sound: 22;
|
|
209
|
+
|
|
185
210
|
/**
|
|
186
211
|
* Engine enum value for `callback.action_particle`.
|
|
187
212
|
*/
|
|
188
213
|
public static readonly action_particle: 23;
|
|
214
|
+
|
|
189
215
|
/**
|
|
190
216
|
* Engine enum value for `callback.action_object`.
|
|
191
217
|
*/
|
|
192
218
|
public static readonly action_object: 24;
|
|
219
|
+
|
|
193
220
|
/**
|
|
194
221
|
* Engine enum value for `callback.actor_sleep`.
|
|
195
222
|
*/
|
|
196
223
|
public static readonly actor_sleep: 25;
|
|
224
|
+
|
|
197
225
|
/**
|
|
198
226
|
* Engine enum value for `callback.helicopter_on_point`.
|
|
199
227
|
*/
|
|
200
228
|
public static readonly helicopter_on_point: 26;
|
|
229
|
+
|
|
201
230
|
/**
|
|
202
231
|
* Engine enum value for `callback.helicopter_on_hit`.
|
|
203
232
|
*/
|
|
204
233
|
public static readonly helicopter_on_hit: 27;
|
|
234
|
+
|
|
205
235
|
/**
|
|
206
236
|
* Engine enum value for `callback.on_item_take`.
|
|
207
237
|
*/
|
|
208
238
|
public static readonly on_item_take: 28;
|
|
239
|
+
|
|
209
240
|
/**
|
|
210
241
|
* Engine enum value for `callback.on_item_drop`.
|
|
211
242
|
*/
|
|
212
243
|
public static readonly on_item_drop: 29;
|
|
244
|
+
|
|
213
245
|
/**
|
|
214
246
|
* Engine enum value for `callback.script_animation`.
|
|
215
247
|
*/
|
|
216
248
|
public static readonly script_animation: 30;
|
|
249
|
+
|
|
217
250
|
/**
|
|
218
251
|
* Engine enum value for `callback.trader_global_anim_request`.
|
|
219
252
|
*/
|
|
220
253
|
public static readonly trader_global_anim_request: 31;
|
|
254
|
+
|
|
221
255
|
/**
|
|
222
256
|
* Engine enum value for `callback.trader_head_anim_request`.
|
|
223
257
|
*/
|
|
224
258
|
public static readonly trader_head_anim_request: 32;
|
|
259
|
+
|
|
225
260
|
/**
|
|
226
261
|
* Engine enum value for `callback.trader_sound_end`.
|
|
227
262
|
*/
|
|
228
263
|
public static readonly trader_sound_end: 33;
|
|
264
|
+
|
|
229
265
|
/**
|
|
230
266
|
* Engine enum value for `callback.take_item_from_box`.
|
|
231
267
|
*/
|
|
232
268
|
public static readonly take_item_from_box: 34;
|
|
269
|
+
|
|
233
270
|
/**
|
|
234
271
|
* Engine enum value for `callback.weapon_no_ammo`.
|
|
235
272
|
*/
|
|
236
273
|
public static readonly weapon_no_ammo: 35;
|
|
274
|
+
|
|
237
275
|
/**
|
|
238
276
|
* Engine enum value for `callback.hud_animation_end`.
|
|
239
277
|
*/
|
|
@@ -242,83 +280,102 @@ declare module "xray16" {
|
|
|
242
280
|
/**
|
|
243
281
|
* Engine enum value for `callback.key_press`.
|
|
244
282
|
*/
|
|
245
|
-
public static readonly key_press:
|
|
283
|
+
public static readonly key_press: 123;
|
|
284
|
+
|
|
246
285
|
/**
|
|
247
286
|
* Engine enum value for `callback.key_release`.
|
|
248
287
|
*/
|
|
249
|
-
public static readonly key_release:
|
|
288
|
+
public static readonly key_release: 124;
|
|
289
|
+
|
|
250
290
|
/**
|
|
251
291
|
* Engine enum value for `callback.key_hold`.
|
|
252
292
|
*/
|
|
253
|
-
public static readonly key_hold:
|
|
293
|
+
public static readonly key_hold: 125;
|
|
294
|
+
|
|
254
295
|
/**
|
|
255
296
|
* Engine enum value for `callback.mouse_move`.
|
|
256
297
|
*/
|
|
257
|
-
public static readonly mouse_move:
|
|
298
|
+
public static readonly mouse_move: 127;
|
|
299
|
+
|
|
258
300
|
/**
|
|
259
301
|
* Engine enum value for `callback.mouse_wheel`.
|
|
260
302
|
*/
|
|
261
|
-
public static readonly mouse_wheel:
|
|
303
|
+
public static readonly mouse_wheel: 126;
|
|
304
|
+
|
|
262
305
|
/**
|
|
263
306
|
* Engine enum value for `callback.controller_press`.
|
|
264
307
|
*/
|
|
265
|
-
public static readonly controller_press:
|
|
308
|
+
public static readonly controller_press: 48;
|
|
309
|
+
|
|
266
310
|
/**
|
|
267
311
|
* Engine enum value for `callback.controller_release`.
|
|
268
312
|
*/
|
|
269
|
-
public static readonly controller_release:
|
|
313
|
+
public static readonly controller_release: 49;
|
|
314
|
+
|
|
270
315
|
/**
|
|
271
316
|
* Engine enum value for `callback.controller_hold`.
|
|
272
317
|
*/
|
|
273
|
-
public static readonly controller_hold:
|
|
274
|
-
|
|
318
|
+
public static readonly controller_hold: 50;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Engine enum value for `callback.controller_attitude_change`.
|
|
322
|
+
*/
|
|
323
|
+
public static readonly controller_attitude_change: 51;
|
|
275
324
|
|
|
276
325
|
/**
|
|
277
326
|
* Engine enum value for `callback.item_to_belt`.
|
|
278
327
|
*/
|
|
279
|
-
public static readonly item_to_belt:
|
|
328
|
+
public static readonly item_to_belt: 37;
|
|
329
|
+
|
|
280
330
|
/**
|
|
281
331
|
* Engine enum value for `callback.item_to_slot`.
|
|
282
332
|
*/
|
|
283
|
-
public static readonly item_to_slot:
|
|
333
|
+
public static readonly item_to_slot: 38;
|
|
334
|
+
|
|
284
335
|
/**
|
|
285
336
|
* Engine enum value for `callback.item_to_ruck`.
|
|
286
337
|
*/
|
|
287
|
-
public static readonly item_to_ruck:
|
|
338
|
+
public static readonly item_to_ruck: 39;
|
|
288
339
|
|
|
289
340
|
/**
|
|
290
341
|
* Engine enum value for `callback.weapon_zoom_in`.
|
|
291
342
|
*/
|
|
292
|
-
public static readonly weapon_zoom_in:
|
|
343
|
+
public static readonly weapon_zoom_in: 40;
|
|
344
|
+
|
|
293
345
|
/**
|
|
294
346
|
* Engine enum value for `callback.weapon_zoom_out`.
|
|
295
347
|
*/
|
|
296
|
-
public static readonly weapon_zoom_out:
|
|
348
|
+
public static readonly weapon_zoom_out: 41;
|
|
349
|
+
|
|
297
350
|
/**
|
|
298
351
|
* Engine enum value for `callback.weapon_jammed`.
|
|
299
352
|
*/
|
|
300
|
-
public static readonly weapon_jammed:
|
|
353
|
+
public static readonly weapon_jammed: 42;
|
|
354
|
+
|
|
301
355
|
/**
|
|
302
356
|
* Engine enum value for `callback.weapon_magazine_empty`.
|
|
303
357
|
*/
|
|
304
|
-
public static readonly weapon_magazine_empty:
|
|
358
|
+
public static readonly weapon_magazine_empty: 43;
|
|
305
359
|
|
|
306
360
|
/**
|
|
307
361
|
* Engine enum value for `callback.actor_before_death`.
|
|
308
362
|
*/
|
|
309
|
-
public static readonly actor_before_death:
|
|
363
|
+
public static readonly actor_before_death: 44;
|
|
364
|
+
|
|
310
365
|
/**
|
|
311
366
|
* Engine enum value for `callback.on_attach_vehicle`.
|
|
312
367
|
*/
|
|
313
|
-
public static readonly on_attach_vehicle:
|
|
368
|
+
public static readonly on_attach_vehicle: 45;
|
|
369
|
+
|
|
314
370
|
/**
|
|
315
371
|
* Engine enum value for `callback.on_detach_vehicle`.
|
|
316
372
|
*/
|
|
317
|
-
public static readonly on_detach_vehicle:
|
|
373
|
+
public static readonly on_detach_vehicle: 46;
|
|
374
|
+
|
|
318
375
|
/**
|
|
319
376
|
* Engine enum value for `callback.on_use_vehicle`.
|
|
320
377
|
*/
|
|
321
|
-
public static readonly on_use_vehicle:
|
|
378
|
+
public static readonly on_use_vehicle: 47;
|
|
322
379
|
}
|
|
323
380
|
|
|
324
381
|
/**
|
|
@@ -332,447 +389,710 @@ declare module "xray16" {
|
|
|
332
389
|
export type TXR_callback = EnumeratedStaticsValues<TXR_callbacks>;
|
|
333
390
|
|
|
334
391
|
/**
|
|
335
|
-
*
|
|
336
|
-
* For reference: src/xrGame/script_game_object_script.cpp.
|
|
392
|
+
* `game_object.set_callback` overloads for Lua-visible game object callbacks.
|
|
337
393
|
*
|
|
338
394
|
* @group xr_script_interface
|
|
395
|
+
*
|
|
396
|
+
* @remarks
|
|
397
|
+
* When `object` is supplied, `CScriptCallbackEx` passes it as the first Lua callback argument.
|
|
339
398
|
*/
|
|
340
399
|
class game_object_callbacks_implementation_base {
|
|
341
400
|
/**
|
|
342
|
-
*
|
|
401
|
+
* Clear one callback registration.
|
|
402
|
+
*
|
|
403
|
+
* @remarks
|
|
404
|
+
* Uses the no-functor `CScriptGameObject::SetCallback(type)` overload, which clears the callback slot.
|
|
343
405
|
*
|
|
344
|
-
* @param type -
|
|
345
|
-
* @param cb -
|
|
406
|
+
* @param type - Callback type to clear.
|
|
407
|
+
* @param cb - Nullish value used to select the clear overload.
|
|
346
408
|
*/
|
|
347
|
-
public set_callback(type: TXR_callback, cb:
|
|
409
|
+
public set_callback(type: TXR_callback, cb: Nillable<never>): void;
|
|
348
410
|
|
|
349
411
|
/**
|
|
350
|
-
*
|
|
412
|
+
* Fired when a trader starts a trade session.
|
|
413
|
+
*
|
|
414
|
+
* @source `src/xrGame/ai/trader/ai_trader.cpp`, `CAI_Trader::OnStartTrade`.
|
|
351
415
|
*/
|
|
352
416
|
public set_callback<T extends AnyObject>(
|
|
353
417
|
type: TXR_callbacks["trade_start"],
|
|
354
|
-
cb?: (
|
|
355
|
-
object?:
|
|
418
|
+
cb?: Nillable<(this: void) => void>,
|
|
419
|
+
object?: Nillable<T>
|
|
356
420
|
): void;
|
|
357
421
|
|
|
358
422
|
/**
|
|
359
|
-
*
|
|
423
|
+
* Fired when a trader stops a trade session.
|
|
424
|
+
*
|
|
425
|
+
* @source `src/xrGame/ai/trader/ai_trader.cpp`, `CAI_Trader::OnStopTrade`.
|
|
360
426
|
*/
|
|
361
427
|
public set_callback<T extends AnyObject>(
|
|
362
428
|
type: TXR_callbacks["trade_stop"],
|
|
363
|
-
cb?: (
|
|
364
|
-
object?:
|
|
429
|
+
cb?: Nillable<(this: void) => void>,
|
|
430
|
+
object?: Nillable<T>
|
|
365
431
|
): void;
|
|
366
432
|
|
|
367
433
|
/**
|
|
368
|
-
*
|
|
434
|
+
* Fired when an actor-involved trade transfers an item and money.
|
|
435
|
+
*
|
|
436
|
+
* @source `src/xrGame/trade2.cpp`, `CTrade::TransferItem`.
|
|
369
437
|
*/
|
|
370
438
|
public set_callback<T extends AnyObject>(
|
|
371
439
|
type: TXR_callbacks["trade_sell_buy_item"],
|
|
372
|
-
cb?:
|
|
373
|
-
|
|
440
|
+
cb?: Nillable<
|
|
441
|
+
(this: void, item: game_object, money_direction: boolean, money: number, partner: game_object) => void
|
|
442
|
+
>,
|
|
443
|
+
object?: Nillable<T>
|
|
374
444
|
): void;
|
|
375
445
|
|
|
376
446
|
/**
|
|
377
|
-
*
|
|
447
|
+
* Fired when a trader performs the money part of a trade operation.
|
|
448
|
+
*
|
|
449
|
+
* @source `src/xrGame/trade.cpp`, `CTrade::OnPerformTrade`.
|
|
378
450
|
*/
|
|
379
451
|
public set_callback<T extends AnyObject>(
|
|
380
452
|
type: TXR_callbacks["trade_perform_operation"],
|
|
381
|
-
cb?: (
|
|
382
|
-
object?:
|
|
453
|
+
cb?: Nillable<(this: void, money_get: u32, money_put: u32) => void>,
|
|
454
|
+
object?: Nillable<T>
|
|
383
455
|
): void;
|
|
384
456
|
|
|
385
457
|
/**
|
|
386
|
-
*
|
|
458
|
+
* Fired by a script zone when a game object enters it.
|
|
387
459
|
*
|
|
388
|
-
*
|
|
460
|
+
* @source `src/xrGame/script_zone.cpp`, `CScriptZone::feel_touch_new`.
|
|
461
|
+
*
|
|
462
|
+
* @remarks
|
|
463
|
+
* The first callback argument is the zone object; the second is the entering object.
|
|
389
464
|
*/
|
|
390
465
|
public set_callback<T extends AnyObject>(
|
|
391
466
|
type: TXR_callbacks["zone_enter"],
|
|
392
|
-
cb?: (
|
|
393
|
-
object?:
|
|
467
|
+
cb?: Nillable<(this: void, zone: game_object, object: game_object) => void>,
|
|
468
|
+
object?: Nillable<T>
|
|
394
469
|
): void;
|
|
395
470
|
|
|
396
471
|
/**
|
|
397
|
-
*
|
|
472
|
+
* Fired by a script zone when a game object leaves it or is released while touching it.
|
|
473
|
+
*
|
|
474
|
+
* @source `src/xrGame/script_zone.cpp`, `CScriptZone::feel_touch_delete` and `CScriptZone::net_Relcase`.
|
|
398
475
|
*
|
|
399
|
-
*
|
|
476
|
+
* @remarks
|
|
477
|
+
* The first callback argument is the zone object; the second is the leaving object.
|
|
400
478
|
*/
|
|
401
479
|
public set_callback<T extends AnyObject>(
|
|
402
480
|
type: TXR_callbacks["zone_exit"],
|
|
403
|
-
cb?: (
|
|
404
|
-
object?:
|
|
481
|
+
cb?: Nillable<(this: void, zone: game_object, object: game_object) => void>,
|
|
482
|
+
object?: Nillable<T>
|
|
405
483
|
): void;
|
|
406
484
|
|
|
407
485
|
/**
|
|
408
|
-
*
|
|
486
|
+
* Fired when the actor leaves the playable level border.
|
|
487
|
+
*
|
|
488
|
+
* @source `src/xrGame/Actor.cpp`, `CActor::SwitchOutBorder`.
|
|
409
489
|
*/
|
|
410
490
|
public set_callback<T extends AnyObject>(
|
|
411
491
|
type: TXR_callbacks["level_border_exit"],
|
|
412
|
-
cb?: (
|
|
413
|
-
object?:
|
|
492
|
+
cb?: Nillable<(this: void, object: game_object) => void>,
|
|
493
|
+
object?: Nillable<T>
|
|
414
494
|
): void;
|
|
415
495
|
|
|
416
496
|
/**
|
|
417
|
-
*
|
|
497
|
+
* Fired when the actor re-enters the playable level border.
|
|
498
|
+
*
|
|
499
|
+
* @source `src/xrGame/Actor.cpp`, `CActor::SwitchOutBorder`.
|
|
418
500
|
*/
|
|
419
501
|
public set_callback<T extends AnyObject>(
|
|
420
502
|
type: TXR_callbacks["level_border_enter"],
|
|
421
|
-
cb?: (
|
|
422
|
-
object?:
|
|
503
|
+
cb?: Nillable<(this: void, object: game_object) => void>,
|
|
504
|
+
object?: Nillable<T>
|
|
423
505
|
): void;
|
|
424
506
|
|
|
425
507
|
/**
|
|
426
|
-
*
|
|
508
|
+
* Fired when the object dies or a destroyable physics object is destroyed.
|
|
509
|
+
*
|
|
510
|
+
* @source `src/xrGame/entity_alive.cpp`, `src/xrGame/DestroyablePhysicsObject.cpp`, and `src/xrGame/ai/crow/ai_crow.cpp`.
|
|
511
|
+
*
|
|
512
|
+
* @remarks
|
|
513
|
+
* The engine passes the victim and, when available, the killer object.
|
|
427
514
|
*/
|
|
428
515
|
public set_callback<T extends AnyObject>(
|
|
429
516
|
type: TXR_callbacks["death"],
|
|
430
517
|
cb?: (this: void, target: game_object, killer: game_object) => void,
|
|
431
|
-
object?:
|
|
518
|
+
object?: Nillable<T>
|
|
432
519
|
): void;
|
|
433
520
|
|
|
434
521
|
/**
|
|
435
|
-
*
|
|
522
|
+
* Fired when an object reaches a patrol path point.
|
|
523
|
+
*
|
|
524
|
+
* @source `src/xrGame/patrol_path_manager.cpp`, `CPatrolPathManager::select_point`.
|
|
525
|
+
*
|
|
526
|
+
* @remarks
|
|
527
|
+
* The action type is `ScriptEntity::eActionTypeMovement`; `point_index` is the reached patrol vertex index.
|
|
436
528
|
*/
|
|
437
529
|
public set_callback<T extends AnyObject>(
|
|
438
530
|
type: TXR_callbacks["patrol_path_in_point"],
|
|
439
|
-
cb?: (
|
|
440
|
-
object?:
|
|
531
|
+
cb?: Nillable<(this: void, object: game_object, action_type: number, point_index: number) => void>,
|
|
532
|
+
object?: Nillable<T>
|
|
441
533
|
): void;
|
|
442
534
|
|
|
443
|
-
//
|
|
535
|
+
// The `inventory_pda` callback is registered in the enum, but no xray-16 call site was found.
|
|
444
536
|
|
|
445
537
|
/**
|
|
446
|
-
*
|
|
538
|
+
* Fired when the actor receives an info portion.
|
|
539
|
+
*
|
|
540
|
+
* @source `src/xrGame/actor_communication.cpp`, `CActor::OnReceiveInfo`.
|
|
447
541
|
*/
|
|
448
542
|
public set_callback<T extends AnyObject>(
|
|
449
543
|
type: TXR_callbacks["inventory_info"],
|
|
450
|
-
cb?: (
|
|
451
|
-
object?:
|
|
544
|
+
cb?: Nillable<(this: void, npc: game_object, info_id: string) => void>,
|
|
545
|
+
object?: Nillable<T>
|
|
546
|
+
): void;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Fired when the actor receives an encyclopedia article from an info portion.
|
|
550
|
+
*
|
|
551
|
+
* @source `src/xrGame/actor_communication.cpp`, `CActor::AddEncyclopediaArticle`.
|
|
552
|
+
*/
|
|
553
|
+
public set_callback<T extends AnyObject>(
|
|
554
|
+
type: TXR_callbacks["article_info"],
|
|
555
|
+
cb?: Nillable<(this: void, actor: game_object, group: string, name: string, article_type: i32) => void>,
|
|
556
|
+
object?: Nillable<T>
|
|
452
557
|
): void;
|
|
453
558
|
|
|
454
|
-
|
|
559
|
+
/**
|
|
560
|
+
* Fired when an actor task state changes.
|
|
561
|
+
*
|
|
562
|
+
* @source `src/xrGame/GameTask.cpp`, `CGameTask::ChangeStateCallback` and `SGameTaskObjective::ChangeStateCallback`.
|
|
563
|
+
*
|
|
564
|
+
* @remarks
|
|
565
|
+
* Root task callbacks pass task and state. Objective callbacks are fired from the engine with parent task, objective, and state.
|
|
566
|
+
*/
|
|
567
|
+
public set_callback<T extends AnyObject>(
|
|
568
|
+
type: TXR_callbacks["task_state"],
|
|
569
|
+
cb?: Nillable<(this: void, task: CGameTask, state: TXR_TaskState) => void>,
|
|
570
|
+
object?: Nillable<T>
|
|
571
|
+
): void;
|
|
455
572
|
|
|
456
573
|
/**
|
|
457
|
-
*
|
|
574
|
+
* Fired when a task objective state changes.
|
|
575
|
+
*
|
|
576
|
+
* @source `src/xrGame/GameTask.cpp`, `SGameTaskObjective::ChangeStateCallback`.
|
|
458
577
|
*/
|
|
459
578
|
public set_callback<T extends AnyObject>(
|
|
460
579
|
type: TXR_callbacks["task_state"],
|
|
461
|
-
cb?: (
|
|
462
|
-
object?:
|
|
580
|
+
cb?: Nillable<(this: void, task: CGameTask, objective: SGameTaskObjective, state: TXR_TaskState) => void>,
|
|
581
|
+
object?: Nillable<T>
|
|
463
582
|
): void;
|
|
464
583
|
|
|
465
584
|
/**
|
|
466
|
-
*
|
|
585
|
+
* Fired when the single-player map manager adds an actor map location.
|
|
586
|
+
*
|
|
587
|
+
* @source `src/xrGame/map_manager.cpp`, `CMapManager::AddMapLocation`.
|
|
467
588
|
*/
|
|
468
589
|
public set_callback<T extends AnyObject>(
|
|
469
590
|
type: TXR_callbacks["map_location_added"],
|
|
470
|
-
cb?: (
|
|
471
|
-
object?:
|
|
591
|
+
cb?: Nillable<(this: void, spot_type: string, id: u16) => void>,
|
|
592
|
+
object?: Nillable<T>
|
|
472
593
|
): void;
|
|
473
594
|
|
|
474
595
|
/**
|
|
475
|
-
*
|
|
596
|
+
* Fired when the actor uses an inventory item.
|
|
597
|
+
*
|
|
598
|
+
* @source `src/xrGame/Inventory.cpp`, inventory item use path.
|
|
476
599
|
*/
|
|
477
600
|
public set_callback<T extends AnyObject>(
|
|
478
601
|
type: TXR_callbacks["use_object"],
|
|
479
|
-
cb?: (
|
|
480
|
-
object?:
|
|
602
|
+
cb?: Nillable<(this: void, object: game_object) => void>,
|
|
603
|
+
object?: Nillable<T>
|
|
481
604
|
): void;
|
|
482
605
|
|
|
483
606
|
/**
|
|
484
|
-
*
|
|
607
|
+
* Fired when an object is used by another object.
|
|
608
|
+
*
|
|
609
|
+
* @source `src/xrGame/GameObject.cpp` and `src/xrGame/doors_door.cpp`.
|
|
610
|
+
*
|
|
611
|
+
* @remarks
|
|
612
|
+
* Door use callbacks pass the used object and the initiator when the initiator is available.
|
|
485
613
|
*/
|
|
486
614
|
public set_callback<T extends AnyObject>(
|
|
487
615
|
type: TXR_callbacks["use_object"],
|
|
488
|
-
cb?: (
|
|
489
|
-
object?:
|
|
616
|
+
cb?: Nillable<(this: void, object: game_object, who: game_object) => void>,
|
|
617
|
+
object?: Nillable<T>
|
|
490
618
|
): void;
|
|
491
619
|
|
|
492
620
|
/**
|
|
493
|
-
*
|
|
621
|
+
* Fired when the actor receives a hit processed by the script hit path.
|
|
622
|
+
*
|
|
623
|
+
* @source `src/xrGame/Actor.cpp`, `CActor::Hit`.
|
|
494
624
|
*/
|
|
495
625
|
public set_callback<T extends AnyObject>(
|
|
496
626
|
type: TXR_callbacks["hit"],
|
|
497
|
-
cb?:
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
damage: number,
|
|
502
|
-
direction: vector,
|
|
503
|
-
who: game_object,
|
|
504
|
-
bone_id: number
|
|
505
|
-
) => void)
|
|
506
|
-
| null,
|
|
507
|
-
object?: Maybe<T>
|
|
627
|
+
cb?: Nillable<
|
|
628
|
+
(this: void, object: game_object, damage: number, direction: vector, who: game_object, bone_id: number) => void
|
|
629
|
+
>,
|
|
630
|
+
object?: Nillable<T>
|
|
508
631
|
): void;
|
|
509
632
|
|
|
510
633
|
/**
|
|
511
|
-
*
|
|
634
|
+
* Fired when a script entity processes a saved sound notification.
|
|
635
|
+
*
|
|
636
|
+
* @source `src/xrGame/script_entity.cpp`, `CScriptEntity::process_sound_callbacks`.
|
|
512
637
|
*/
|
|
513
638
|
public set_callback<T extends AnyObject>(
|
|
514
639
|
type: TXR_callbacks["sound"],
|
|
515
|
-
cb?:
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
object?:
|
|
640
|
+
cb?: Nillable<
|
|
641
|
+
(
|
|
642
|
+
this: void,
|
|
643
|
+
object: game_object,
|
|
644
|
+
source_id: number,
|
|
645
|
+
sound_type: TXR_snd_type,
|
|
646
|
+
position: vector,
|
|
647
|
+
sound_power: number
|
|
648
|
+
) => void
|
|
649
|
+
>,
|
|
650
|
+
object?: Nillable<T>
|
|
526
651
|
): void;
|
|
527
652
|
|
|
528
653
|
/**
|
|
529
|
-
*
|
|
654
|
+
* Fired when a script entity movement action completes.
|
|
655
|
+
*
|
|
656
|
+
* @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
|
|
657
|
+
*
|
|
658
|
+
* @remarks
|
|
659
|
+
* The engine passes `-1` as the third argument for this callback path.
|
|
530
660
|
*/
|
|
531
661
|
public set_callback<T extends AnyObject>(
|
|
532
662
|
type: TXR_callbacks["action_movement"],
|
|
533
|
-
cb?: (
|
|
534
|
-
object?:
|
|
663
|
+
cb?: Nillable<(this: void, object: game_object, movement_type: u32 /* EMovementType */, unknown: -1) => void>,
|
|
664
|
+
object?: Nillable<T>
|
|
535
665
|
): void;
|
|
536
666
|
|
|
537
|
-
|
|
667
|
+
/**
|
|
668
|
+
* Fired when a script entity watch action completes.
|
|
669
|
+
*
|
|
670
|
+
* @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
|
|
671
|
+
*/
|
|
672
|
+
public set_callback<T extends AnyObject>(
|
|
673
|
+
type: TXR_callbacks["action_watch"],
|
|
674
|
+
cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
|
|
675
|
+
object?: Nillable<T>
|
|
676
|
+
): void;
|
|
538
677
|
|
|
539
|
-
|
|
678
|
+
/**
|
|
679
|
+
* Fired when a script entity action is removed from its queue.
|
|
680
|
+
*
|
|
681
|
+
* @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
|
|
682
|
+
*/
|
|
683
|
+
public set_callback<T extends AnyObject>(
|
|
684
|
+
type: TXR_callbacks["action_removed"],
|
|
685
|
+
cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
|
|
686
|
+
object?: Nillable<T>
|
|
687
|
+
): void;
|
|
540
688
|
|
|
541
|
-
|
|
689
|
+
/**
|
|
690
|
+
* Fired when a script entity animation action completes.
|
|
691
|
+
*
|
|
692
|
+
* @source `src/xrGame/script_entity.cpp`, `ScriptCallBack`.
|
|
693
|
+
*/
|
|
694
|
+
public set_callback<T extends AnyObject>(
|
|
695
|
+
type: TXR_callbacks["action_animation"],
|
|
696
|
+
cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
|
|
697
|
+
object?: Nillable<T>
|
|
698
|
+
): void;
|
|
542
699
|
|
|
543
|
-
|
|
700
|
+
/**
|
|
701
|
+
* Fired when a script entity sound action completes.
|
|
702
|
+
*
|
|
703
|
+
* @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
|
|
704
|
+
*/
|
|
705
|
+
public set_callback<T extends AnyObject>(
|
|
706
|
+
type: TXR_callbacks["action_sound"],
|
|
707
|
+
cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
|
|
708
|
+
object?: Nillable<T>
|
|
709
|
+
): void;
|
|
544
710
|
|
|
545
|
-
|
|
711
|
+
/**
|
|
712
|
+
* Fired when a script entity particle action completes.
|
|
713
|
+
*
|
|
714
|
+
* @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
|
|
715
|
+
*/
|
|
716
|
+
public set_callback<T extends AnyObject>(
|
|
717
|
+
type: TXR_callbacks["action_particle"],
|
|
718
|
+
cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
|
|
719
|
+
object?: Nillable<T>
|
|
720
|
+
): void;
|
|
546
721
|
|
|
547
|
-
|
|
722
|
+
/**
|
|
723
|
+
* Fired when a script entity object action completes.
|
|
724
|
+
*
|
|
725
|
+
* @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
|
|
726
|
+
*/
|
|
727
|
+
public set_callback<T extends AnyObject>(
|
|
728
|
+
type: TXR_callbacks["action_object"],
|
|
729
|
+
cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
|
|
730
|
+
object?: Nillable<T>
|
|
731
|
+
): void;
|
|
548
732
|
|
|
549
|
-
//
|
|
733
|
+
// The `actor_sleep` callback is registered in the enum, but no xray-16 call site was found.
|
|
550
734
|
|
|
551
735
|
/**
|
|
552
|
-
*
|
|
736
|
+
* Fired when a helicopter reaches its current patrol path point or move target.
|
|
737
|
+
*
|
|
738
|
+
* @source `src/xrGame/HelicopterMovementManager.cpp`.
|
|
739
|
+
*
|
|
740
|
+
* @remarks
|
|
741
|
+
* Patrol-path movement passes the patrol vertex id. Direct movement passes `-1`.
|
|
553
742
|
*/
|
|
554
743
|
public set_callback<T extends AnyObject>(
|
|
555
744
|
type: TXR_callbacks["helicopter_on_point"],
|
|
556
|
-
cb?: (
|
|
557
|
-
object?:
|
|
745
|
+
cb?: Nillable<(this: void, distance: number, current_position: vector, vertex_id: number) => void>,
|
|
746
|
+
object?: Nillable<T>
|
|
558
747
|
): void;
|
|
559
748
|
|
|
560
749
|
/**
|
|
561
|
-
*
|
|
750
|
+
* Fired when a helicopter is hit by the actor, stalker, or custom zone.
|
|
751
|
+
*
|
|
752
|
+
* @source `src/xrGame/Helicopter2.cpp`, `CHelicopter::Hit`.
|
|
562
753
|
*/
|
|
563
754
|
public set_callback<T extends AnyObject>(
|
|
564
755
|
type: TXR_callbacks["helicopter_on_hit"],
|
|
565
|
-
cb?: (
|
|
566
|
-
object?:
|
|
756
|
+
cb?: Nillable<(this: void, damage: number, impulse: number, hit_type: number, who_id: number) => void>,
|
|
757
|
+
object?: Nillable<T>
|
|
567
758
|
): void;
|
|
568
759
|
|
|
569
760
|
/**
|
|
570
|
-
*
|
|
761
|
+
* Fired when an inventory owner takes an item.
|
|
762
|
+
*
|
|
763
|
+
* @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemTake`.
|
|
571
764
|
*/
|
|
572
765
|
public set_callback<T extends AnyObject>(
|
|
573
766
|
type: TXR_callbacks["on_item_take"],
|
|
574
|
-
cb?: (
|
|
575
|
-
object?:
|
|
767
|
+
cb?: Nillable<(this: void, object: game_object, item: game_object) => void>,
|
|
768
|
+
object?: Nillable<T>
|
|
576
769
|
): void;
|
|
577
770
|
|
|
578
771
|
/**
|
|
579
|
-
*
|
|
772
|
+
* Fired when an inventory owner drops an item.
|
|
773
|
+
*
|
|
774
|
+
* @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemDrop`.
|
|
580
775
|
*/
|
|
581
776
|
public set_callback<T extends AnyObject>(
|
|
582
777
|
type: TXR_callbacks["on_item_drop"],
|
|
583
|
-
cb?: (
|
|
584
|
-
object?:
|
|
778
|
+
cb?: Nillable<(this: void, object: game_object, item: game_object) => void>,
|
|
779
|
+
object?: Nillable<T>
|
|
585
780
|
): void;
|
|
586
781
|
|
|
587
782
|
/**
|
|
588
|
-
*
|
|
783
|
+
* Fired by script animation callback processing.
|
|
784
|
+
*
|
|
785
|
+
* @source `src/xrGame/stalker_animation_manager_update.cpp` and `src/xrGame/animation_script_callback.cpp`.
|
|
786
|
+
*
|
|
787
|
+
* @remarks
|
|
788
|
+
* Stalker animation manager callbacks can call this with no arguments; animation script callbacks pass whether the ended phase is being reported.
|
|
589
789
|
*/
|
|
590
790
|
public set_callback<T extends AnyObject>(
|
|
591
791
|
type: TXR_callbacks["script_animation"],
|
|
592
|
-
cb?: (
|
|
593
|
-
object?: object
|
|
792
|
+
cb?: Nillable<(this: void, skip_multi_anim_check?: boolean) => void>,
|
|
793
|
+
object?: Nillable<object>
|
|
594
794
|
): void;
|
|
595
795
|
|
|
596
796
|
/**
|
|
597
|
-
*
|
|
797
|
+
* Fired when a trader needs a new global animation motion.
|
|
798
|
+
*
|
|
799
|
+
* @source `src/xrGame/ai/trader/trader_animation.cpp`, `CTraderAnimation::update_frame`.
|
|
598
800
|
*/
|
|
599
801
|
public set_callback<T extends AnyObject>(
|
|
600
802
|
type: TXR_callbacks["trader_global_anim_request"],
|
|
601
|
-
cb?: (
|
|
602
|
-
object?:
|
|
803
|
+
cb?: Nillable<(this: void) => void>,
|
|
804
|
+
object?: Nillable<T>
|
|
603
805
|
): void;
|
|
604
806
|
|
|
605
807
|
/**
|
|
606
|
-
*
|
|
808
|
+
* Fired when a trader needs a new head animation motion while sound is playing.
|
|
809
|
+
*
|
|
810
|
+
* @source `src/xrGame/ai/trader/trader_animation.cpp`, `CTraderAnimation::update_frame`.
|
|
607
811
|
*/
|
|
608
812
|
public set_callback<T extends AnyObject>(
|
|
609
813
|
type: TXR_callbacks["trader_head_anim_request"],
|
|
610
|
-
cb?: (
|
|
611
|
-
object?:
|
|
814
|
+
cb?: Nillable<(this: void) => void>,
|
|
815
|
+
object?: Nillable<T>
|
|
612
816
|
): void;
|
|
613
817
|
|
|
614
818
|
/**
|
|
615
|
-
*
|
|
819
|
+
* Fired when a trader sound finishes playing.
|
|
820
|
+
*
|
|
821
|
+
* @source `src/xrGame/ai/trader/trader_animation.cpp`, `CTraderAnimation::update_frame`.
|
|
616
822
|
*/
|
|
617
823
|
public set_callback<T extends AnyObject>(
|
|
618
824
|
type: TXR_callbacks["trader_sound_end"],
|
|
619
|
-
cb?: (
|
|
620
|
-
object?:
|
|
825
|
+
cb?: Nillable<(this: void) => void>,
|
|
826
|
+
object?: Nillable<T>
|
|
621
827
|
): void;
|
|
622
828
|
|
|
623
829
|
/**
|
|
624
|
-
*
|
|
830
|
+
* Fired when the actor takes an item from an inventory box while the box is open.
|
|
831
|
+
*
|
|
832
|
+
* @source `src/xrGame/InventoryBox.cpp`, `CInventoryBox::TakeItem`.
|
|
625
833
|
*/
|
|
626
834
|
public set_callback<T extends AnyObject>(
|
|
627
835
|
type: TXR_callbacks["take_item_from_box"],
|
|
628
|
-
cb?: (
|
|
629
|
-
object?:
|
|
836
|
+
cb?: Nillable<(this: void, object: game_object, box: game_object, item: game_object) => void>,
|
|
837
|
+
object?: Nillable<T>
|
|
630
838
|
): void;
|
|
631
839
|
|
|
632
840
|
/**
|
|
633
|
-
*
|
|
841
|
+
* Fired when an actor-owned weapon tries to reload and no suitable ammo is available.
|
|
842
|
+
*
|
|
843
|
+
* @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::TryReload`.
|
|
634
844
|
*/
|
|
635
845
|
public set_callback<T extends AnyObject>(
|
|
636
846
|
type: TXR_callbacks["weapon_no_ammo"],
|
|
637
|
-
cb?: (
|
|
638
|
-
object?:
|
|
847
|
+
cb?: Nillable<(this: void, object: game_object, suitable_ammo_total: i32) => void>,
|
|
848
|
+
object?: Nillable<T>
|
|
639
849
|
): void;
|
|
640
850
|
|
|
641
851
|
/**
|
|
642
|
-
*
|
|
643
|
-
*
|
|
852
|
+
* Fired when a HUD item animation ends.
|
|
853
|
+
*
|
|
854
|
+
* @source `src/xrGame/HudItem.cpp`, `CHudItem::OnAnimationEnd`.
|
|
644
855
|
*/
|
|
645
856
|
public set_callback<T extends AnyObject>(
|
|
646
857
|
type: TXR_callbacks["hud_animation_end"],
|
|
647
|
-
cb?:
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
object?:
|
|
858
|
+
cb?: Nillable<
|
|
859
|
+
(
|
|
860
|
+
this: void,
|
|
861
|
+
object: game_object,
|
|
862
|
+
hud_section: string,
|
|
863
|
+
current_motion: string,
|
|
864
|
+
state: u32,
|
|
865
|
+
animation_slot: u32
|
|
866
|
+
) => void
|
|
867
|
+
>,
|
|
868
|
+
object?: Nillable<T>
|
|
658
869
|
): void;
|
|
659
870
|
|
|
660
871
|
/**
|
|
661
|
-
*
|
|
872
|
+
* Fired when the actor receives a keyboard press before UI and game input handling.
|
|
873
|
+
*
|
|
874
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnKeyboardPress`.
|
|
662
875
|
*/
|
|
663
876
|
public set_callback<T extends AnyObject>(
|
|
664
877
|
type: TXR_callbacks["key_press"],
|
|
665
|
-
cb?: (
|
|
666
|
-
object?:
|
|
878
|
+
cb?: Nillable<(this: void, key: i32) => void>,
|
|
879
|
+
object?: Nillable<T>
|
|
667
880
|
): void;
|
|
668
881
|
|
|
669
882
|
/**
|
|
670
|
-
*
|
|
883
|
+
* Fired when the actor receives a keyboard release before UI and game input handling.
|
|
884
|
+
*
|
|
885
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnKeyboardRelease`.
|
|
671
886
|
*/
|
|
672
887
|
public set_callback<T extends AnyObject>(
|
|
673
888
|
type: TXR_callbacks["key_release"],
|
|
674
|
-
cb?: (
|
|
675
|
-
object?:
|
|
889
|
+
cb?: Nillable<(this: void, key: i32) => void>,
|
|
890
|
+
object?: Nillable<T>
|
|
676
891
|
): void;
|
|
677
892
|
|
|
678
893
|
/**
|
|
679
|
-
*
|
|
894
|
+
* Fired when the actor receives a keyboard hold before normal input handling.
|
|
895
|
+
*
|
|
896
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnKeyboardHold`.
|
|
680
897
|
*/
|
|
681
898
|
public set_callback<T extends AnyObject>(
|
|
682
899
|
type: TXR_callbacks["key_hold"],
|
|
683
|
-
cb?: (
|
|
684
|
-
object?:
|
|
900
|
+
cb?: Nillable<(this: void, key: i32) => void>,
|
|
901
|
+
object?: Nillable<T>
|
|
685
902
|
): void;
|
|
686
903
|
|
|
687
|
-
|
|
904
|
+
/**
|
|
905
|
+
* Fired when the actor receives a mouse movement event before normal input handling.
|
|
906
|
+
*
|
|
907
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnMouseMove`.
|
|
908
|
+
*/
|
|
909
|
+
public set_callback<T extends AnyObject>(
|
|
910
|
+
type: TXR_callbacks["mouse_move"],
|
|
911
|
+
cb?: Nillable<(this: void, dx: i32, dy: i32) => void>,
|
|
912
|
+
object?: Nillable<T>
|
|
913
|
+
): void;
|
|
688
914
|
|
|
689
|
-
|
|
915
|
+
/**
|
|
916
|
+
* Fired when the actor receives a mouse wheel event before normal input handling.
|
|
917
|
+
*
|
|
918
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnMouseWheel`.
|
|
919
|
+
*
|
|
920
|
+
* @remarks
|
|
921
|
+
* The engine passes wheel deltas as `(y, x)`.
|
|
922
|
+
*/
|
|
923
|
+
public set_callback<T extends AnyObject>(
|
|
924
|
+
type: TXR_callbacks["mouse_wheel"],
|
|
925
|
+
cb?: Nillable<(this: void, y: number, x: number) => void>,
|
|
926
|
+
object?: Nillable<T>
|
|
927
|
+
): void;
|
|
690
928
|
|
|
691
|
-
|
|
929
|
+
/**
|
|
930
|
+
* Fired when the actor receives a controller press event before normal input handling.
|
|
931
|
+
*
|
|
932
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerPress`.
|
|
933
|
+
*/
|
|
934
|
+
public set_callback<T extends AnyObject>(
|
|
935
|
+
type: TXR_callbacks["controller_press"],
|
|
936
|
+
cb?: Nillable<(this: void, key: i32, state: AnyObject) => void>,
|
|
937
|
+
object?: Nillable<T>
|
|
938
|
+
): void;
|
|
692
939
|
|
|
693
|
-
|
|
940
|
+
/**
|
|
941
|
+
* Fired when the actor receives a controller release event before normal input handling.
|
|
942
|
+
*
|
|
943
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerRelease`.
|
|
944
|
+
*/
|
|
945
|
+
public set_callback<T extends AnyObject>(
|
|
946
|
+
type: TXR_callbacks["controller_release"],
|
|
947
|
+
cb?: Nillable<(this: void, key: i32, state: AnyObject) => void>,
|
|
948
|
+
object?: Nillable<T>
|
|
949
|
+
): void;
|
|
694
950
|
|
|
695
|
-
|
|
951
|
+
/**
|
|
952
|
+
* Fired when the actor receives a controller hold event before normal input handling.
|
|
953
|
+
*
|
|
954
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerHold`.
|
|
955
|
+
*/
|
|
956
|
+
public set_callback<T extends AnyObject>(
|
|
957
|
+
type: TXR_callbacks["controller_hold"],
|
|
958
|
+
cb?: Nillable<(this: void, key: i32, state: AnyObject) => void>,
|
|
959
|
+
object?: Nillable<T>
|
|
960
|
+
): void;
|
|
696
961
|
|
|
697
|
-
|
|
962
|
+
/**
|
|
963
|
+
* Fired when the actor receives a controller attitude change event before normal input handling.
|
|
964
|
+
*
|
|
965
|
+
* @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerAttitudeChange`.
|
|
966
|
+
*/
|
|
967
|
+
public set_callback<T extends AnyObject>(
|
|
968
|
+
type: TXR_callbacks["controller_attitude_change"],
|
|
969
|
+
cb?: Nillable<(this: void, change: vector) => void>,
|
|
970
|
+
object?: Nillable<T>
|
|
971
|
+
): void;
|
|
698
972
|
|
|
699
973
|
/**
|
|
700
|
-
*
|
|
974
|
+
* Fired when an inventory owner moves an item to the belt.
|
|
975
|
+
*
|
|
976
|
+
* @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemBelt`.
|
|
701
977
|
*/
|
|
702
978
|
public set_callback<T extends AnyObject>(
|
|
703
979
|
type: TXR_callbacks["item_to_belt"],
|
|
704
|
-
cb?: (
|
|
705
|
-
object?:
|
|
980
|
+
cb?: Nillable<(this: void, object: game_object) => void>,
|
|
981
|
+
object?: Nillable<T>
|
|
706
982
|
): void;
|
|
707
983
|
|
|
708
984
|
/**
|
|
709
|
-
*
|
|
985
|
+
* Fired when an inventory owner moves an item to a slot.
|
|
986
|
+
*
|
|
987
|
+
* @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemSlot`.
|
|
710
988
|
*/
|
|
711
989
|
public set_callback<T extends AnyObject>(
|
|
712
990
|
type: TXR_callbacks["item_to_slot"],
|
|
713
|
-
cb?: (
|
|
714
|
-
object?:
|
|
991
|
+
cb?: Nillable<(this: void, object: game_object) => void>,
|
|
992
|
+
object?: Nillable<T>
|
|
715
993
|
): void;
|
|
716
994
|
|
|
717
995
|
/**
|
|
718
|
-
*
|
|
996
|
+
* Fired when an inventory owner moves an item to the rucksack.
|
|
997
|
+
*
|
|
998
|
+
* @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemRuck`.
|
|
719
999
|
*/
|
|
720
1000
|
public set_callback<T extends AnyObject>(
|
|
721
1001
|
type: TXR_callbacks["item_to_ruck"],
|
|
722
|
-
cb?: (
|
|
723
|
-
object?:
|
|
1002
|
+
cb?: Nillable<(this: void, object: game_object) => void>,
|
|
1003
|
+
object?: Nillable<T>
|
|
724
1004
|
): void;
|
|
725
1005
|
|
|
726
1006
|
/**
|
|
727
|
-
*
|
|
1007
|
+
* Fired when a weapon owner zooms in with a magazined weapon.
|
|
1008
|
+
*
|
|
1009
|
+
* @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnZoomIn`.
|
|
728
1010
|
*/
|
|
729
1011
|
public set_callback<T extends AnyObject>(
|
|
730
1012
|
type: TXR_callbacks["weapon_zoom_in"],
|
|
731
|
-
cb?: (
|
|
732
|
-
object?:
|
|
1013
|
+
cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
|
|
1014
|
+
object?: Nillable<T>
|
|
733
1015
|
): void;
|
|
734
1016
|
|
|
735
1017
|
/**
|
|
736
|
-
*
|
|
1018
|
+
* Fired when a weapon owner zooms out with a magazined weapon.
|
|
1019
|
+
*
|
|
1020
|
+
* @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnZoomOut`.
|
|
737
1021
|
*/
|
|
738
1022
|
public set_callback<T extends AnyObject>(
|
|
739
1023
|
type: TXR_callbacks["weapon_zoom_out"],
|
|
740
|
-
cb?: (
|
|
741
|
-
object?:
|
|
1024
|
+
cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
|
|
1025
|
+
object?: Nillable<T>
|
|
742
1026
|
): void;
|
|
743
1027
|
|
|
744
1028
|
/**
|
|
745
|
-
*
|
|
1029
|
+
* Fired when a magazined weapon misfires.
|
|
1030
|
+
*
|
|
1031
|
+
* @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnShot` misfire path.
|
|
746
1032
|
*/
|
|
747
1033
|
public set_callback<T extends AnyObject>(
|
|
748
1034
|
type: TXR_callbacks["weapon_jammed"],
|
|
749
|
-
cb?: (
|
|
750
|
-
object?:
|
|
1035
|
+
cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
|
|
1036
|
+
object?: Nillable<T>
|
|
751
1037
|
): void;
|
|
752
1038
|
|
|
753
1039
|
/**
|
|
754
|
-
*
|
|
1040
|
+
* Fired when an actor-owned magazined weapon becomes empty or unloads its magazine.
|
|
1041
|
+
*
|
|
1042
|
+
* @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnMagazineEmpty` and `CWeaponMagazined::UnloadMagazine`.
|
|
755
1043
|
*/
|
|
756
1044
|
public set_callback<T extends AnyObject>(
|
|
757
1045
|
type: TXR_callbacks["weapon_magazine_empty"],
|
|
758
|
-
cb?: (
|
|
759
|
-
object?:
|
|
1046
|
+
cb?: Nillable<(this: void, object: game_object, suitable_ammo_total: i32) => void>,
|
|
1047
|
+
object?: Nillable<T>
|
|
760
1048
|
): void;
|
|
761
1049
|
|
|
762
1050
|
/**
|
|
763
|
-
*
|
|
1051
|
+
* Fired before actor death handling when the engine callback gate is enabled.
|
|
1052
|
+
*
|
|
1053
|
+
* @source `src/xrGame/Entity.cpp`, `CEntity::KillEntity` under `ACTOR_BEFORE_DEATH_CALLBACK`.
|
|
1054
|
+
*
|
|
1055
|
+
* @remarks
|
|
1056
|
+
* The callback receives the id of the object that caused the actor death path.
|
|
764
1057
|
*/
|
|
765
1058
|
public set_callback<T extends AnyObject>(
|
|
766
1059
|
type: TXR_callbacks["actor_before_death"],
|
|
767
|
-
cb?: (
|
|
768
|
-
object?:
|
|
1060
|
+
cb?: Nillable<(this: void, killer_id: u16) => void>,
|
|
1061
|
+
object?: Nillable<T>
|
|
769
1062
|
): void;
|
|
770
1063
|
|
|
771
|
-
|
|
1064
|
+
/**
|
|
1065
|
+
* Fired when the actor attaches to a vehicle or mounted weapon.
|
|
1066
|
+
*
|
|
1067
|
+
* @source `src/xrGame/ActorVehicle.cpp` and `src/xrGame/ActorMountedWeapon.cpp`.
|
|
1068
|
+
*/
|
|
1069
|
+
public set_callback<T extends AnyObject>(
|
|
1070
|
+
type: TXR_callbacks["on_attach_vehicle"],
|
|
1071
|
+
cb?: Nillable<(this: void, vehicle: game_object) => void>,
|
|
1072
|
+
object?: Nillable<T>
|
|
1073
|
+
): void;
|
|
772
1074
|
|
|
773
|
-
|
|
1075
|
+
/**
|
|
1076
|
+
* Fired when the actor detaches from a vehicle or mounted weapon.
|
|
1077
|
+
*
|
|
1078
|
+
* @source `src/xrGame/ActorVehicle.cpp` and `src/xrGame/ActorMountedWeapon.cpp`.
|
|
1079
|
+
*/
|
|
1080
|
+
public set_callback<T extends AnyObject>(
|
|
1081
|
+
type: TXR_callbacks["on_detach_vehicle"],
|
|
1082
|
+
cb?: Nillable<(this: void, vehicle: game_object) => void>,
|
|
1083
|
+
object?: Nillable<T>
|
|
1084
|
+
): void;
|
|
774
1085
|
|
|
775
|
-
|
|
1086
|
+
/**
|
|
1087
|
+
* Fired when the actor uses a vehicle without attaching to it.
|
|
1088
|
+
*
|
|
1089
|
+
* @source `src/xrGame/ActorVehicle.cpp`, `CActor::use_Vehicle`.
|
|
1090
|
+
*/
|
|
1091
|
+
public set_callback<T extends AnyObject>(
|
|
1092
|
+
type: TXR_callbacks["on_use_vehicle"],
|
|
1093
|
+
cb?: Nillable<(this: void, vehicle: game_object) => void>,
|
|
1094
|
+
object?: Nillable<T>
|
|
1095
|
+
): void;
|
|
776
1096
|
|
|
777
1097
|
/**
|
|
778
1098
|
* Clear all callbacks registered on this object.
|
|
@@ -806,7 +1126,7 @@ declare module "xray16" {
|
|
|
806
1126
|
* @param cb - Callback called with current patrol point index.
|
|
807
1127
|
* @param object - Optional Lua context.
|
|
808
1128
|
*/
|
|
809
|
-
public set_patrol_extrapolate_callback(cb?: (
|
|
1129
|
+
public set_patrol_extrapolate_callback(cb?: Nillable<(cur_pt: number) => boolean>, object?: object): void;
|
|
810
1130
|
|
|
811
1131
|
/**
|
|
812
1132
|
* Set or clear smart-cover target selection callback.
|
|
@@ -814,6 +1134,9 @@ declare module "xray16" {
|
|
|
814
1134
|
* @param cb - Callback that receives this object when a smart-cover target is selected.
|
|
815
1135
|
* @param object - Optional Lua context.
|
|
816
1136
|
*/
|
|
817
|
-
public set_smart_cover_target_selector(
|
|
1137
|
+
public set_smart_cover_target_selector(
|
|
1138
|
+
cb?: Nillable<(object: game_object) => void>,
|
|
1139
|
+
object?: Nillable<object>
|
|
1140
|
+
): void;
|
|
818
1141
|
}
|
|
819
1142
|
}
|