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,223 +1,727 @@
|
|
|
1
|
-
declare module "xray16" {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
public
|
|
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
|
-
public
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
public
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
public
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
public
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
public
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
public
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
public
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
public
|
|
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
|
-
public
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
1
|
+
declare module "xray16" {
|
|
2
|
+
/**
|
|
3
|
+
* Network client identifier.
|
|
4
|
+
*
|
|
5
|
+
* @source C++ class ClientID
|
|
6
|
+
* @customConstructor ClientID
|
|
7
|
+
* @group xr_save
|
|
8
|
+
*/
|
|
9
|
+
export class ClientID extends EngineBinding {
|
|
10
|
+
/** Create an empty client id. */
|
|
11
|
+
public constructor();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get raw client id value.
|
|
15
|
+
*
|
|
16
|
+
* @returns Client id value.
|
|
17
|
+
*/
|
|
18
|
+
public value(): u32;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Set raw client id value.
|
|
22
|
+
*
|
|
23
|
+
* @param value - Client id value.
|
|
24
|
+
*/
|
|
25
|
+
public set(value: u32): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Read/write network packet used by server entities and events.
|
|
30
|
+
*
|
|
31
|
+
* Reading methods advance the read cursor. Writing methods append to the packet unless the method name says
|
|
32
|
+
* otherwise.
|
|
33
|
+
*
|
|
34
|
+
* @source C++ class net_packet
|
|
35
|
+
* @customConstructor net_packet
|
|
36
|
+
* @group xr_save
|
|
37
|
+
*/
|
|
38
|
+
export class net_packet {
|
|
39
|
+
/** Create an empty packet. */
|
|
40
|
+
public constructor();
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Advance the read cursor.
|
|
44
|
+
*
|
|
45
|
+
* @param size - Number of bytes to skip.
|
|
46
|
+
*/
|
|
47
|
+
public r_advance(size: u32): void;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Read a 16-bit compressed angle into a placeholder.
|
|
51
|
+
*
|
|
52
|
+
* @param value - Output placeholder.
|
|
53
|
+
*/
|
|
54
|
+
public r_angle16(value: f32): void;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Read an 8-bit compressed angle into a placeholder.
|
|
58
|
+
*
|
|
59
|
+
* @param value - Output placeholder.
|
|
60
|
+
*/
|
|
61
|
+
public r_angle8(value: f32): void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Read packet message header.
|
|
65
|
+
*
|
|
66
|
+
* @param type - Output placeholder for message type.
|
|
67
|
+
* @returns Packet payload size.
|
|
68
|
+
*/
|
|
69
|
+
public r_begin(type: u16): u32;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Read boolean value.
|
|
73
|
+
*
|
|
74
|
+
* @returns Boolean value.
|
|
75
|
+
*/
|
|
76
|
+
public r_bool(): boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Read client id.
|
|
80
|
+
*
|
|
81
|
+
* @returns Client id.
|
|
82
|
+
*/
|
|
83
|
+
public r_clientID(): ClientID;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Read a compressed direction vector.
|
|
87
|
+
*
|
|
88
|
+
* @param vector - Vector to fill.
|
|
89
|
+
*/
|
|
90
|
+
public r_dir(vector: vector): void;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get unread byte count.
|
|
94
|
+
*
|
|
95
|
+
* @returns Remaining bytes.
|
|
96
|
+
*/
|
|
97
|
+
public r_elapsed(): u32;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Check whether the read cursor reached the end.
|
|
101
|
+
*
|
|
102
|
+
* @returns Whether packet is fully read.
|
|
103
|
+
*/
|
|
104
|
+
public r_eof(): boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Read float value.
|
|
108
|
+
*
|
|
109
|
+
* @returns Float value.
|
|
110
|
+
*/
|
|
111
|
+
public r_float(): f32;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Read float value through a Lua-style placeholder overload.
|
|
115
|
+
*
|
|
116
|
+
* @param value - Placeholder value.
|
|
117
|
+
* @returns Float value.
|
|
118
|
+
*/
|
|
119
|
+
public r_float(value: f32): f32;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Read a 16-bit quantized float.
|
|
123
|
+
*
|
|
124
|
+
* @param min - Minimum decoded value.
|
|
125
|
+
* @param max - Maximum decoded value.
|
|
126
|
+
* @param value - Placeholder value.
|
|
127
|
+
* @returns Decoded float.
|
|
128
|
+
*/
|
|
129
|
+
public r_float_q16(min: f32, max: f32, value: f32): f32;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Read an 8-bit quantized float.
|
|
133
|
+
*
|
|
134
|
+
* @param min - Minimum decoded value.
|
|
135
|
+
* @param max - Maximum decoded value.
|
|
136
|
+
* @param value - Placeholder value.
|
|
137
|
+
* @returns Decoded float.
|
|
138
|
+
*/
|
|
139
|
+
public r_float_q8(min: f32, max: f32, value: f32): f32;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Read matrix data.
|
|
143
|
+
*
|
|
144
|
+
* @param matrix - Matrix to fill.
|
|
145
|
+
* @returns Filled matrix.
|
|
146
|
+
*/
|
|
147
|
+
public r_matrix(matrix: matrix): matrix;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Read signed 16-bit integer.
|
|
151
|
+
*
|
|
152
|
+
* @returns Signed 16-bit integer.
|
|
153
|
+
*/
|
|
154
|
+
public r_s16(): i16;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Read signed 16-bit integer through a placeholder overload.
|
|
158
|
+
*
|
|
159
|
+
* @param value - Placeholder value.
|
|
160
|
+
* @returns Signed 16-bit integer.
|
|
161
|
+
*/
|
|
162
|
+
public r_s16(value: u16): u16;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Read signed 32-bit integer.
|
|
166
|
+
*
|
|
167
|
+
* @returns Signed 32-bit integer.
|
|
168
|
+
*/
|
|
169
|
+
public r_s32(): i32;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Read signed 32-bit integer through a placeholder overload.
|
|
173
|
+
*
|
|
174
|
+
* @param value - Placeholder value.
|
|
175
|
+
* @returns Signed 32-bit integer.
|
|
176
|
+
*/
|
|
177
|
+
public r_s32(value: i32): i32;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Read signed 64-bit integer.
|
|
181
|
+
*
|
|
182
|
+
* @returns Signed 64-bit integer.
|
|
183
|
+
*/
|
|
184
|
+
public r_s64(): i64;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Read signed 64-bit integer through a placeholder overload.
|
|
188
|
+
*
|
|
189
|
+
* @param value - Placeholder value.
|
|
190
|
+
* @returns Signed 64-bit integer.
|
|
191
|
+
*/
|
|
192
|
+
public r_s64(value: i64): i64;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Read signed 8-bit integer.
|
|
196
|
+
*
|
|
197
|
+
* @returns Signed 8-bit integer.
|
|
198
|
+
*/
|
|
199
|
+
public r_s8(): i8;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Read signed 8-bit integer through a placeholder overload.
|
|
203
|
+
*
|
|
204
|
+
* @param value - Placeholder value.
|
|
205
|
+
* @returns Signed 8-bit integer.
|
|
206
|
+
*/
|
|
207
|
+
public r_s8(value: i8): i8;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Read a signed compressed direction vector.
|
|
211
|
+
*
|
|
212
|
+
* @param vector - Vector to fill.
|
|
213
|
+
*/
|
|
214
|
+
public r_sdir(vector: vector): void;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Move read cursor to an absolute byte offset.
|
|
218
|
+
*
|
|
219
|
+
* @param offset - Byte offset.
|
|
220
|
+
*/
|
|
221
|
+
public r_seek(offset: u32): void;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Read zero-terminated string.
|
|
225
|
+
*
|
|
226
|
+
* @returns String value.
|
|
227
|
+
*/
|
|
228
|
+
public r_stringZ<T extends string = string>(): T;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Get current read cursor offset.
|
|
232
|
+
*
|
|
233
|
+
* @returns Byte offset.
|
|
234
|
+
*/
|
|
235
|
+
public r_tell(): u32;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Read unsigned 16-bit integer.
|
|
239
|
+
*
|
|
240
|
+
* @returns Unsigned 16-bit integer.
|
|
241
|
+
*/
|
|
242
|
+
public r_u16(): u16;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Read unsigned 16-bit integer through a placeholder overload.
|
|
246
|
+
*
|
|
247
|
+
* @param value - Placeholder value.
|
|
248
|
+
* @returns Unsigned 16-bit integer.
|
|
249
|
+
*/
|
|
250
|
+
public r_u16(value: u16): u16;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Read unsigned 32-bit integer.
|
|
254
|
+
*
|
|
255
|
+
* @returns Unsigned 32-bit integer.
|
|
256
|
+
*/
|
|
257
|
+
public r_u32(): u32;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Read unsigned 32-bit integer through a placeholder overload.
|
|
261
|
+
*
|
|
262
|
+
* @param value - Placeholder value.
|
|
263
|
+
* @returns Unsigned 32-bit integer.
|
|
264
|
+
*/
|
|
265
|
+
public r_u32(value: u32): u32;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Read unsigned 64-bit integer.
|
|
269
|
+
*
|
|
270
|
+
* @returns Unsigned 64-bit integer.
|
|
271
|
+
*/
|
|
272
|
+
public r_u64(): u64;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Read unsigned 64-bit integer through a placeholder overload.
|
|
276
|
+
*
|
|
277
|
+
* @param value - Placeholder value.
|
|
278
|
+
* @returns Unsigned 64-bit integer.
|
|
279
|
+
*/
|
|
280
|
+
public r_u64(value: u64): u64;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Read unsigned 8-bit integer.
|
|
284
|
+
*
|
|
285
|
+
* @returns Unsigned 8-bit integer.
|
|
286
|
+
*/
|
|
287
|
+
public r_u8(): u8;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Read unsigned 8-bit integer through a placeholder overload.
|
|
291
|
+
*
|
|
292
|
+
* @param value - Placeholder value.
|
|
293
|
+
* @returns Unsigned 8-bit integer.
|
|
294
|
+
*/
|
|
295
|
+
public r_u8(value: u8): u8;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Read 3D vector.
|
|
299
|
+
*
|
|
300
|
+
* @param vector - Vector to fill.
|
|
301
|
+
*/
|
|
302
|
+
public r_vec3(vector: vector): void;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Write a 16-bit compressed angle.
|
|
306
|
+
*
|
|
307
|
+
* @param value - Angle in radians.
|
|
308
|
+
*/
|
|
309
|
+
public w_angle16(value: f32): void;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Write an 8-bit compressed angle.
|
|
313
|
+
*
|
|
314
|
+
* @param value - Angle in radians.
|
|
315
|
+
*/
|
|
316
|
+
public w_angle8(value: f32): void;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Start packet with message type.
|
|
320
|
+
*
|
|
321
|
+
* @param type - Message type.
|
|
322
|
+
*/
|
|
323
|
+
public w_begin(type: u16): void;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Write boolean value.
|
|
327
|
+
*
|
|
328
|
+
* @param value - Boolean value.
|
|
329
|
+
*/
|
|
330
|
+
public w_bool(value: boolean): void;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Close a 16-bit size-prefixed chunk.
|
|
334
|
+
*
|
|
335
|
+
* @param marker - Chunk marker returned by `w_chunk_open16`.
|
|
336
|
+
*/
|
|
337
|
+
public w_chunk_close16(marker: u32): void;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Close an 8-bit size-prefixed chunk.
|
|
341
|
+
*
|
|
342
|
+
* @param marker - Chunk marker returned by `w_chunk_open8`.
|
|
343
|
+
*/
|
|
344
|
+
public w_chunk_close8(marker: u32): void;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Open a 16-bit size-prefixed chunk.
|
|
348
|
+
*
|
|
349
|
+
* @param marker - Output placeholder for chunk marker.
|
|
350
|
+
*/
|
|
351
|
+
public w_chunk_open16(marker: u32): void;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Open an 8-bit size-prefixed chunk.
|
|
355
|
+
*
|
|
356
|
+
* @param marker - Output placeholder for chunk marker.
|
|
357
|
+
*/
|
|
358
|
+
public w_chunk_open8(marker: u32): void;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Write client id.
|
|
362
|
+
*
|
|
363
|
+
* @param client_id - Client id.
|
|
364
|
+
*/
|
|
365
|
+
public w_clientID(client_id: ClientID): void;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Write compressed direction vector.
|
|
369
|
+
*
|
|
370
|
+
* @param vector - Direction vector.
|
|
371
|
+
*/
|
|
372
|
+
public w_dir(vector: vector): void;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Write float value.
|
|
376
|
+
*
|
|
377
|
+
* @param value - Float value.
|
|
378
|
+
*/
|
|
379
|
+
public w_float(value: f32): void;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Write a 16-bit quantized float.
|
|
383
|
+
*
|
|
384
|
+
* @param value - Value to write.
|
|
385
|
+
* @param min - Minimum encoded value.
|
|
386
|
+
* @param max - Maximum encoded value.
|
|
387
|
+
*/
|
|
388
|
+
public w_float_q16(value: f32, min: f32, max: f32): void;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Write an 8-bit quantized float.
|
|
392
|
+
*
|
|
393
|
+
* @param value - Value to write.
|
|
394
|
+
* @param min - Minimum encoded value.
|
|
395
|
+
* @param max - Maximum encoded value.
|
|
396
|
+
*/
|
|
397
|
+
public w_float_q8(value: f32, min: f32, max: f32): void;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Write matrix data.
|
|
401
|
+
*
|
|
402
|
+
* @param matrix - Matrix to write.
|
|
403
|
+
*/
|
|
404
|
+
public w_matrix(matrix: matrix): void;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Write signed 16-bit integer.
|
|
408
|
+
*
|
|
409
|
+
* @param value - Signed 16-bit integer.
|
|
410
|
+
*/
|
|
411
|
+
public w_s16(value: i16): void;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Write signed 32-bit integer.
|
|
415
|
+
*
|
|
416
|
+
* @param value - Signed 32-bit integer.
|
|
417
|
+
*/
|
|
418
|
+
public w_s32(value: i32): void;
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Write signed 64-bit integer.
|
|
422
|
+
*
|
|
423
|
+
* @param value - Signed 64-bit integer.
|
|
424
|
+
*/
|
|
425
|
+
public w_s64(value: i64): void;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Write signed compressed direction vector.
|
|
429
|
+
*
|
|
430
|
+
* @param vector - Direction vector.
|
|
431
|
+
*/
|
|
432
|
+
public w_sdir(vector: vector): void;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Write zero-terminated string.
|
|
436
|
+
*
|
|
437
|
+
* @param value - String value. `null` writes an empty value in existing scripts.
|
|
438
|
+
*/
|
|
439
|
+
public w_stringZ(value: string | null): void;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Get current write cursor offset.
|
|
443
|
+
*
|
|
444
|
+
* @returns Byte offset.
|
|
445
|
+
*/
|
|
446
|
+
public w_tell(): u32;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Write unsigned 16-bit integer.
|
|
450
|
+
*
|
|
451
|
+
* @param value - Unsigned 16-bit integer.
|
|
452
|
+
*/
|
|
453
|
+
public w_u16(value: u16): void;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Write unsigned 32-bit integer.
|
|
457
|
+
*
|
|
458
|
+
* @param value - Unsigned 32-bit integer.
|
|
459
|
+
*/
|
|
460
|
+
public w_u32(value: u32): void;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Write unsigned 64-bit integer.
|
|
464
|
+
*
|
|
465
|
+
* @param value - Unsigned 64-bit integer.
|
|
466
|
+
*/
|
|
467
|
+
public w_u64(value: u64): void;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Write unsigned 8-bit integer.
|
|
471
|
+
*
|
|
472
|
+
* @param value - Unsigned 8-bit integer.
|
|
473
|
+
*/
|
|
474
|
+
public w_u8(value: u8): void;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Write 3D vector.
|
|
478
|
+
*
|
|
479
|
+
* @param vector - Vector to write.
|
|
480
|
+
*/
|
|
481
|
+
public w_vec3(vector: vector): void;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Binary reader used for save data and chunk payloads.
|
|
486
|
+
*
|
|
487
|
+
* @source C++ class reader
|
|
488
|
+
* @customConstructor reader
|
|
489
|
+
* @group xr_save
|
|
490
|
+
*/
|
|
491
|
+
export class reader {
|
|
492
|
+
/**
|
|
493
|
+
* Advance the read cursor.
|
|
494
|
+
*
|
|
495
|
+
* @param size - Number of bytes to skip.
|
|
496
|
+
*/
|
|
497
|
+
public r_advance(size: u64): void;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Get unread byte count.
|
|
501
|
+
*
|
|
502
|
+
* @returns Remaining bytes.
|
|
503
|
+
*/
|
|
504
|
+
public r_elapsed(): i64;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Check whether the reader cursor reached the end.
|
|
508
|
+
*
|
|
509
|
+
* @returns Whether reader is fully consumed.
|
|
510
|
+
*/
|
|
511
|
+
public r_eof(): boolean;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Read signed compressed direction vector.
|
|
515
|
+
*
|
|
516
|
+
* @param vector - Vector to fill.
|
|
517
|
+
*/
|
|
518
|
+
public r_sdir(vector: vector): void;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Move read cursor to an absolute byte offset.
|
|
522
|
+
*
|
|
523
|
+
* @param offset - Byte offset.
|
|
524
|
+
*/
|
|
525
|
+
public r_seek(offset: u64): void;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Get current read cursor offset.
|
|
529
|
+
*
|
|
530
|
+
* @returns Byte offset.
|
|
531
|
+
*/
|
|
532
|
+
public r_tell(): u64;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Read compressed direction vector.
|
|
536
|
+
*
|
|
537
|
+
* @param vector - Vector to fill.
|
|
538
|
+
*/
|
|
539
|
+
public r_dir(vector: vector): void;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Read 3D vector.
|
|
543
|
+
*
|
|
544
|
+
* @param vector - Vector to fill.
|
|
545
|
+
*/
|
|
546
|
+
public r_vec3(vector: vector): void;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Read a 16-bit compressed angle.
|
|
550
|
+
*
|
|
551
|
+
* @returns Angle in radians.
|
|
552
|
+
*/
|
|
553
|
+
public r_angle16(): f32;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Read an 8-bit compressed angle.
|
|
557
|
+
*
|
|
558
|
+
* @returns Angle in radians.
|
|
559
|
+
*/
|
|
560
|
+
public r_angle8(): f32;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Read boolean value.
|
|
564
|
+
*
|
|
565
|
+
* @returns Boolean value.
|
|
566
|
+
*/
|
|
567
|
+
public r_bool(): boolean;
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Read zero-terminated string.
|
|
571
|
+
*
|
|
572
|
+
* @returns String value.
|
|
573
|
+
*/
|
|
574
|
+
public r_stringZ<T extends string = string>(): T;
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Read float value.
|
|
578
|
+
*
|
|
579
|
+
* @param value - Optional placeholder value.
|
|
580
|
+
* @returns Float value.
|
|
581
|
+
*/
|
|
582
|
+
public r_float<T extends f32>(value?: T): T;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Read a 16-bit quantized float.
|
|
586
|
+
*
|
|
587
|
+
* @param min - Minimum decoded value.
|
|
588
|
+
* @param max - Maximum decoded value.
|
|
589
|
+
* @returns Decoded float.
|
|
590
|
+
*/
|
|
591
|
+
public r_float_q16<T extends f32>(min: T, max: T): T;
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Read an 8-bit quantized float.
|
|
595
|
+
*
|
|
596
|
+
* @param min - Minimum decoded value.
|
|
597
|
+
* @param max - Maximum decoded value.
|
|
598
|
+
* @returns Decoded float.
|
|
599
|
+
*/
|
|
600
|
+
public r_float_q8<T extends f32>(min: T, max: T): T;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Read signed 16-bit integer.
|
|
604
|
+
*
|
|
605
|
+
* @param value - Optional placeholder value.
|
|
606
|
+
* @returns Signed 16-bit integer.
|
|
607
|
+
*/
|
|
608
|
+
public r_s16<T extends i16 = i16>(value?: T): T;
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Read signed 32-bit integer.
|
|
612
|
+
*
|
|
613
|
+
* @param value - Optional placeholder value.
|
|
614
|
+
* @returns Signed 32-bit integer.
|
|
615
|
+
*/
|
|
616
|
+
public r_s32<T extends i32 = i32>(value?: T): T;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Read signed 64-bit integer.
|
|
620
|
+
*
|
|
621
|
+
* @param value - Optional placeholder value.
|
|
622
|
+
* @returns Signed 64-bit integer.
|
|
623
|
+
*/
|
|
624
|
+
public r_s64<T extends i64 = i64>(value?: T): T;
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Read signed 8-bit integer.
|
|
628
|
+
*
|
|
629
|
+
* @param value - Optional placeholder value.
|
|
630
|
+
* @returns Signed 8-bit integer.
|
|
631
|
+
*/
|
|
632
|
+
public r_s8<T extends i8 = i8>(value?: T): T;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Read unsigned 16-bit integer.
|
|
636
|
+
*
|
|
637
|
+
* @param value - Optional placeholder value.
|
|
638
|
+
* @returns Unsigned 16-bit integer.
|
|
639
|
+
*/
|
|
640
|
+
public r_u16<T extends u16 = u16>(value?: T): T;
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Read unsigned 32-bit integer.
|
|
644
|
+
*
|
|
645
|
+
* @param value - Optional placeholder value.
|
|
646
|
+
* @returns Unsigned 32-bit integer.
|
|
647
|
+
*/
|
|
648
|
+
public r_u32<T extends u32 = u32>(value?: T): T;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Read unsigned 64-bit integer.
|
|
652
|
+
*
|
|
653
|
+
* @param value - Optional placeholder value.
|
|
654
|
+
* @returns Unsigned 64-bit integer.
|
|
655
|
+
*/
|
|
656
|
+
public r_u64<T extends u64 = u64>(value?: T): T;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* Read unsigned 8-bit integer.
|
|
660
|
+
*
|
|
661
|
+
* @param value - Optional placeholder value.
|
|
662
|
+
* @returns Unsigned 8-bit integer.
|
|
663
|
+
*/
|
|
664
|
+
public r_u8<T extends u8 = u8>(value?: T): T;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Any engine binary input accepted by save/network serializers.
|
|
669
|
+
*
|
|
670
|
+
* @group xr_save
|
|
671
|
+
*/
|
|
672
|
+
export type TXR_net_processor = reader | net_packet;
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Lightweight view over save-game metadata.
|
|
676
|
+
*
|
|
677
|
+
* @source C++ class CSavedGameWrapper
|
|
678
|
+
* @customConstructor CSavedGameWrapper
|
|
679
|
+
* @group xr_save
|
|
680
|
+
*/
|
|
681
|
+
export class CSavedGameWrapper extends EngineBinding {
|
|
682
|
+
/**
|
|
683
|
+
* Open save-game metadata by save name.
|
|
684
|
+
*
|
|
685
|
+
* @param name - Save name without extension.
|
|
686
|
+
*/
|
|
687
|
+
public constructor(name: string);
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Get active level name stored in the save.
|
|
691
|
+
*
|
|
692
|
+
* @returns Level name, or an empty/error value when metadata cannot be resolved.
|
|
693
|
+
*/
|
|
694
|
+
public level_name(): string;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Get active level id stored in the save.
|
|
698
|
+
*
|
|
699
|
+
* @returns Level id.
|
|
700
|
+
*/
|
|
701
|
+
public level_id(): u8;
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Get in-game time stored in the save.
|
|
705
|
+
*
|
|
706
|
+
* @returns Game time.
|
|
707
|
+
*/
|
|
708
|
+
public game_time(): CTime;
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Get actor health stored in the save.
|
|
712
|
+
*
|
|
713
|
+
* @returns Actor health.
|
|
714
|
+
*/
|
|
715
|
+
public actor_health(): f32;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Check whether a save exists and has a compatible header.
|
|
720
|
+
*
|
|
721
|
+
* @group xr_save
|
|
722
|
+
*
|
|
723
|
+
* @param filename - Save name without extension.
|
|
724
|
+
* @returns Whether the save can be loaded by this engine.
|
|
725
|
+
*/
|
|
726
|
+
export function valid_saved_game(this: void, filename: string): boolean;
|
|
727
|
+
}
|