xray16 1.4.0 → 1.5.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/package.json +1 -1
- package/types/xr_ai/xr_action.d.ts +1321 -29
- package/types/xr_ai/xr_alife.d.ts +1336 -32
- package/types/xr_ai/xr_enemy_evaluation.d.ts +112 -19
- package/types/xr_ai/xr_goap.d.ts +450 -3
- package/types/xr_ai/xr_graph.d.ts +94 -6
- package/types/xr_ai/xr_memory.d.ts +240 -6
- package/types/xr_lib/xr_animation.d.ts +185 -14
- package/types/xr_lib/xr_bitwise.d.ts +20 -8
- package/types/xr_lib/xr_color.d.ts +103 -6
- package/types/xr_lib/xr_debug.d.ts +110 -12
- package/types/xr_lib/xr_dialog.d.ts +99 -7
- package/types/xr_lib/xr_flags.d.ts +78 -15
- package/types/xr_lib/xr_fs.d.ts +395 -5
- package/types/xr_lib/xr_game.d.ts +101 -0
- package/types/xr_lib/xr_hit.d.ts +84 -0
- package/types/xr_lib/xr_ini.d.ts +60 -2
- package/types/xr_lib/xr_level.d.ts +182 -39
- package/types/xr_lib/xr_luabind.d.ts +37 -11
- package/types/xr_lib/xr_map.d.ts +137 -6
- package/types/xr_lib/xr_math.d.ts +56 -0
- package/types/xr_lib/xr_multiplayer.d.ts +729 -1
- package/types/xr_lib/xr_profile.d.ts +80 -0
- package/types/xr_lib/xr_properties.d.ts +159 -4
- package/types/xr_lib/xr_relation.d.ts +147 -0
- package/types/xr_lib/xr_render.d.ts +99 -3
- package/types/xr_lib/xr_save.d.ts +110 -4
- package/types/xr_lib/xr_sound.d.ts +373 -9
- package/types/xr_lib/xr_stats.ts +33 -4
- package/types/xr_lib/xr_task.d.ts +277 -0
- package/types/xr_lib/xr_time.d.ts +11 -0
- package/types/xr_object/client/xr_anomaly.d.ts +20 -0
- package/types/xr_object/client/xr_artefact.d.ts +57 -2
- package/types/xr_object/client/xr_client_object.d.ts +131 -0
- package/types/xr_object/client/xr_creature.d.ts +79 -0
- package/types/xr_object/client/xr_item.d.ts +108 -2
- package/types/xr_object/client/xr_level.d.ts +482 -14
- package/types/xr_object/client/xr_physic.d.ts +459 -29
- package/types/xr_object/client/xr_zone.d.ts +38 -0
- package/types/xr_object/script/xr_script_interface.d.ts +236 -1
- package/types/xr_object/script/xr_script_object.d.ts +3402 -82
- package/types/xr_object/script/xr_script_trade.d.ts +25 -15
- package/types/xr_object/server/xr_server_object.d.ts +707 -15
- package/types/xr_ui/xr_ui_asset.d.ts +241 -6
- package/types/xr_ui/xr_ui_core.d.ts +327 -9
- package/types/xr_ui/xr_ui_event.d.ts +1067 -1
- package/types/xr_ui/xr_ui_interface.d.ts +1563 -17
- package/types/xr_ui/xr_ui_menu.d.ts +259 -16
- package/types/xrf_plugin.d.ts +44 -14
|
@@ -11,6 +11,10 @@ declare module "xray16" {
|
|
|
11
11
|
/**
|
|
12
12
|
* Register a conditional level callback.
|
|
13
13
|
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The physics commander polls this callback pair. Remove it with the same condition and action callbacks when the
|
|
16
|
+
* owner no longer needs it.
|
|
17
|
+
*
|
|
14
18
|
* @param condition - Callback polled by the engine.
|
|
15
19
|
* @param action - Callback called when the condition is satisfied.
|
|
16
20
|
*/
|
|
@@ -19,20 +23,21 @@ declare module "xray16" {
|
|
|
19
23
|
/**
|
|
20
24
|
* Register a conditional level callback owned by an object.
|
|
21
25
|
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* The owner is used only for callback lookup and bulk removal. Keep the object alive while the callback can run.
|
|
28
|
+
*
|
|
22
29
|
* @param object - Owner object used for later removal.
|
|
23
30
|
* @param condition - Callback polled by the engine.
|
|
24
31
|
* @param action - Callback called when the condition is satisfied.
|
|
25
32
|
*/
|
|
26
|
-
add_call(
|
|
27
|
-
this: void,
|
|
28
|
-
object: object,
|
|
29
|
-
condition: (this: void) => boolean,
|
|
30
|
-
action: (this: void) => boolean
|
|
31
|
-
): void;
|
|
33
|
+
add_call(this: void, object: object, condition: (this: void) => boolean, action: (this: void) => boolean): void;
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
36
|
* Register named object methods as a conditional level callback.
|
|
35
37
|
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* This overload registers a unique callback pair for the object and method names.
|
|
40
|
+
*
|
|
36
41
|
* @param object - Owner object used for callback lookup and removal.
|
|
37
42
|
* @param condition - Method name used as condition callback.
|
|
38
43
|
* @param action - Method name called when the condition is satisfied.
|
|
@@ -42,34 +47,40 @@ declare module "xray16" {
|
|
|
42
47
|
/**
|
|
43
48
|
* Start a camera effector.
|
|
44
49
|
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* Requires an actor. The binding adds the effector to `Actor().Cameras()`.
|
|
52
|
+
*
|
|
45
53
|
* @param effect - Camera effector animation file.
|
|
46
54
|
* @param id - Effector id used for replacement and removal.
|
|
47
55
|
* @param is_cyclic - Whether the effector loops.
|
|
48
56
|
* @param callback - Lua callback name called when the effector finishes.
|
|
57
|
+
* @returns Effector animation length.
|
|
49
58
|
*/
|
|
50
|
-
add_cam_effector(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string):
|
|
59
|
+
add_cam_effector(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string): f32;
|
|
51
60
|
|
|
52
61
|
/**
|
|
53
62
|
* Start a camera effector with custom field of view.
|
|
54
63
|
*
|
|
64
|
+
* @since OpenXRay 2019-05-07, 2d1b946a, PR #382
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* Requires an actor. The binding adds the effector to `Actor().Cameras()`.
|
|
68
|
+
*
|
|
55
69
|
* @param effect - Camera effector animation file.
|
|
56
70
|
* @param id - Effector id used for replacement and removal.
|
|
57
71
|
* @param is_cyclic - Whether the effector loops.
|
|
58
72
|
* @param callback - Lua callback name called when the effector finishes.
|
|
59
|
-
* @param camera_fov -
|
|
73
|
+
* @param camera_fov - Optional field of view for the effector.
|
|
74
|
+
* @returns Effector animation length.
|
|
60
75
|
*/
|
|
61
|
-
add_cam_effector2(
|
|
62
|
-
this: void,
|
|
63
|
-
effect: string,
|
|
64
|
-
id: i32,
|
|
65
|
-
is_cyclic: boolean,
|
|
66
|
-
callback: string,
|
|
67
|
-
camera_fov: f32
|
|
68
|
-
): void;
|
|
76
|
+
add_cam_effector2(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string, camera_fov?: f32): f32;
|
|
69
77
|
|
|
70
78
|
/**
|
|
71
79
|
* Start a named complex effector.
|
|
72
80
|
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* Requires an actor. The effector is attached to the current actor object.
|
|
83
|
+
*
|
|
73
84
|
* @param section - Effector section name.
|
|
74
85
|
* @param id - Effector id used for replacement and removal.
|
|
75
86
|
*/
|
|
@@ -85,6 +96,9 @@ declare module "xray16" {
|
|
|
85
96
|
/**
|
|
86
97
|
* Start a post-process effector.
|
|
87
98
|
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* Requires an actor. The effector is attached to the actor camera manager.
|
|
101
|
+
*
|
|
88
102
|
* @param file_name - Post-process effector file.
|
|
89
103
|
* @param id - Effector id used for replacement and removal.
|
|
90
104
|
* @param is_cyclic - Whether the effector loops.
|
|
@@ -94,6 +108,9 @@ declare module "xray16" {
|
|
|
94
108
|
/**
|
|
95
109
|
* Move game time forward.
|
|
96
110
|
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* Works only on a single-player server with ALife available. Otherwise the binding returns without changing time.
|
|
113
|
+
*
|
|
97
114
|
* @param days - Days to add.
|
|
98
115
|
* @param hours - Hours to add.
|
|
99
116
|
* @param minutes - Minutes to add.
|
|
@@ -103,6 +120,9 @@ declare module "xray16" {
|
|
|
103
120
|
/**
|
|
104
121
|
* Validate a game object pointer in the engine.
|
|
105
122
|
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* Exported only in debug builds.
|
|
125
|
+
*
|
|
106
126
|
* @param object - Object to check.
|
|
107
127
|
*/
|
|
108
128
|
check_object(this: void, object: game_object): void;
|
|
@@ -117,6 +137,9 @@ declare module "xray16" {
|
|
|
117
137
|
/**
|
|
118
138
|
* Get actor object used by debug helpers.
|
|
119
139
|
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* Exported only in debug builds.
|
|
142
|
+
*
|
|
120
143
|
* @returns Actor game object.
|
|
121
144
|
*/
|
|
122
145
|
debug_actor(this: void): game_object;
|
|
@@ -124,6 +147,9 @@ declare module "xray16" {
|
|
|
124
147
|
/**
|
|
125
148
|
* Find an object by debug name.
|
|
126
149
|
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* Exported only in debug builds.
|
|
152
|
+
*
|
|
127
153
|
* @param name - Object name.
|
|
128
154
|
* @returns Matching game object.
|
|
129
155
|
*/
|
|
@@ -131,6 +157,9 @@ declare module "xray16" {
|
|
|
131
157
|
|
|
132
158
|
/**
|
|
133
159
|
* Disable player input.
|
|
160
|
+
*
|
|
161
|
+
* @remarks
|
|
162
|
+
* Does nothing while the actor exists and permanent god mode is enabled.
|
|
134
163
|
*/
|
|
135
164
|
disable_input(this: void): void;
|
|
136
165
|
|
|
@@ -156,6 +185,11 @@ declare module "xray16" {
|
|
|
156
185
|
/**
|
|
157
186
|
* Get active camera id.
|
|
158
187
|
*
|
|
188
|
+
* @since OpenXRay 2015-07-07, 6e703b4c
|
|
189
|
+
*
|
|
190
|
+
* @remarks
|
|
191
|
+
* Returns `255` when the current view entity is not an actor.
|
|
192
|
+
*
|
|
159
193
|
* @returns Camera id.
|
|
160
194
|
*/
|
|
161
195
|
get_active_cam(this: void): u8;
|
|
@@ -184,6 +218,8 @@ declare module "xray16" {
|
|
|
184
218
|
/**
|
|
185
219
|
* Get distance to the object or surface under the crosshair.
|
|
186
220
|
*
|
|
221
|
+
* @since OpenXRay 2014-12-27, c82669625
|
|
222
|
+
*
|
|
187
223
|
* @returns Target distance.
|
|
188
224
|
*/
|
|
189
225
|
get_target_dist(this: void): f32;
|
|
@@ -191,6 +227,11 @@ declare module "xray16" {
|
|
|
191
227
|
/**
|
|
192
228
|
* Get targeted model element under the crosshair.
|
|
193
229
|
*
|
|
230
|
+
* @since OpenXRay 2015-06-03, 7213550c
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* Returns `0` when the current ray query has no model element.
|
|
234
|
+
*
|
|
194
235
|
* @returns Target element id.
|
|
195
236
|
*/
|
|
196
237
|
get_target_element(this: void): u32;
|
|
@@ -198,6 +239,8 @@ declare module "xray16" {
|
|
|
198
239
|
/**
|
|
199
240
|
* Get the object under the crosshair.
|
|
200
241
|
*
|
|
242
|
+
* @since OpenXRay 2014-12-27, c82669625
|
|
243
|
+
*
|
|
201
244
|
* @returns Target object, or `null` when nothing is targeted.
|
|
202
245
|
*/
|
|
203
246
|
get_target_obj(this: void): game_object | null;
|
|
@@ -244,10 +287,20 @@ declare module "xray16" {
|
|
|
244
287
|
*/
|
|
245
288
|
get_wfx_time(this: void): f32;
|
|
246
289
|
|
|
247
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Hide HUD indicators.
|
|
292
|
+
*
|
|
293
|
+
* @remarks
|
|
294
|
+
* Also enables the runtime god-mode flag used while HUD indicators are hidden.
|
|
295
|
+
*/
|
|
248
296
|
hide_indicators(this: void): void;
|
|
249
297
|
|
|
250
|
-
/**
|
|
298
|
+
/**
|
|
299
|
+
* Hide HUD indicators if the HUD is available.
|
|
300
|
+
*
|
|
301
|
+
* @remarks
|
|
302
|
+
* Also enables the runtime god-mode flag used while HUD indicators are hidden.
|
|
303
|
+
*/
|
|
251
304
|
hide_indicators_safe(this: void): void;
|
|
252
305
|
|
|
253
306
|
/**
|
|
@@ -269,6 +322,8 @@ declare module "xray16" {
|
|
|
269
322
|
/**
|
|
270
323
|
* Iterate objects currently online on the level.
|
|
271
324
|
*
|
|
325
|
+
* @since OpenXRay 2019-04-28, 13c5c022
|
|
326
|
+
*
|
|
272
327
|
* @param cb - Callback called for each online object.
|
|
273
328
|
*/
|
|
274
329
|
iterate_online_objects(this: void, cb: (this: void, object: game_object) => void | boolean): void;
|
|
@@ -276,21 +331,35 @@ declare module "xray16" {
|
|
|
276
331
|
/**
|
|
277
332
|
* Iterate sounds from a sound collection.
|
|
278
333
|
*
|
|
334
|
+
* @remarks
|
|
335
|
+
* `section` may contain a comma-separated list of base names. The callback receives each existing sound name found
|
|
336
|
+
* in `$game_sounds$`, including numbered variants from `0` up to `max_count - 1`.
|
|
337
|
+
*
|
|
279
338
|
* @param section - Sound collection section.
|
|
280
|
-
* @param
|
|
281
|
-
* @param cb - Callback called
|
|
339
|
+
* @param max_count - Numbered suffixes to probe for each base name.
|
|
340
|
+
* @param cb - Callback called with each sound name.
|
|
282
341
|
*/
|
|
283
|
-
iterate_sounds(this: void, section: string,
|
|
342
|
+
iterate_sounds(this: void, section: string, max_count: u32, cb: (this: void, name: string) => void): void;
|
|
284
343
|
|
|
285
344
|
/**
|
|
286
345
|
* Iterate sounds from a sound collection with an owner object.
|
|
287
346
|
*
|
|
347
|
+
* @remarks
|
|
348
|
+
* `section` may contain a comma-separated list of base names. The callback receives each existing sound name found
|
|
349
|
+
* in `$game_sounds$`, including numbered variants from `0` up to `max_count - 1`.
|
|
350
|
+
*
|
|
288
351
|
* @param section - Sound collection section.
|
|
289
|
-
* @param
|
|
352
|
+
* @param max_count - Numbered suffixes to probe for each base name.
|
|
290
353
|
* @param object - Owner object.
|
|
291
|
-
* @param cb - Callback called
|
|
354
|
+
* @param cb - Callback called with each sound name.
|
|
292
355
|
*/
|
|
293
|
-
iterate_sounds(
|
|
356
|
+
iterate_sounds(
|
|
357
|
+
this: void,
|
|
358
|
+
section: string,
|
|
359
|
+
max_count: u32,
|
|
360
|
+
object: object,
|
|
361
|
+
cb: (this: void, name: string) => void
|
|
362
|
+
): void;
|
|
294
363
|
|
|
295
364
|
/**
|
|
296
365
|
* Sample low cover from a level vertex in a direction.
|
|
@@ -329,6 +398,9 @@ declare module "xray16" {
|
|
|
329
398
|
/**
|
|
330
399
|
* Change hint text for an object map spot.
|
|
331
400
|
*
|
|
401
|
+
* @remarks
|
|
402
|
+
* Does nothing when the object does not have a matching map spot.
|
|
403
|
+
*
|
|
332
404
|
* @param object_id - Target object id.
|
|
333
405
|
* @param spot_type - Spot type from map spot config.
|
|
334
406
|
* @param hint - New hint text.
|
|
@@ -406,6 +478,9 @@ declare module "xray16" {
|
|
|
406
478
|
/**
|
|
407
479
|
* Remove a conditional level callback.
|
|
408
480
|
*
|
|
481
|
+
* @remarks
|
|
482
|
+
* The callbacks must match the original registered pair.
|
|
483
|
+
*
|
|
409
484
|
* @param condition - Condition callback originally registered.
|
|
410
485
|
* @param action - Action callback originally registered.
|
|
411
486
|
*/
|
|
@@ -414,20 +489,21 @@ declare module "xray16" {
|
|
|
414
489
|
/**
|
|
415
490
|
* Remove an object-owned conditional level callback.
|
|
416
491
|
*
|
|
492
|
+
* @remarks
|
|
493
|
+
* The owner and callbacks must match the original registered pair.
|
|
494
|
+
*
|
|
417
495
|
* @param object - Owner object.
|
|
418
496
|
* @param condition - Condition callback originally registered.
|
|
419
497
|
* @param action - Action callback originally registered.
|
|
420
498
|
*/
|
|
421
|
-
remove_call(
|
|
422
|
-
this: void,
|
|
423
|
-
object: object,
|
|
424
|
-
condition: (this: void) => boolean,
|
|
425
|
-
action: (this: void) => void
|
|
426
|
-
): void;
|
|
499
|
+
remove_call(this: void, object: object, condition: (this: void) => boolean, action: (this: void) => void): void;
|
|
427
500
|
|
|
428
501
|
/**
|
|
429
502
|
* Remove named object methods registered as a level callback.
|
|
430
503
|
*
|
|
504
|
+
* @remarks
|
|
505
|
+
* The owner and method names must match the original registered pair.
|
|
506
|
+
*
|
|
431
507
|
* @param object - Owner object.
|
|
432
508
|
* @param condition - Condition method name.
|
|
433
509
|
* @param action - Action method name.
|
|
@@ -444,6 +520,9 @@ declare module "xray16" {
|
|
|
444
520
|
/**
|
|
445
521
|
* Stop a camera effector.
|
|
446
522
|
*
|
|
523
|
+
* @remarks
|
|
524
|
+
* Requires an actor. The binding removes the effector from `Actor().Cameras()`.
|
|
525
|
+
*
|
|
447
526
|
* @param id - Effector id.
|
|
448
527
|
*/
|
|
449
528
|
remove_cam_effector(this: void, id: i32): void;
|
|
@@ -451,6 +530,9 @@ declare module "xray16" {
|
|
|
451
530
|
/**
|
|
452
531
|
* Stop a complex effector.
|
|
453
532
|
*
|
|
533
|
+
* @remarks
|
|
534
|
+
* Requires an actor. The binding removes the effector from the current actor object.
|
|
535
|
+
*
|
|
454
536
|
* @param id - Effector id.
|
|
455
537
|
*/
|
|
456
538
|
remove_complex_effector(this: void, id: i32): void;
|
|
@@ -465,6 +547,9 @@ declare module "xray16" {
|
|
|
465
547
|
/**
|
|
466
548
|
* Stop a post-process effector.
|
|
467
549
|
*
|
|
550
|
+
* @remarks
|
|
551
|
+
* Requires an actor. Does nothing when no post-process effector exists for the id.
|
|
552
|
+
*
|
|
468
553
|
* @param id - Effector id.
|
|
469
554
|
*/
|
|
470
555
|
remove_pp_effector(this: void, id: i32): void;
|
|
@@ -472,6 +557,8 @@ declare module "xray16" {
|
|
|
472
557
|
/**
|
|
473
558
|
* Send a network packet through the level.
|
|
474
559
|
*
|
|
560
|
+
* @since OpenXRay 2014-12-27, c82669625
|
|
561
|
+
*
|
|
475
562
|
* @param packet - Packet to send.
|
|
476
563
|
* @param reliable - Whether the packet is reliable.
|
|
477
564
|
* @param sequential - Whether the packet is sequential.
|
|
@@ -490,6 +577,11 @@ declare module "xray16" {
|
|
|
490
577
|
/**
|
|
491
578
|
* Set active camera id.
|
|
492
579
|
*
|
|
580
|
+
* @since OpenXRay 2015-07-07, 6e703b4c
|
|
581
|
+
*
|
|
582
|
+
* @remarks
|
|
583
|
+
* Does nothing when the current view entity is not an actor or when the id is outside the actor camera range.
|
|
584
|
+
*
|
|
493
585
|
* @param id - Camera id.
|
|
494
586
|
*/
|
|
495
587
|
set_active_cam(this: void, id: u8): void;
|
|
@@ -497,6 +589,11 @@ declare module "xray16" {
|
|
|
497
589
|
/**
|
|
498
590
|
* Set active single-player difficulty.
|
|
499
591
|
*
|
|
592
|
+
* @remarks
|
|
593
|
+
* Updates the global difficulty and notifies the active single-player game state.
|
|
594
|
+
*
|
|
595
|
+
* @throws If the active game state is not single-player.
|
|
596
|
+
*
|
|
500
597
|
* @param difficulty - Difficulty id.
|
|
501
598
|
*/
|
|
502
599
|
set_game_difficulty(this: void, difficulty: unknown /* Enum ESingleGameDifficulty */): void;
|
|
@@ -504,6 +601,9 @@ declare module "xray16" {
|
|
|
504
601
|
/**
|
|
505
602
|
* Set a post-process effector factor.
|
|
506
603
|
*
|
|
604
|
+
* @remarks
|
|
605
|
+
* Requires an actor. Does nothing when no post-process effector exists for the id.
|
|
606
|
+
*
|
|
507
607
|
* @param id - Effector id.
|
|
508
608
|
* @param factor - Target factor.
|
|
509
609
|
* @param speed - Optional transition speed.
|
|
@@ -513,6 +613,9 @@ declare module "xray16" {
|
|
|
513
613
|
/**
|
|
514
614
|
* Set sound volume.
|
|
515
615
|
*
|
|
616
|
+
* @remarks
|
|
617
|
+
* The engine clamps the value to the `0..1` range.
|
|
618
|
+
*
|
|
516
619
|
* @param volume - Sound volume.
|
|
517
620
|
*/
|
|
518
621
|
set_snd_volume(this: void, volume: f32): void;
|
|
@@ -520,6 +623,9 @@ declare module "xray16" {
|
|
|
520
623
|
/**
|
|
521
624
|
* Set game time speed multiplier.
|
|
522
625
|
*
|
|
626
|
+
* @remarks
|
|
627
|
+
* Works only on the server and outside editor mode. Otherwise the binding returns without changing the time factor.
|
|
628
|
+
*
|
|
523
629
|
* @param factor - Time factor.
|
|
524
630
|
*/
|
|
525
631
|
set_time_factor(this: void, factor: f32): void;
|
|
@@ -527,6 +633,9 @@ declare module "xray16" {
|
|
|
527
633
|
/**
|
|
528
634
|
* Change active game weather.
|
|
529
635
|
*
|
|
636
|
+
* @remarks
|
|
637
|
+
* Does nothing in editor mode.
|
|
638
|
+
*
|
|
530
639
|
* @param weather_name - Name of weather config to apply.
|
|
531
640
|
* @param is_forced - Whether weather change should be forced.
|
|
532
641
|
*/
|
|
@@ -535,17 +644,28 @@ declare module "xray16" {
|
|
|
535
644
|
/**
|
|
536
645
|
* Start a weather effect by name.
|
|
537
646
|
*
|
|
647
|
+
* @remarks
|
|
648
|
+
* Returns `false` in editor mode.
|
|
649
|
+
*
|
|
538
650
|
* @param weather_fx_name - Weather effect config name.
|
|
539
651
|
* @returns Whether the effect started.
|
|
540
652
|
*/
|
|
541
653
|
set_weather_fx(this: void, weather_fx_name: string): boolean;
|
|
542
654
|
|
|
543
|
-
/**
|
|
655
|
+
/**
|
|
656
|
+
* Show HUD indicators.
|
|
657
|
+
*
|
|
658
|
+
* @remarks
|
|
659
|
+
* Clears the runtime god-mode flag set by `hide_indicators()` and `hide_indicators_safe()`.
|
|
660
|
+
*/
|
|
544
661
|
show_indicators(this: void): void;
|
|
545
662
|
|
|
546
663
|
/**
|
|
547
664
|
* Show or hide actor weapon.
|
|
548
665
|
*
|
|
666
|
+
* @remarks
|
|
667
|
+
* Does nothing while the actor exists and permanent god mode is enabled.
|
|
668
|
+
*
|
|
549
669
|
* @param is_visible - Whether weapon should be visible.
|
|
550
670
|
*/
|
|
551
671
|
show_weapon(this: void, is_visible: boolean): void;
|
|
@@ -553,11 +673,17 @@ declare module "xray16" {
|
|
|
553
673
|
/**
|
|
554
674
|
* Spawn an item on the level.
|
|
555
675
|
*
|
|
676
|
+
* @since OpenXRay 2015-01-18, 3ee7401d
|
|
677
|
+
*
|
|
678
|
+
* @remarks
|
|
679
|
+
* Uses the level spawn path, which is suitable for sections that are unsafe to create through `alife():create()`,
|
|
680
|
+
* such as bolts, phantoms, and ammo.
|
|
681
|
+
*
|
|
556
682
|
* @param section - Item section name.
|
|
557
683
|
* @param position - Spawn position.
|
|
558
684
|
* @param level_vertex_id - Target level vertex.
|
|
559
685
|
* @param parent_id - Parent object id, or `0xffff` for none.
|
|
560
|
-
* @param
|
|
686
|
+
* @param return_item - Engine spawn flag passed through to `Level().spawn_item`.
|
|
561
687
|
*/
|
|
562
688
|
spawn_item(
|
|
563
689
|
this: void,
|
|
@@ -565,7 +691,7 @@ declare module "xray16" {
|
|
|
565
691
|
position: vector,
|
|
566
692
|
level_vertex_id: u32,
|
|
567
693
|
parent_id: u16,
|
|
568
|
-
|
|
694
|
+
return_item: boolean
|
|
569
695
|
): void;
|
|
570
696
|
|
|
571
697
|
/**
|
|
@@ -578,34 +704,48 @@ declare module "xray16" {
|
|
|
578
704
|
/**
|
|
579
705
|
* Start or stop a menu dialog.
|
|
580
706
|
*
|
|
707
|
+
* @remarks
|
|
708
|
+
* Hides the dialog when it is already shown. Otherwise shows it and applies `should_hide_indicators`.
|
|
709
|
+
*
|
|
581
710
|
* @param dialog - Dialog window.
|
|
582
|
-
* @param
|
|
711
|
+
* @param should_hide_indicators - Whether showing the dialog should hide HUD indicators.
|
|
583
712
|
*/
|
|
584
|
-
start_stop_menu(this: void, dialog: CUIDialogWnd,
|
|
713
|
+
start_stop_menu(this: void, dialog: CUIDialogWnd, should_hide_indicators: boolean): void;
|
|
585
714
|
|
|
586
715
|
/**
|
|
587
716
|
* Start a weather effect from a specific time.
|
|
588
717
|
*
|
|
718
|
+
* @remarks
|
|
719
|
+
* Returns `false` in editor mode.
|
|
720
|
+
*
|
|
589
721
|
* @param weather_fx_name - Weather effect config name.
|
|
590
722
|
* @param time - Start time.
|
|
591
723
|
* @returns Whether the effect started.
|
|
592
724
|
*/
|
|
593
725
|
start_weather_fx_from_time(this: void, weather_fx_name: string, time: f32): boolean;
|
|
594
726
|
|
|
595
|
-
/**
|
|
727
|
+
/**
|
|
728
|
+
* Stop the active weather effect.
|
|
729
|
+
*/
|
|
596
730
|
stop_weather_fx(this: void): void;
|
|
597
731
|
|
|
598
732
|
/**
|
|
599
733
|
* Get nearest level vertex for a position.
|
|
600
734
|
*
|
|
735
|
+
* @remarks
|
|
736
|
+
* The binding preserves original Lua behavior for invalid vertices and returns `4294967296` instead of `u32(-1)`.
|
|
737
|
+
*
|
|
601
738
|
* @param position - World position.
|
|
602
739
|
* @returns Level vertex id.
|
|
603
740
|
*/
|
|
604
|
-
vertex_id(this: void, position: vector):
|
|
741
|
+
vertex_id(this: void, position: vector): u64;
|
|
605
742
|
|
|
606
743
|
/**
|
|
607
744
|
* Move from a level vertex in a direction.
|
|
608
745
|
*
|
|
746
|
+
* @remarks
|
|
747
|
+
* Returns the original vertex when the engine cannot find a valid vertex in the requested direction.
|
|
748
|
+
*
|
|
609
749
|
* @param vertex_id - Start level vertex id.
|
|
610
750
|
* @param direction - Direction to move.
|
|
611
751
|
* @param distance - Distance to move.
|
|
@@ -624,12 +764,15 @@ declare module "xray16" {
|
|
|
624
764
|
/**
|
|
625
765
|
* Cast a ray through the level collision world.
|
|
626
766
|
*
|
|
767
|
+
* @remarks
|
|
768
|
+
* `result` is updated only when this returns `true`.
|
|
769
|
+
*
|
|
627
770
|
* @param position - Ray origin.
|
|
628
771
|
* @param direction - Ray direction.
|
|
629
772
|
* @param range - Ray range.
|
|
630
773
|
* @param target - Ray query target flags.
|
|
631
774
|
* @param result - Ray query result placeholder.
|
|
632
|
-
* @param ignore_object - Object ignored by the query
|
|
775
|
+
* @param ignore_object - Object ignored by the query, or `null`.
|
|
633
776
|
* @returns Whether the ray hit anything.
|
|
634
777
|
*/
|
|
635
778
|
ray_pick(
|
|
@@ -639,7 +782,7 @@ declare module "xray16" {
|
|
|
639
782
|
range: f32,
|
|
640
783
|
target: unknown,
|
|
641
784
|
result: unknown,
|
|
642
|
-
ignore_object: game_object
|
|
785
|
+
ignore_object: game_object | null
|
|
643
786
|
): boolean;
|
|
644
787
|
}
|
|
645
788
|
|
|
@@ -1,64 +1,90 @@
|
|
|
1
1
|
declare module "xray16" {
|
|
2
2
|
/**
|
|
3
|
-
* Base for
|
|
4
|
-
*
|
|
3
|
+
* Base class for LuaBind-backed engine objects.
|
|
4
|
+
*
|
|
5
|
+
* Engine classes expose `__name` through the TypeScriptToLua LuaBind plugin so subclasses can be emitted as LuaBind
|
|
6
|
+
* classes instead of regular Lua tables.
|
|
5
7
|
*
|
|
6
8
|
* @source luabind
|
|
7
9
|
* @group xr_luabind
|
|
8
10
|
*/
|
|
9
11
|
export class EngineBinding {
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* LuaBind class constructor name.
|
|
12
14
|
*/
|
|
13
15
|
public static readonly __name: string;
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
18
|
+
* LuaBind instance constructor name.
|
|
17
19
|
*/
|
|
18
20
|
public readonly __name: string;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
/**
|
|
24
|
+
* Static members owned by `EngineBinding` and excluded from exported engine enum values.
|
|
25
|
+
*
|
|
22
26
|
* @group xr_luabind
|
|
23
27
|
*/
|
|
24
28
|
type TEngineBindingStaticMethods = keyof typeof EngineBinding;
|
|
25
29
|
|
|
26
30
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
+
* Mark a TypeScript class for LuaBind class transformation.
|
|
32
|
+
*
|
|
33
|
+
* Use this on classes that extend engine bindings and need LuaBind-compatible constructors, inheritance, or virtual
|
|
34
|
+
* methods in emitted Lua.
|
|
31
35
|
*
|
|
32
36
|
* @group xr_luabind
|
|
33
37
|
*
|
|
34
|
-
* @returns Class decorator
|
|
38
|
+
* @returns Class decorator.
|
|
35
39
|
*/
|
|
36
40
|
export function LuabindClass(): ClassDecorator;
|
|
37
41
|
|
|
38
42
|
/**
|
|
43
|
+
* Runtime metadata for a LuaBind class.
|
|
44
|
+
*
|
|
39
45
|
* @source C++ class class_info_data
|
|
40
46
|
* @customConstructor class_info_data
|
|
41
47
|
* @group xr_luabind
|
|
42
48
|
*/
|
|
43
49
|
export class class_info_data extends EngineBinding {
|
|
50
|
+
/**
|
|
51
|
+
* Methods exposed by the LuaBind class.
|
|
52
|
+
*/
|
|
44
53
|
public readonly methods: LuaTable<string, (...args: Array<unknown>) => unknown>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Attribute names exposed by the LuaBind class.
|
|
57
|
+
*/
|
|
45
58
|
public readonly attributes: LuaTable<number, string>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* LuaBind class name.
|
|
62
|
+
*/
|
|
46
63
|
public readonly name: string;
|
|
47
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Engine-created LuaBind metadata.
|
|
67
|
+
*/
|
|
48
68
|
private constructor();
|
|
49
69
|
}
|
|
50
70
|
|
|
51
71
|
/**
|
|
72
|
+
* Get names of LuaBind classes registered in a Lua state.
|
|
73
|
+
*
|
|
52
74
|
* @group xr_luabind
|
|
53
75
|
*
|
|
54
|
-
* @param lua_state
|
|
76
|
+
* @param lua_state - Lua state to inspect.
|
|
77
|
+
* @returns Registered class names.
|
|
55
78
|
*/
|
|
56
79
|
export function class_names(this: void, lua_state: unknown /* Lua_State*/): LuaTable<number, string>;
|
|
57
80
|
|
|
58
81
|
/**
|
|
82
|
+
* Get LuaBind metadata for an object or class.
|
|
83
|
+
*
|
|
59
84
|
* @group xr_luabind
|
|
60
85
|
*
|
|
61
|
-
* @param target
|
|
86
|
+
* @param target - Object or class to inspect.
|
|
87
|
+
* @returns LuaBind class metadata.
|
|
62
88
|
*/
|
|
63
89
|
export function class_info(this: void, target: unknown): class_info_data;
|
|
64
90
|
}
|