xray16 1.3.4 → 1.4.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/LICENSE +21 -21
- package/README.md +112 -106
- package/package.json +45 -42
- package/plugins/built_at_info.d.ts +1 -1
- package/plugins/from_cast_utils.d.ts +1 -1
- package/plugins/global_declarations_transform.d.ts +1 -1
- package/plugins/inject_file_meta.d.ts +1 -1
- package/plugins/inject_tracy_zones.d.ts +1 -1
- package/plugins/inject_tracy_zones.js +2 -2
- package/plugins/strip_lua_logger.d.ts +1 -1
- package/plugins/strip_lua_logger.js +1 -1
- package/plugins/transform_luabind_class/plugin.d.ts +1 -1
- package/plugins/transform_luabind_class/transformation/class_declaration.d.ts +3 -3
- package/plugins/transform_luabind_class/transformation/decorators.d.ts +5 -2
- package/plugins/transform_luabind_class/transformation/decorators.js +3 -0
- package/plugins/transform_luabind_class/transformation/members/accessors.d.ts +1 -1
- package/plugins/transform_luabind_class/transformation/members/constructor.d.ts +2 -2
- package/plugins/transform_luabind_class/transformation/members/constructor.js +2 -2
- package/plugins/transform_luabind_class/transformation/members/fields.d.ts +5 -2
- package/plugins/transform_luabind_class/transformation/members/fields.js +5 -2
- package/plugins/transform_luabind_class/transformation/members/method.d.ts +6 -3
- package/plugins/transform_luabind_class/transformation/members/method.js +4 -1
- package/plugins/transform_luabind_class/transformation/new.d.ts +7 -3
- package/plugins/transform_luabind_class/transformation/new.js +5 -1
- package/plugins/transform_luabind_class/transformation/setup.d.ts +9 -3
- package/plugins/transform_luabind_class/transformation/setup.js +22 -6
- package/plugins/transform_luabind_class/transformation/super.d.ts +19 -3
- package/plugins/transform_luabind_class/transformation/super.js +17 -1
- package/plugins/transform_luabind_class/transformation/utils.d.ts +27 -4
- package/plugins/transform_luabind_class/transformation/utils.js +25 -2
- package/plugins/utils/ast.d.ts +1 -1
- package/plugins/utils/diagnostics.d.ts +9 -5
- package/plugins/utils/diagnostics.js +5 -1
- package/plugins/utils/tracy.d.ts +1 -1
- package/types/index.d.ts +55 -55
- package/types/xr_ai/xr_action.d.ts +510 -510
- package/types/xr_ai/xr_alife.d.ts +566 -566
- package/types/xr_ai/xr_enemy_evaluation.d.ts +41 -41
- package/types/xr_ai/xr_goap.d.ts +669 -668
- package/types/xr_ai/xr_graph.d.ts +47 -47
- package/types/xr_ai/xr_memory.d.ts +148 -148
- package/types/xr_lib/xr_animation.d.ts +81 -81
- package/types/xr_lib/xr_bitwise.d.ts +32 -21
- package/types/xr_lib/xr_color.d.ts +45 -40
- package/types/xr_lib/xr_debug.d.ts +83 -77
- package/types/xr_lib/xr_dialog.d.ts +40 -40
- package/types/xr_lib/xr_flags.d.ts +529 -148
- package/types/xr_lib/xr_fs.d.ts +149 -148
- package/types/xr_lib/xr_game.d.ts +261 -158
- package/types/xr_lib/xr_hit.d.ts +41 -41
- package/types/xr_lib/xr_ini.d.ts +415 -188
- package/types/xr_lib/xr_level.d.ts +652 -225
- package/types/xr_lib/xr_luabind.d.ts +64 -59
- package/types/xr_lib/xr_map.d.ts +61 -61
- package/types/xr_lib/xr_math.d.ts +815 -233
- package/types/xr_lib/xr_multiplayer.d.ts +351 -351
- package/types/xr_lib/xr_profile.d.ts +192 -160
- package/types/xr_lib/xr_properties.d.ts +455 -166
- package/types/xr_lib/xr_relation.d.ts +84 -84
- package/types/xr_lib/xr_render.d.ts +71 -69
- package/types/xr_lib/xr_save.d.ts +727 -223
- package/types/xr_lib/xr_sound.d.ts +151 -151
- package/types/xr_lib/xr_stats.ts +20 -20
- package/types/xr_lib/xr_task.d.ts +111 -111
- package/types/xr_lib/xr_time.d.ts +166 -61
- package/types/xr_lib/xr_type.d.ts +75 -75
- package/types/xr_object/client/xr_anomaly.d.ts +50 -50
- package/types/xr_object/client/xr_artefact.d.ts +98 -98
- package/types/xr_object/client/xr_client_object.d.ts +76 -76
- package/types/xr_object/client/xr_creature.d.ts +164 -164
- package/types/xr_object/client/xr_item.d.ts +264 -264
- package/types/xr_object/client/xr_level.d.ts +285 -285
- package/types/xr_object/client/xr_physic.d.ts +214 -214
- package/types/xr_object/client/xr_zone.d.ts +47 -47
- package/types/xr_object/script/xr_script_interface.d.ts +584 -584
- package/types/xr_object/script/xr_script_object.d.ts +2408 -1390
- package/types/xr_object/script/xr_script_trade.d.ts +41 -26
- package/types/xr_object/server/xr_server_object.d.ts +794 -792
- package/types/xr_ui/xr_ui_asset.d.ts +129 -123
- package/types/xr_ui/xr_ui_core.d.ts +106 -97
- package/types/xr_ui/xr_ui_event.d.ts +383 -381
- package/types/xr_ui/xr_ui_interface.d.ts +901 -903
- package/types/xr_ui/xr_ui_menu.d.ts +142 -142
- package/types/xrf_plugin.d.ts +59 -51
|
@@ -1,225 +1,652 @@
|
|
|
1
|
-
declare module "xray16" {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* @
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* @
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param
|
|
128
|
-
* @
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
*
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
1
|
+
declare module "xray16" {
|
|
2
|
+
/**
|
|
3
|
+
* Global helpers for the currently loaded level.
|
|
4
|
+
*
|
|
5
|
+
* This namespace covers object lookup, time/weather control, navigation queries, map spots, and effectors.
|
|
6
|
+
*
|
|
7
|
+
* @source namespace level
|
|
8
|
+
* @group xr_level
|
|
9
|
+
*/
|
|
10
|
+
export interface IXR_level {
|
|
11
|
+
/**
|
|
12
|
+
* Register a conditional level callback.
|
|
13
|
+
*
|
|
14
|
+
* @param condition - Callback polled by the engine.
|
|
15
|
+
* @param action - Callback called when the condition is satisfied.
|
|
16
|
+
*/
|
|
17
|
+
add_call(this: void, condition: (this: void) => boolean, action: (this: void) => boolean): void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Register a conditional level callback owned by an object.
|
|
21
|
+
*
|
|
22
|
+
* @param object - Owner object used for later removal.
|
|
23
|
+
* @param condition - Callback polled by the engine.
|
|
24
|
+
* @param action - Callback called when the condition is satisfied.
|
|
25
|
+
*/
|
|
26
|
+
add_call(
|
|
27
|
+
this: void,
|
|
28
|
+
object: object,
|
|
29
|
+
condition: (this: void) => boolean,
|
|
30
|
+
action: (this: void) => boolean
|
|
31
|
+
): void;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Register named object methods as a conditional level callback.
|
|
35
|
+
*
|
|
36
|
+
* @param object - Owner object used for callback lookup and removal.
|
|
37
|
+
* @param condition - Method name used as condition callback.
|
|
38
|
+
* @param action - Method name called when the condition is satisfied.
|
|
39
|
+
*/
|
|
40
|
+
add_call(this: void, object: object, condition: string, action: string): void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Start a camera effector.
|
|
44
|
+
*
|
|
45
|
+
* @param effect - Camera effector animation file.
|
|
46
|
+
* @param id - Effector id used for replacement and removal.
|
|
47
|
+
* @param is_cyclic - Whether the effector loops.
|
|
48
|
+
* @param callback - Lua callback name called when the effector finishes.
|
|
49
|
+
*/
|
|
50
|
+
add_cam_effector(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Start a camera effector with custom field of view.
|
|
54
|
+
*
|
|
55
|
+
* @param effect - Camera effector animation file.
|
|
56
|
+
* @param id - Effector id used for replacement and removal.
|
|
57
|
+
* @param is_cyclic - Whether the effector loops.
|
|
58
|
+
* @param callback - Lua callback name called when the effector finishes.
|
|
59
|
+
* @param camera_fov - Field of view for the effector.
|
|
60
|
+
*/
|
|
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;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Start a named complex effector.
|
|
72
|
+
*
|
|
73
|
+
* @param section - Effector section name.
|
|
74
|
+
* @param id - Effector id used for replacement and removal.
|
|
75
|
+
*/
|
|
76
|
+
add_complex_effector(this: void, section: string, id: i32): void;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Add a dialog window to the render list.
|
|
80
|
+
*
|
|
81
|
+
* @param window - Dialog window to render.
|
|
82
|
+
*/
|
|
83
|
+
add_dialog_to_render(this: void, window: CUIDialogWnd): void;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Start a post-process effector.
|
|
87
|
+
*
|
|
88
|
+
* @param file_name - Post-process effector file.
|
|
89
|
+
* @param id - Effector id used for replacement and removal.
|
|
90
|
+
* @param is_cyclic - Whether the effector loops.
|
|
91
|
+
*/
|
|
92
|
+
add_pp_effector(this: void, file_name: string, id: i32, is_cyclic: boolean): void;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Move game time forward.
|
|
96
|
+
*
|
|
97
|
+
* @param days - Days to add.
|
|
98
|
+
* @param hours - Hours to add.
|
|
99
|
+
* @param minutes - Minutes to add.
|
|
100
|
+
*/
|
|
101
|
+
change_game_time(this: void, days: u32, hours: u32, minutes: u32): void;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Validate a game object pointer in the engine.
|
|
105
|
+
*
|
|
106
|
+
* @param object - Object to check.
|
|
107
|
+
*/
|
|
108
|
+
check_object(this: void, object: game_object): void;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Get the level client spawn manager.
|
|
112
|
+
*
|
|
113
|
+
* @returns Client spawn manager.
|
|
114
|
+
*/
|
|
115
|
+
client_spawn_manager(this: void): client_spawn_manager;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Get actor object used by debug helpers.
|
|
119
|
+
*
|
|
120
|
+
* @returns Actor game object.
|
|
121
|
+
*/
|
|
122
|
+
debug_actor(this: void): game_object;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Find an object by debug name.
|
|
126
|
+
*
|
|
127
|
+
* @param name - Object name.
|
|
128
|
+
* @returns Matching game object.
|
|
129
|
+
*/
|
|
130
|
+
debug_object(this: void, name: string): game_object;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Disable player input.
|
|
134
|
+
*/
|
|
135
|
+
disable_input(this: void): void;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Enable player input.
|
|
139
|
+
*/
|
|
140
|
+
enable_input(this: void): void;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Get the active environment object.
|
|
144
|
+
*
|
|
145
|
+
* @returns Engine environment object.
|
|
146
|
+
*/
|
|
147
|
+
environment(this: void): unknown /* XR_CEnvironment */;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get current game state id.
|
|
151
|
+
*
|
|
152
|
+
* @returns Game id bitmask.
|
|
153
|
+
*/
|
|
154
|
+
game_id(this: void): TXR_EGameID;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get active camera id.
|
|
158
|
+
*
|
|
159
|
+
* @returns Camera id.
|
|
160
|
+
*/
|
|
161
|
+
get_active_cam(this: void): u8;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Get the level bounding box.
|
|
165
|
+
*
|
|
166
|
+
* @returns Level bounds.
|
|
167
|
+
*/
|
|
168
|
+
get_bounding_volume(this: void): Fbox;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Get active single-player difficulty.
|
|
172
|
+
*
|
|
173
|
+
* @returns Difficulty id.
|
|
174
|
+
*/
|
|
175
|
+
get_game_difficulty(this: void): TXR_game_difficulty;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Get sound volume.
|
|
179
|
+
*
|
|
180
|
+
* @returns Sound volume.
|
|
181
|
+
*/
|
|
182
|
+
get_snd_volume(this: void): f32;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Get distance to the object or surface under the crosshair.
|
|
186
|
+
*
|
|
187
|
+
* @returns Target distance.
|
|
188
|
+
*/
|
|
189
|
+
get_target_dist(this: void): f32;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Get targeted model element under the crosshair.
|
|
193
|
+
*
|
|
194
|
+
* @returns Target element id.
|
|
195
|
+
*/
|
|
196
|
+
get_target_element(this: void): u32;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get the object under the crosshair.
|
|
200
|
+
*
|
|
201
|
+
* @returns Target object, or `null` when nothing is targeted.
|
|
202
|
+
*/
|
|
203
|
+
get_target_obj(this: void): game_object | null;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Get current game day count.
|
|
207
|
+
*
|
|
208
|
+
* @returns Current day count.
|
|
209
|
+
*/
|
|
210
|
+
get_time_days(this: void): u32;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Get game time speed multiplier.
|
|
214
|
+
*
|
|
215
|
+
* @returns Time factor.
|
|
216
|
+
*/
|
|
217
|
+
get_time_factor(this: void): f32;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Get current game hour.
|
|
221
|
+
*
|
|
222
|
+
* @returns Hour of day.
|
|
223
|
+
*/
|
|
224
|
+
get_time_hours(this: void): u32;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Get current game minute.
|
|
228
|
+
*
|
|
229
|
+
* @returns Minute of hour.
|
|
230
|
+
*/
|
|
231
|
+
get_time_minutes(this: void): u32;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get current weather cycle name.
|
|
235
|
+
*
|
|
236
|
+
* @returns Weather name.
|
|
237
|
+
*/
|
|
238
|
+
get_weather(this: void): string;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Get active weather effect time.
|
|
242
|
+
*
|
|
243
|
+
* @returns Weather effect time.
|
|
244
|
+
*/
|
|
245
|
+
get_wfx_time(this: void): f32;
|
|
246
|
+
|
|
247
|
+
/** Hide HUD indicators. */
|
|
248
|
+
hide_indicators(this: void): void;
|
|
249
|
+
|
|
250
|
+
/** Hide HUD indicators if the HUD is available. */
|
|
251
|
+
hide_indicators_safe(this: void): void;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Sample high cover from a level vertex in a direction.
|
|
255
|
+
*
|
|
256
|
+
* @param vertex_id - Level vertex id.
|
|
257
|
+
* @param direction - Direction to sample.
|
|
258
|
+
* @returns Cover value.
|
|
259
|
+
*/
|
|
260
|
+
high_cover_in_direction(this: void, vertex_id: u32, direction: vector): f32;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Check whether a weather effect is playing.
|
|
264
|
+
*
|
|
265
|
+
* @returns Whether a weather effect is active.
|
|
266
|
+
*/
|
|
267
|
+
is_wfx_playing(this: void): boolean;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Iterate objects currently online on the level.
|
|
271
|
+
*
|
|
272
|
+
* @param cb - Callback called for each online object.
|
|
273
|
+
*/
|
|
274
|
+
iterate_online_objects(this: void, cb: (this: void, object: game_object) => void | boolean): void;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Iterate sounds from a sound collection.
|
|
278
|
+
*
|
|
279
|
+
* @param section - Sound collection section.
|
|
280
|
+
* @param type - Sound type filter.
|
|
281
|
+
* @param cb - Callback called for each sound.
|
|
282
|
+
*/
|
|
283
|
+
iterate_sounds(this: void, section: string, type: u32, cb: (this: void) => void): void;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Iterate sounds from a sound collection with an owner object.
|
|
287
|
+
*
|
|
288
|
+
* @param section - Sound collection section.
|
|
289
|
+
* @param type - Sound type filter.
|
|
290
|
+
* @param object - Owner object.
|
|
291
|
+
* @param cb - Callback called for each sound.
|
|
292
|
+
*/
|
|
293
|
+
iterate_sounds(this: void, section: string, type: u32, object: object, cb: (this: void) => void): void;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Sample low cover from a level vertex in a direction.
|
|
297
|
+
*
|
|
298
|
+
* @param vertex_id - Level vertex id.
|
|
299
|
+
* @param direction - Direction to sample.
|
|
300
|
+
* @returns Cover value.
|
|
301
|
+
*/
|
|
302
|
+
low_cover_in_direction(this: void, vertex_id: u32, direction: vector): f32;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Get the main UI input receiver.
|
|
306
|
+
*
|
|
307
|
+
* @returns Active dialog window.
|
|
308
|
+
*/
|
|
309
|
+
main_input_receiver(this: void): CUIDialogWnd;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Add a PDA map spot for an object.
|
|
313
|
+
*
|
|
314
|
+
* @param object_id - Target object id.
|
|
315
|
+
* @param spot_type - Spot type from map spot config.
|
|
316
|
+
* @param hint - Spot hint text.
|
|
317
|
+
*/
|
|
318
|
+
map_add_object_spot(this: void, object_id: u16, spot_type: string, hint: string): void;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Add a serialized PDA map spot for an object.
|
|
322
|
+
*
|
|
323
|
+
* @param object_id - Target object id.
|
|
324
|
+
* @param spot_type - Spot type from map spot config.
|
|
325
|
+
* @param hint - Spot hint text.
|
|
326
|
+
*/
|
|
327
|
+
map_add_object_spot_ser(this: void, object_id: u16, spot_type: string, hint: string): void;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Change hint text for an object map spot.
|
|
331
|
+
*
|
|
332
|
+
* @param object_id - Target object id.
|
|
333
|
+
* @param spot_type - Spot type from map spot config.
|
|
334
|
+
* @param hint - New hint text.
|
|
335
|
+
*/
|
|
336
|
+
map_change_spot_hint(this: void, object_id: u16, spot_type: string, hint: string): void;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Check if an object has a map spot registered with provided selector.
|
|
340
|
+
*
|
|
341
|
+
* @param object_id - Game object id to check.
|
|
342
|
+
* @param spot_type - Map spot type.
|
|
343
|
+
* @returns Non-zero count when the spot exists.
|
|
344
|
+
*/
|
|
345
|
+
map_has_object_spot(this: void, object_id: u16, spot_type: string): u16;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Remove an object map spot if it exists.
|
|
349
|
+
*
|
|
350
|
+
* @param object_id - Game object id to update.
|
|
351
|
+
* @param spot_type - Map spot type.
|
|
352
|
+
*/
|
|
353
|
+
map_remove_object_spot(this: void, object_id: u16, spot_type: string): void;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Get current level name.
|
|
357
|
+
*
|
|
358
|
+
* @returns Level name.
|
|
359
|
+
*/
|
|
360
|
+
name<T extends string = string>(this: void): T;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Find an online object by id.
|
|
364
|
+
*
|
|
365
|
+
* @param object_id - Game object id.
|
|
366
|
+
* @returns Matching object, or `null` when it is not online.
|
|
367
|
+
*/
|
|
368
|
+
object_by_id(this: void, object_id: u16): game_object | null;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Check whether a patrol path exists on this level.
|
|
372
|
+
*
|
|
373
|
+
* @param path_name - Patrol path name.
|
|
374
|
+
* @returns Whether the patrol path exists.
|
|
375
|
+
*/
|
|
376
|
+
patrol_path_exists(this: void, path_name: string): boolean;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Get the level physics world.
|
|
380
|
+
*
|
|
381
|
+
* @returns Physics world object.
|
|
382
|
+
*/
|
|
383
|
+
physics_world(this: void): physics_world;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Preload a sound resource.
|
|
387
|
+
*
|
|
388
|
+
* @param sound - Sound resource name.
|
|
389
|
+
*/
|
|
390
|
+
prefetch_sound(this: void, sound: string): void;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Check whether a game level is loaded.
|
|
394
|
+
*
|
|
395
|
+
* @returns Whether a level is present.
|
|
396
|
+
*/
|
|
397
|
+
present(this: void): boolean;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Get current rain intensity.
|
|
401
|
+
*
|
|
402
|
+
* @returns Rain intensity, or `0` when no rain is active.
|
|
403
|
+
*/
|
|
404
|
+
rain_factor(this: void): f32;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Remove a conditional level callback.
|
|
408
|
+
*
|
|
409
|
+
* @param condition - Condition callback originally registered.
|
|
410
|
+
* @param action - Action callback originally registered.
|
|
411
|
+
*/
|
|
412
|
+
remove_call(this: void, condition: (this: void) => boolean, action: (this: void) => void): void;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Remove an object-owned conditional level callback.
|
|
416
|
+
*
|
|
417
|
+
* @param object - Owner object.
|
|
418
|
+
* @param condition - Condition callback originally registered.
|
|
419
|
+
* @param action - Action callback originally registered.
|
|
420
|
+
*/
|
|
421
|
+
remove_call(
|
|
422
|
+
this: void,
|
|
423
|
+
object: object,
|
|
424
|
+
condition: (this: void) => boolean,
|
|
425
|
+
action: (this: void) => void
|
|
426
|
+
): void;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Remove named object methods registered as a level callback.
|
|
430
|
+
*
|
|
431
|
+
* @param object - Owner object.
|
|
432
|
+
* @param condition - Condition method name.
|
|
433
|
+
* @param action - Action method name.
|
|
434
|
+
*/
|
|
435
|
+
remove_call(this: void, object: object, condition: string, action: string): void;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Remove all registered level callbacks for an object.
|
|
439
|
+
*
|
|
440
|
+
* @param object - Owner object.
|
|
441
|
+
*/
|
|
442
|
+
remove_calls_for_object(this: void, object: object): void;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Stop a camera effector.
|
|
446
|
+
*
|
|
447
|
+
* @param id - Effector id.
|
|
448
|
+
*/
|
|
449
|
+
remove_cam_effector(this: void, id: i32): void;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Stop a complex effector.
|
|
453
|
+
*
|
|
454
|
+
* @param id - Effector id.
|
|
455
|
+
*/
|
|
456
|
+
remove_complex_effector(this: void, id: i32): void;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Remove a dialog window from the render list.
|
|
460
|
+
*
|
|
461
|
+
* @param window - Dialog window to stop rendering.
|
|
462
|
+
*/
|
|
463
|
+
remove_dialog_to_render(this: void, window: CUIDialogWnd): void;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Stop a post-process effector.
|
|
467
|
+
*
|
|
468
|
+
* @param id - Effector id.
|
|
469
|
+
*/
|
|
470
|
+
remove_pp_effector(this: void, id: i32): void;
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Send a network packet through the level.
|
|
474
|
+
*
|
|
475
|
+
* @param packet - Packet to send.
|
|
476
|
+
* @param reliable - Whether the packet is reliable.
|
|
477
|
+
* @param sequential - Whether the packet is sequential.
|
|
478
|
+
* @param high_priority - Whether to send with high priority.
|
|
479
|
+
* @param send_immediately - Whether to flush immediately.
|
|
480
|
+
*/
|
|
481
|
+
send(
|
|
482
|
+
this: void,
|
|
483
|
+
packet: net_packet,
|
|
484
|
+
reliable: boolean,
|
|
485
|
+
sequential: boolean,
|
|
486
|
+
high_priority: boolean,
|
|
487
|
+
send_immediately: boolean
|
|
488
|
+
): void;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Set active camera id.
|
|
492
|
+
*
|
|
493
|
+
* @param id - Camera id.
|
|
494
|
+
*/
|
|
495
|
+
set_active_cam(this: void, id: u8): void;
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Set active single-player difficulty.
|
|
499
|
+
*
|
|
500
|
+
* @param difficulty - Difficulty id.
|
|
501
|
+
*/
|
|
502
|
+
set_game_difficulty(this: void, difficulty: unknown /* Enum ESingleGameDifficulty */): void;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Set a post-process effector factor.
|
|
506
|
+
*
|
|
507
|
+
* @param id - Effector id.
|
|
508
|
+
* @param factor - Target factor.
|
|
509
|
+
* @param speed - Optional transition speed.
|
|
510
|
+
*/
|
|
511
|
+
set_pp_effector_factor(this: void, id: i32, factor: f32, speed?: f32): void;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Set sound volume.
|
|
515
|
+
*
|
|
516
|
+
* @param volume - Sound volume.
|
|
517
|
+
*/
|
|
518
|
+
set_snd_volume(this: void, volume: f32): void;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Set game time speed multiplier.
|
|
522
|
+
*
|
|
523
|
+
* @param factor - Time factor.
|
|
524
|
+
*/
|
|
525
|
+
set_time_factor(this: void, factor: f32): void;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Change active game weather.
|
|
529
|
+
*
|
|
530
|
+
* @param weather_name - Name of weather config to apply.
|
|
531
|
+
* @param is_forced - Whether weather change should be forced.
|
|
532
|
+
*/
|
|
533
|
+
set_weather(this: void, weather_name: string, is_forced: boolean): void;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Start a weather effect by name.
|
|
537
|
+
*
|
|
538
|
+
* @param weather_fx_name - Weather effect config name.
|
|
539
|
+
* @returns Whether the effect started.
|
|
540
|
+
*/
|
|
541
|
+
set_weather_fx(this: void, weather_fx_name: string): boolean;
|
|
542
|
+
|
|
543
|
+
/** Show HUD indicators. */
|
|
544
|
+
show_indicators(this: void): void;
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Show or hide actor weapon.
|
|
548
|
+
*
|
|
549
|
+
* @param is_visible - Whether weapon should be visible.
|
|
550
|
+
*/
|
|
551
|
+
show_weapon(this: void, is_visible: boolean): void;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Spawn an item on the level.
|
|
555
|
+
*
|
|
556
|
+
* @param section - Item section name.
|
|
557
|
+
* @param position - Spawn position.
|
|
558
|
+
* @param level_vertex_id - Target level vertex.
|
|
559
|
+
* @param parent_id - Parent object id, or `0xffff` for none.
|
|
560
|
+
* @param use_ai_locations - Whether to use AI locations.
|
|
561
|
+
*/
|
|
562
|
+
spawn_item(
|
|
563
|
+
this: void,
|
|
564
|
+
section: string,
|
|
565
|
+
position: vector,
|
|
566
|
+
level_vertex_id: u32,
|
|
567
|
+
parent_id: u16,
|
|
568
|
+
use_ai_locations: boolean
|
|
569
|
+
): void;
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Spawn a phantom at a position.
|
|
573
|
+
*
|
|
574
|
+
* @param position - Spawn position.
|
|
575
|
+
*/
|
|
576
|
+
spawn_phantom(this: void, position: vector): void;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Start or stop a menu dialog.
|
|
580
|
+
*
|
|
581
|
+
* @param dialog - Dialog window.
|
|
582
|
+
* @param is_active - Whether the dialog is active.
|
|
583
|
+
*/
|
|
584
|
+
start_stop_menu(this: void, dialog: CUIDialogWnd, is_active: boolean): void;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Start a weather effect from a specific time.
|
|
588
|
+
*
|
|
589
|
+
* @param weather_fx_name - Weather effect config name.
|
|
590
|
+
* @param time - Start time.
|
|
591
|
+
* @returns Whether the effect started.
|
|
592
|
+
*/
|
|
593
|
+
start_weather_fx_from_time(this: void, weather_fx_name: string, time: f32): boolean;
|
|
594
|
+
|
|
595
|
+
/** Stop the active weather effect. */
|
|
596
|
+
stop_weather_fx(this: void): void;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Get nearest level vertex for a position.
|
|
600
|
+
*
|
|
601
|
+
* @param position - World position.
|
|
602
|
+
* @returns Level vertex id.
|
|
603
|
+
*/
|
|
604
|
+
vertex_id(this: void, position: vector): u32;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Move from a level vertex in a direction.
|
|
608
|
+
*
|
|
609
|
+
* @param vertex_id - Start level vertex id.
|
|
610
|
+
* @param direction - Direction to move.
|
|
611
|
+
* @param distance - Distance to move.
|
|
612
|
+
* @returns Result level vertex id.
|
|
613
|
+
*/
|
|
614
|
+
vertex_in_direction(this: void, vertex_id: u32, direction: vector, distance: f32): u32;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Get world position of a level vertex.
|
|
618
|
+
*
|
|
619
|
+
* @param id - Level vertex id.
|
|
620
|
+
* @returns Vertex position.
|
|
621
|
+
*/
|
|
622
|
+
vertex_position(this: void, id: u32): vector;
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Cast a ray through the level collision world.
|
|
626
|
+
*
|
|
627
|
+
* @param position - Ray origin.
|
|
628
|
+
* @param direction - Ray direction.
|
|
629
|
+
* @param range - Ray range.
|
|
630
|
+
* @param target - Ray query target flags.
|
|
631
|
+
* @param result - Ray query result placeholder.
|
|
632
|
+
* @param ignore_object - Object ignored by the query.
|
|
633
|
+
* @returns Whether the ray hit anything.
|
|
634
|
+
*/
|
|
635
|
+
ray_pick(
|
|
636
|
+
this: void,
|
|
637
|
+
position: vector,
|
|
638
|
+
direction: vector,
|
|
639
|
+
range: f32,
|
|
640
|
+
target: unknown,
|
|
641
|
+
result: unknown,
|
|
642
|
+
ignore_object: game_object
|
|
643
|
+
): boolean;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Global engine `level` namespace.
|
|
648
|
+
*
|
|
649
|
+
* @group xr_level
|
|
650
|
+
*/
|
|
651
|
+
export const level: IXR_level;
|
|
652
|
+
}
|