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.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/types/xr_ai/xr_action.d.ts +1321 -29
  3. package/types/xr_ai/xr_alife.d.ts +1336 -32
  4. package/types/xr_ai/xr_enemy_evaluation.d.ts +112 -19
  5. package/types/xr_ai/xr_goap.d.ts +450 -3
  6. package/types/xr_ai/xr_graph.d.ts +94 -6
  7. package/types/xr_ai/xr_memory.d.ts +240 -6
  8. package/types/xr_lib/xr_animation.d.ts +185 -14
  9. package/types/xr_lib/xr_bitwise.d.ts +20 -8
  10. package/types/xr_lib/xr_color.d.ts +103 -6
  11. package/types/xr_lib/xr_debug.d.ts +110 -12
  12. package/types/xr_lib/xr_dialog.d.ts +99 -7
  13. package/types/xr_lib/xr_flags.d.ts +78 -15
  14. package/types/xr_lib/xr_fs.d.ts +395 -5
  15. package/types/xr_lib/xr_game.d.ts +101 -0
  16. package/types/xr_lib/xr_hit.d.ts +84 -0
  17. package/types/xr_lib/xr_ini.d.ts +60 -2
  18. package/types/xr_lib/xr_level.d.ts +182 -39
  19. package/types/xr_lib/xr_luabind.d.ts +37 -11
  20. package/types/xr_lib/xr_map.d.ts +137 -6
  21. package/types/xr_lib/xr_math.d.ts +56 -0
  22. package/types/xr_lib/xr_multiplayer.d.ts +729 -1
  23. package/types/xr_lib/xr_profile.d.ts +80 -0
  24. package/types/xr_lib/xr_properties.d.ts +159 -4
  25. package/types/xr_lib/xr_relation.d.ts +147 -0
  26. package/types/xr_lib/xr_render.d.ts +99 -3
  27. package/types/xr_lib/xr_save.d.ts +110 -4
  28. package/types/xr_lib/xr_sound.d.ts +373 -9
  29. package/types/xr_lib/xr_stats.ts +33 -4
  30. package/types/xr_lib/xr_task.d.ts +277 -0
  31. package/types/xr_lib/xr_time.d.ts +11 -0
  32. package/types/xr_object/client/xr_anomaly.d.ts +20 -0
  33. package/types/xr_object/client/xr_artefact.d.ts +57 -2
  34. package/types/xr_object/client/xr_client_object.d.ts +131 -0
  35. package/types/xr_object/client/xr_creature.d.ts +79 -0
  36. package/types/xr_object/client/xr_item.d.ts +108 -2
  37. package/types/xr_object/client/xr_level.d.ts +482 -14
  38. package/types/xr_object/client/xr_physic.d.ts +459 -29
  39. package/types/xr_object/client/xr_zone.d.ts +38 -0
  40. package/types/xr_object/script/xr_script_interface.d.ts +236 -1
  41. package/types/xr_object/script/xr_script_object.d.ts +3402 -82
  42. package/types/xr_object/script/xr_script_trade.d.ts +25 -15
  43. package/types/xr_object/server/xr_server_object.d.ts +707 -15
  44. package/types/xr_ui/xr_ui_asset.d.ts +241 -6
  45. package/types/xr_ui/xr_ui_core.d.ts +327 -9
  46. package/types/xr_ui/xr_ui_event.d.ts +1067 -1
  47. package/types/xr_ui/xr_ui_interface.d.ts +1563 -17
  48. package/types/xr_ui/xr_ui_menu.d.ts +259 -16
  49. package/types/xrf_plugin.d.ts +44 -14
@@ -1,31 +1,140 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * UI style manager binding.
4
+ *
5
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
6
+ *
3
7
  * @source C++ class UIStyleManager
4
8
  * @customConstructor UIStyleManager
5
9
  * @group xr_ui_asset
10
+ *
11
+ * @remarks
12
+ * Use `GetUIStyleManager()` to access the engine singleton. Style changes may require UI reload to affect existing
13
+ * windows. Available styles are discovered from UI style folders at startup.
6
14
  */
7
15
  export class UIStyleManager {
16
+ /**
17
+ * Engine-owned UI style manager.
18
+ */
8
19
  private constructor();
9
20
 
21
+ /**
22
+ * Iterate over available UI styles.
23
+ *
24
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
25
+ *
26
+ * @remarks
27
+ * The returned value is a Lua iterator over engine style tokens. The default style is always present.
28
+ *
29
+ * @returns Style tokens.
30
+ */
10
31
  public GetAllStyles(): LuaIterable<token>;
11
32
 
33
+ /**
34
+ * Check whether the default UI style is active.
35
+ *
36
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
37
+ *
38
+ * @returns Whether the default style is set.
39
+ */
12
40
  public DefaultStyleIsSet(): boolean;
13
41
 
42
+ /**
43
+ * Get the active UI style id.
44
+ *
45
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
46
+ *
47
+ * @returns Current style id.
48
+ */
14
49
  public GetCurrentStyleId(): u32;
15
50
 
51
+ /**
52
+ * Get the active UI style name.
53
+ *
54
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
55
+ *
56
+ * @returns Current style name.
57
+ */
58
+ public GetCurrentStyleName(): string;
59
+
60
+ /**
61
+ * Switch to a UI style by name.
62
+ *
63
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
64
+ *
65
+ * @remarks
66
+ * Pass `reload_ui` to run the engine UI reset sequence after switching. Unknown names return `false`.
67
+ *
68
+ * @param name - Style name.
69
+ * @param reload_ui - Whether to reload UI after switching.
70
+ * @returns Whether the style was applied.
71
+ */
72
+ public SetStyle(name: string, reload_ui?: boolean): boolean;
73
+
74
+ /**
75
+ * Switch to a UI style by id.
76
+ *
77
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
78
+ *
79
+ * @remarks
80
+ * Use an id from {@link GetAllStyles}. Unknown ids are accepted here, but later style-name lookup can fail native
81
+ * verification.
82
+ *
83
+ * @param id - Style id.
84
+ */
85
+ public SetupStyle(id: u32): void;
86
+
87
+ /**
88
+ * Reset cached UI style data.
89
+ *
90
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
91
+ *
92
+ * @remarks
93
+ * Runs the engine UI reset sequence. It does not change the current style id by itself.
94
+ */
95
+ public ResetUI(): void;
96
+
97
+ /**
98
+ * Switch to a UI style by id.
99
+ *
100
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
101
+ *
102
+ * @deprecated Use {@link UIStyleManager.SetupStyle}; the engine binding accepts names in `SetStyle`.
103
+ *
104
+ * @param id - Style id.
105
+ * @param reload_ui - Whether to reload UI after switching.
106
+ */
16
107
  public SetStyle(id: u32, reload_ui?: boolean): void;
17
108
  }
18
109
 
19
110
  /**
111
+ * Game font binding used by UI widgets.
112
+ *
20
113
  * @source C++ class CGameFont
21
114
  * @customConstructor CGameFont
22
115
  * @group xr_ui_asset
116
+ *
117
+ * @remarks
118
+ * Font instances are owned by the UI subsystem and returned by the `GetFont*` helpers. Do not construct or retain
119
+ * them outside the lifetime of the UI subsystem.
23
120
  */
24
121
  export class CGameFont {
122
+ /**
123
+ * Engine enum value for `CGameFont.alCenter`.
124
+ */
25
125
  public static readonly alCenter: 2;
126
+ /**
127
+ * Engine enum value for `CGameFont.alLeft`.
128
+ */
26
129
  public static readonly alLeft: 0;
130
+ /**
131
+ * Engine enum value for `CGameFont.alRight`.
132
+ */
27
133
  public static readonly alRight: 1;
28
134
 
135
+ /**
136
+ * Engine-owned font constants.
137
+ */
29
138
  private constructor();
30
139
  }
31
140
 
@@ -37,93 +146,219 @@ declare module "xray16" {
37
146
  export type TXR_CGameFont_alignment = EnumeratedStaticsValues<typeof CGameFont>;
38
147
 
39
148
  /**
149
+ * Get the small digital/interface font.
150
+ *
40
151
  * @group xr_ui_asset
152
+ *
153
+ * @returns Font instance.
41
154
  */
42
155
  export function GetFontDI(this: void): CGameFont;
43
156
 
44
157
  /**
158
+ * Get the 19px Graffiti Russian UI font.
159
+ *
45
160
  * @group xr_ui_asset
161
+ *
162
+ * @returns Font instance.
46
163
  */
47
164
  export function GetFontGraffiti19Russian(this: void): CGameFont;
48
165
 
49
166
  /**
167
+ * Get the 32px Graffiti Russian UI font.
168
+ *
50
169
  * @group xr_ui_asset
170
+ *
171
+ * @returns Font instance.
51
172
  */
52
173
  export function GetFontGraffiti32Russian(this: void): CGameFont;
53
174
 
54
175
  /**
176
+ * Get the 50px Graffiti Russian UI font.
177
+ *
55
178
  * @group xr_ui_asset
179
+ *
180
+ * @returns Font instance.
56
181
  */
57
182
  export function GetFontGraffiti50Russian(this: void): CGameFont;
58
183
 
59
184
  /**
185
+ * Get the 16px Letterica Russian UI font.
186
+ *
60
187
  * @group xr_ui_asset
188
+ *
189
+ * @returns Font instance.
61
190
  */
62
191
  export function GetFontLetterica16Russian(this: void): CGameFont;
63
192
 
64
193
  /**
194
+ * Get the 18px Letterica Russian UI font.
195
+ *
65
196
  * @group xr_ui_asset
197
+ *
198
+ * @returns Font instance.
66
199
  */
67
200
  export function GetFontLetterica18Russian(this: void): CGameFont;
68
201
 
69
202
  /**
203
+ * Get the 25px Letterica UI font.
204
+ *
70
205
  * @group xr_ui_asset
206
+ *
207
+ * @returns Font instance.
71
208
  */
72
209
  export function GetFontLetterica25(this: void): CGameFont;
73
210
 
74
211
  /**
212
+ * Get the medium HUD font.
213
+ *
75
214
  * @group xr_ui_asset
215
+ *
216
+ * @returns Font instance.
76
217
  */
77
218
  export function GetFontMedium(this: void): CGameFont;
78
219
 
79
220
  /**
221
+ * Get the small HUD font.
222
+ *
80
223
  * @group xr_ui_asset
224
+ *
225
+ * @returns Font instance.
81
226
  */
82
227
  export function GetFontSmall(this: void): CGameFont;
83
228
 
84
229
  /**
230
+ * Get texture metadata and throw if it is missing.
231
+ *
232
+ * @group xr_ui_asset
233
+ *
234
+ * @remarks
235
+ * This overload verifies that the texture exists. Use an output-object overload when missing textures are expected.
236
+ *
237
+ * @param name - Texture atlas entry name.
238
+ * @returns Texture metadata.
239
+ */
240
+ export function GetTextureInfo(this: void, name: string): TEX_INFO;
241
+
242
+ /**
243
+ * Get texture metadata, falling back to another texture name.
244
+ *
85
245
  * @group xr_ui_asset
86
246
  *
87
- * @param char
88
- * @param char2
89
- * @param tex_info
247
+ * @remarks
248
+ * This overload verifies that either `name` or `default_name` exists.
249
+ *
250
+ * @param name - Texture atlas entry name.
251
+ * @param default_name - Fallback texture name.
252
+ * @returns Texture metadata.
253
+ */
254
+ export function GetTextureInfo(this: void, name: string, default_name: string): TEX_INFO;
255
+
256
+ /**
257
+ * Try to get texture metadata into an output object.
258
+ *
259
+ * @group xr_ui_asset
260
+ *
261
+ * @remarks
262
+ * The passed `tex_info` object is overwritten when the texture is found. Missing textures return `false` instead of
263
+ * failing native verification.
264
+ *
265
+ * @param name - Texture atlas entry name.
266
+ * @param tex_info - Output texture metadata.
267
+ * @returns Whether the texture was found.
90
268
  */
91
- export function GetTextureInfo(this: void, char: string, char2: string, tex_info: TEX_INFO): boolean;
269
+ export function GetTextureInfo(this: void, name: string, tex_info: TEX_INFO): boolean;
92
270
 
93
271
  /**
272
+ * Try to get texture metadata into an output object, with a fallback texture name.
273
+ *
274
+ * @group xr_ui_asset
275
+ *
276
+ * @remarks
277
+ * The passed `tex_info` object is overwritten when either texture is found. Missing primary and fallback textures
278
+ * return `false`.
279
+ *
280
+ * @param name - Texture atlas entry name.
281
+ * @param default_name - Fallback texture name.
282
+ * @param tex_info - Output texture metadata.
283
+ * @returns Whether the texture or fallback was found.
284
+ */
285
+ export function GetTextureInfo(this: void, name: string, default_name: string, tex_info: TEX_INFO): boolean;
286
+
287
+ /**
288
+ * Get source texture file name for an atlas entry.
289
+ *
94
290
  * @group xr_ui_asset
95
291
  *
96
- * @param char
292
+ * @remarks
293
+ * Uses the same verified lookup path as `GetTextureInfo(name)`.
294
+ *
295
+ * @param name - Texture atlas entry name.
296
+ * @returns Texture file name.
97
297
  */
98
- export function GetTextureName(this: void, char: string): string;
298
+ export function GetTextureName(this: void, name: string): string;
99
299
 
100
300
  /**
301
+ * Get the 22px Graffiti Russian UI font.
302
+ *
101
303
  * @group xr_ui_asset
304
+ *
305
+ * @returns Font instance.
102
306
  */
103
307
  export function GetFontGraffiti22Russian(this: void): CGameFont;
104
308
 
105
309
  /**
310
+ * Get the default UI path.
311
+ *
106
312
  * @group xr_ui_asset
313
+ *
314
+ * @returns Default UI path, usually the base `ui` config folder.
107
315
  */
108
316
  export function GetDefaultUIPath(this: void): string;
109
317
 
110
318
  /**
319
+ * Get the default UI path with trailing delimiter.
320
+ *
111
321
  * @group xr_ui_asset
322
+ *
323
+ * @returns Default UI path with delimiter.
112
324
  */
113
325
  export function GetDefaultUIPathWithDelimiter(this: void): string;
114
326
 
115
327
  /**
328
+ * Get the active UI path.
329
+ *
116
330
  * @group xr_ui_asset
331
+ *
332
+ * @remarks
333
+ * Differs from the default path after a non-default UI style is selected.
334
+ *
335
+ * @returns Active UI path.
117
336
  */
118
337
  export function GetUIPath(this: void): string;
119
338
 
120
339
  /**
340
+ * Get the active UI path with trailing delimiter.
341
+ *
121
342
  * @group xr_ui_asset
343
+ *
344
+ * @remarks
345
+ * Differs from the default path after a non-default UI style is selected.
346
+ *
347
+ * @returns Active UI path with delimiter.
122
348
  */
123
349
  export function GetUIPathWithDelimiter(this: void): string;
124
350
 
125
351
  /**
352
+ * Get the global UI style manager.
353
+ *
354
+ * @since OpenXRay 2023-03-31, 8c4f1500, PR #1114
355
+ *
126
356
  * @group xr_ui_asset
357
+ *
358
+ * @remarks
359
+ * Returns the engine-owned singleton.
360
+ *
361
+ * @returns UI style manager singleton.
127
362
  */
128
363
  export function GetUIStyleManager(this: void): UIStyleManager;
129
364
  }