xray16 1.3.4 → 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/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 +1802 -510
- package/types/xr_ai/xr_alife.d.ts +1870 -566
- package/types/xr_ai/xr_enemy_evaluation.d.ts +134 -41
- package/types/xr_ai/xr_goap.d.ts +1116 -668
- package/types/xr_ai/xr_graph.d.ts +135 -47
- package/types/xr_ai/xr_memory.d.ts +382 -148
- package/types/xr_lib/xr_animation.d.ts +252 -81
- package/types/xr_lib/xr_bitwise.d.ts +44 -21
- package/types/xr_lib/xr_color.d.ts +142 -40
- package/types/xr_lib/xr_debug.d.ts +181 -77
- package/types/xr_lib/xr_dialog.d.ts +132 -40
- package/types/xr_lib/xr_flags.d.ts +592 -148
- package/types/xr_lib/xr_fs.d.ts +539 -148
- package/types/xr_lib/xr_game.d.ts +362 -158
- package/types/xr_lib/xr_hit.d.ts +125 -41
- package/types/xr_lib/xr_ini.d.ts +473 -188
- package/types/xr_lib/xr_level.d.ts +795 -225
- package/types/xr_lib/xr_luabind.d.ts +90 -59
- package/types/xr_lib/xr_map.d.ts +192 -61
- package/types/xr_lib/xr_math.d.ts +871 -233
- package/types/xr_lib/xr_multiplayer.d.ts +1079 -351
- package/types/xr_lib/xr_profile.d.ts +272 -160
- package/types/xr_lib/xr_properties.d.ts +610 -166
- package/types/xr_lib/xr_relation.d.ts +231 -84
- package/types/xr_lib/xr_render.d.ts +167 -69
- package/types/xr_lib/xr_save.d.ts +833 -223
- package/types/xr_lib/xr_sound.d.ts +515 -151
- package/types/xr_lib/xr_stats.ts +49 -20
- package/types/xr_lib/xr_task.d.ts +388 -111
- package/types/xr_lib/xr_time.d.ts +177 -61
- package/types/xr_lib/xr_type.d.ts +75 -75
- package/types/xr_object/client/xr_anomaly.d.ts +70 -50
- package/types/xr_object/client/xr_artefact.d.ts +153 -98
- package/types/xr_object/client/xr_client_object.d.ts +207 -76
- package/types/xr_object/client/xr_creature.d.ts +243 -164
- package/types/xr_object/client/xr_item.d.ts +370 -264
- package/types/xr_object/client/xr_level.d.ts +753 -285
- package/types/xr_object/client/xr_physic.d.ts +644 -214
- package/types/xr_object/client/xr_zone.d.ts +85 -47
- package/types/xr_object/script/xr_script_interface.d.ts +819 -584
- package/types/xr_object/script/xr_script_object.d.ts +5728 -1390
- package/types/xr_object/script/xr_script_trade.d.ts +51 -26
- package/types/xr_object/server/xr_server_object.d.ts +1486 -792
- package/types/xr_ui/xr_ui_asset.d.ts +364 -123
- package/types/xr_ui/xr_ui_core.d.ts +424 -97
- package/types/xr_ui/xr_ui_event.d.ts +1449 -381
- package/types/xr_ui/xr_ui_interface.d.ts +2447 -903
- package/types/xr_ui/xr_ui_menu.d.ts +385 -142
- package/types/xrf_plugin.d.ts +89 -51
|
@@ -1,77 +1,181 @@
|
|
|
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
|
-
public
|
|
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
|
-
|
|
1
|
+
declare module "xray16" {
|
|
2
|
+
/**
|
|
3
|
+
* Engine console interface.
|
|
4
|
+
*
|
|
5
|
+
* @source C++ class CConsole
|
|
6
|
+
* @customConstructor CConsole
|
|
7
|
+
* @group xr_debug
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Use `get_console()` to access the engine-owned console. Scripts do not create console instances.
|
|
11
|
+
*/
|
|
12
|
+
export class CConsole extends EngineBinding {
|
|
13
|
+
/**
|
|
14
|
+
* Engine-owned console singleton.
|
|
15
|
+
*/
|
|
16
|
+
private constructor();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Execute console command immediately.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* Executes without adding the command to console history.
|
|
23
|
+
*
|
|
24
|
+
* @param command - Console command.
|
|
25
|
+
*/
|
|
26
|
+
public execute(command: string): void;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Queue console command for deferred execution.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Schedules a `KERNEL:console` event, so the command runs later on the engine event queue.
|
|
33
|
+
*
|
|
34
|
+
* @param command - Console command.
|
|
35
|
+
*/
|
|
36
|
+
public execute_deferred(command: string): void;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Execute a config file through the console.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* The binding prepends `cfg_load` to the provided path.
|
|
43
|
+
*
|
|
44
|
+
* @param script - Config file path.
|
|
45
|
+
*/
|
|
46
|
+
public execute_script(script: string): void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Show the console window.
|
|
50
|
+
*/
|
|
51
|
+
public show(): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Hide the console window.
|
|
55
|
+
*/
|
|
56
|
+
public hide(): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Read console variable as boolean.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* Returns `false` when the command is missing or is not a boolean-compatible mask/integer command.
|
|
63
|
+
*
|
|
64
|
+
* @param key - Console variable name.
|
|
65
|
+
* @returns Boolean value.
|
|
66
|
+
*/
|
|
67
|
+
public get_bool(key: string): boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Read console variable as float.
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* Returns `0` when the command is missing or is not a float command.
|
|
74
|
+
*
|
|
75
|
+
* @param key - Console variable name.
|
|
76
|
+
* @returns Float value.
|
|
77
|
+
*/
|
|
78
|
+
public get_float(key: string): f32;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Read console variable as integer.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* Mask commands are returned as `0` or `1`. Missing or incompatible commands return `0`.
|
|
85
|
+
*
|
|
86
|
+
* @param key - Console variable name.
|
|
87
|
+
* @returns Integer value.
|
|
88
|
+
*/
|
|
89
|
+
public get_integer(key: string): i32;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Read console variable as string.
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* Returns `null` when the command does not exist.
|
|
96
|
+
*
|
|
97
|
+
* @param key - Console variable name.
|
|
98
|
+
* @returns String value.
|
|
99
|
+
*/
|
|
100
|
+
public get_string(key: string): string | null;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Read console variable token text.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* Uses the same engine path as `get_string`, so missing commands return `null`.
|
|
107
|
+
*
|
|
108
|
+
* @param key - Console variable name.
|
|
109
|
+
* @returns Token text.
|
|
110
|
+
*/
|
|
111
|
+
public get_token(key: string): string | null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Log a message through the script log channel.
|
|
116
|
+
*
|
|
117
|
+
* @group xr_debug
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* In non-master builds the message is sent to `CScriptEngine::script_log`.
|
|
121
|
+
*
|
|
122
|
+
* @param text - Message to print.
|
|
123
|
+
*/
|
|
124
|
+
export function log(this: void, text: string): void;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Log an error message and print the current script stack.
|
|
128
|
+
*
|
|
129
|
+
* @group xr_debug
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* The C++ binding asserts after logging the message.
|
|
133
|
+
*
|
|
134
|
+
* @param text - Error message.
|
|
135
|
+
*/
|
|
136
|
+
export function error_log(this: void, text: string): void;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Print the current script stack to the log.
|
|
140
|
+
*
|
|
141
|
+
* @group xr_debug
|
|
142
|
+
*/
|
|
143
|
+
export function print_stack(this: void): void;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Flush pending script log output in debug builds.
|
|
147
|
+
*
|
|
148
|
+
* @group xr_debug
|
|
149
|
+
*/
|
|
150
|
+
export function flush(this: void): void;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Get console object reference.
|
|
154
|
+
*
|
|
155
|
+
* @group xr_debug
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* Returns the global engine console pointer.
|
|
159
|
+
*
|
|
160
|
+
* @returns Console object reference.
|
|
161
|
+
*/
|
|
162
|
+
export function get_console(this: void): CConsole;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Get process command-line parameters.
|
|
166
|
+
*
|
|
167
|
+
* @group xr_debug
|
|
168
|
+
*
|
|
169
|
+
* @returns Engine command-line string.
|
|
170
|
+
*/
|
|
171
|
+
export function command_line(this: void): string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Load and compile a script before continuing execution.
|
|
175
|
+
*
|
|
176
|
+
* @group xr_global_declaration
|
|
177
|
+
*
|
|
178
|
+
* @param path - Script file path.
|
|
179
|
+
*/
|
|
180
|
+
export function prefetch(this: void, path: string): void;
|
|
181
|
+
}
|
|
@@ -1,40 +1,132 @@
|
|
|
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
|
-
|
|
1
|
+
declare module "xray16" {
|
|
2
|
+
/**
|
|
3
|
+
* Script rules attached to a dialog phrase.
|
|
4
|
+
*
|
|
5
|
+
* @source C++ class CPhraseScript
|
|
6
|
+
* @customConstructor CPhraseScript
|
|
7
|
+
* @group xr_dialog
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Phrase scripts are evaluated by the dialog engine against the current actor/NPC speakers. Info portion checks use
|
|
11
|
+
* the actor info registry.
|
|
12
|
+
*/
|
|
13
|
+
export class CPhraseScript {
|
|
14
|
+
/**
|
|
15
|
+
* Run a script action after the phrase is spoken.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* In active two-speaker dialogs the function receives `(speaker, listener, dialog_id, phrase_id)`. In simpler
|
|
19
|
+
* dialog checks it receives `(speaker, dialog_id)`.
|
|
20
|
+
*
|
|
21
|
+
* @throws If the function name cannot be resolved.
|
|
22
|
+
*
|
|
23
|
+
* @param function_name - Script function name.
|
|
24
|
+
*/
|
|
25
|
+
public AddAction(function_name: string): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Disable an info portion when phrase actions run.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Applied after the phrase is accepted and its actions run.
|
|
32
|
+
*
|
|
33
|
+
* @param info_portion - Info portion id.
|
|
34
|
+
*/
|
|
35
|
+
public AddDisableInfo(info_portion: string): void;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Require an info portion to be absent before the phrase is available.
|
|
39
|
+
*
|
|
40
|
+
* @param info_portion - Info portion id.
|
|
41
|
+
*/
|
|
42
|
+
public AddDontHasInfo(info_portion: string): void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Give an info portion when phrase actions run.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Applied after the phrase is accepted and its actions run.
|
|
49
|
+
*
|
|
50
|
+
* @param info_portion - Info portion id.
|
|
51
|
+
*/
|
|
52
|
+
public AddGiveInfo(info_portion: string): void;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Require an info portion before the phrase is available.
|
|
56
|
+
*
|
|
57
|
+
* @param info_portion - Info portion id.
|
|
58
|
+
*/
|
|
59
|
+
public AddHasInfo(info_portion: string): void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Add a script predicate checked before the phrase is available.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* In active two-speaker dialogs the function receives `(speaker, listener, dialog_id, phrase_id, next_phrase_id)`.
|
|
66
|
+
* It should return `true` when the phrase may be shown.
|
|
67
|
+
*
|
|
68
|
+
* @throws If the function name cannot be resolved.
|
|
69
|
+
*
|
|
70
|
+
* @param function_name - Script function name.
|
|
71
|
+
*/
|
|
72
|
+
public AddPrecondition(function_name: string): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Use a script function to provide phrase text.
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* The function is called when the dialog asks for phrase text. Use it for text that depends on the current speaker
|
|
79
|
+
* or dialog state.
|
|
80
|
+
*
|
|
81
|
+
* @throws If the function name cannot be resolved.
|
|
82
|
+
*
|
|
83
|
+
* @param function_name - Script function name.
|
|
84
|
+
*/
|
|
85
|
+
public SetScriptText(function_name: string): void;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Runtime phrase in a phrase dialog.
|
|
90
|
+
*
|
|
91
|
+
* @source C++ class CPhrase
|
|
92
|
+
* @customConstructor CPhrase
|
|
93
|
+
* @group xr_dialog
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* Phrase instances are owned by the dialog graph. Script code usually configures them immediately after
|
|
97
|
+
* `CPhraseDialog.AddPhrase`.
|
|
98
|
+
*/
|
|
99
|
+
export class CPhrase {
|
|
100
|
+
/**
|
|
101
|
+
* @returns Script helper used to configure phrase conditions and actions.
|
|
102
|
+
*/
|
|
103
|
+
public GetPhraseScript(): CPhraseScript;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Phrase dialog built or extended from scripts.
|
|
108
|
+
*
|
|
109
|
+
* @source C++ class CPhraseDialog
|
|
110
|
+
* @customConstructor CPhraseDialog
|
|
111
|
+
* @group xr_dialog
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* A phrase dialog is a directed phrase graph. Phrase id `"0"` is the start phrase used by loaded XML dialogs.
|
|
115
|
+
*/
|
|
116
|
+
export class CPhraseDialog {
|
|
117
|
+
/**
|
|
118
|
+
* Add a phrase to the dialog tree.
|
|
119
|
+
*
|
|
120
|
+
* @remarks
|
|
121
|
+
* `prev_phrase_id` creates the edge from the previous phrase to the new one. Pass an empty string for a root phrase.
|
|
122
|
+
* Reusing an existing `phrase_id` returns the existing phrase and still links it from `prev_phrase_id`.
|
|
123
|
+
*
|
|
124
|
+
* @param text - Text or string table id.
|
|
125
|
+
* @param phrase_id - New phrase id.
|
|
126
|
+
* @param prev_phrase_id - Parent phrase id, or an empty string.
|
|
127
|
+
* @param goodwill_level - Goodwill value used when the engine orders available replies.
|
|
128
|
+
* @returns Created phrase.
|
|
129
|
+
*/
|
|
130
|
+
public AddPhrase(text: string, phrase_id: string, prev_phrase_id: string, goodwill_level: i32): CPhrase;
|
|
131
|
+
}
|
|
132
|
+
}
|