@kingdomsconnected/types 1.5.7 → 1.6.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.
@@ -80,7 +80,7 @@ declare global {
80
80
  /**
81
81
  * Dispatched when the flight starts and when it ends, on this machine only. Handler promises are not awaited.
82
82
  *
83
- * `reason` is `script` on the way in. On the way out it is `script` for a resource ending it, `mapEditor` for F7 taking the one camera, `viewLost` for the level going away underneath the camera's anchor, and `sessionOver` for the session ending.
83
+ * `reason` is `script` on the way in. On the way out it is `script` for a resource ending it, `mapEditor` for the map editor taking the one camera, `viewLost` for the level going away underneath the camera's anchor, and `sessionOver` for the session ending.
84
84
  */
85
85
  noclipChanged: [active: boolean, reason: "script" | "mapEditor" | "viewLost" | "sessionOver"];
86
86
 
@@ -1177,6 +1177,15 @@ declare global {
1177
1177
  */
1178
1178
  playOnEntity(trigger: string, entityId: number): boolean;
1179
1179
 
1180
+ /**
1181
+ * Plays a sound file on an entity, positioned and attenuated like the game's own spoken lines and under the same volume settings. A file streamed by the server plays exactly like one the game ships. An entity takes one file per 0.1 seconds.
1182
+ * @param file Game-root path of an `.ogg`, with or without the extension -- `sounds/kcdc/<resource>/line` for one a server streams.
1183
+ * @param entityId Engine entity to play it on -- what `Player.entityId` reports.
1184
+ * @param purpose Which of the game's voice host events carries it: `inner`, `10`, `20`, `35`, `50`, `100`, `200` (a bark heard up to that many metres), `sfp_dialog`, `sfp_cutscene` or `sfp_music`. Defaults to `50`.
1185
+ * @returns True when the entity was there and took it.
1186
+ */
1187
+ playFile(file: string, entityId: number, purpose?: string): boolean;
1188
+
1180
1189
  /**
1181
1190
  * Stops every instance of one trigger on the entity. Triggers that have already finished are not an error.
1182
1191
  * @param trigger Name of the trigger to stop.
@@ -1218,6 +1227,18 @@ declare global {
1218
1227
  hasTrigger(trigger: string): boolean;
1219
1228
  };
1220
1229
 
1230
+ /**
1231
+ * What the server streams, seen from this machine. Models, materials, textures, sounds and particle libraries a server streams load by path like the game's own -- `objects/kcdc/<resource>/chair.cgf` works wherever a model path does -- so nothing here is needed to use them. Clips play through the server's `playClip`.
1232
+ */
1233
+ const Assets: {
1234
+ /**
1235
+ * Whether the session's streamed assets carry a file at this path. Only new assets count; a replaced stock file is the game's own path.
1236
+ * @param path Path inside the game's data, as a server streams it -- `objects/kcdc/<resource>/chair.cgf`.
1237
+ * @returns True when a mounted stream-lane pak carries it.
1238
+ */
1239
+ has(path: string): boolean;
1240
+ };
1241
+
1221
1242
  /**
1222
1243
  * The game's own particle effects, played on this machine. An effect is a name out of the game's particle libraries -- `WH_Particels.fires.candle`, `collisions.combat.sword_sword`, `cinematics.dust.dust_army_a` -- and `list` is the whole vocabulary. Nothing here is replicated: an effect everyone should see is one the server tells every client to play with `Vfx.burst`, or one the server places with `Vfx.spawn`, which the interest grid then streams to whoever is near it. Almost every effect the game ships is continuous, which means it never ends on its own -- so everything started here is given a duration, and one that is not stopped first is stopped when the session ends.
1223
1244
  */
@@ -1419,15 +1440,35 @@ declare global {
1419
1440
  distance: number;
1420
1441
 
1421
1442
  /**
1422
- * The surface type's own name, spelled the way the game's tables spell it -- `mat_wood`, `mat_stone`, `mat_water`. This is what a trace is worth over a position: it says what was hit, not just where. Empty only before the material tables are up.
1443
+ * The surface type's own name, spelled the way the game's tables spell it in `Libs/MaterialEffects/SurfaceTypes.xml` -- `mat_wood`, `mat_rock`, `mat_soil`, `mat_water`. It says what the thing is made of, which is how footsteps and blows sound, not what it is: a plank wall is `mat_wood` as much as a trunk is, so tell a tree by `category`. Among the 74 the game defines: `mat_wood`, `mat_wood_soft`, `mat_vegetation`, `mat_bushes`, `mat_rock`, `mat_rock_unwalk`, `mat_rock_horse_ignore`, `mat_stairs_stone`, `mat_gravel`, `mat_soil`, `mat_mud`, `mat_grass`, `mat_road`, `mat_metal`, `mat_glass`, `mat_plaster`, `mat_thatch`, `mat_fabric`, `mat_flesh`. Empty only before the material tables are up.
1423
1444
  */
1424
1445
  surface: string;
1425
1446
 
1426
1447
  /**
1427
- * Whether the ground itself was hit rather than anything placed on it. Nothing lies behind the terrain, so a trace stops there.
1448
+ * Whether the ground itself was hit rather than anything placed on it. Nothing lies behind the terrain, so a trace stops there. The same as `kind` being `terrain`.
1428
1449
  */
1429
1450
  terrain: boolean;
1430
1451
 
1452
+ /**
1453
+ * What sort of thing the ray stopped on. `entity` is anything with an `entityClass` -- doors, props, NPCs, players. `vegetation` is an instance the level paints on: trees, bushes, plants, and boulders painted the same way. `brush` is a static mesh placed one by one: walls, houses, rocks and cliffs. `static` is static geometry that is neither, or whose source the engine does not record. Trees and rocks are not entities, so for them this, `model` and `category` are what say what was hit.
1454
+ */
1455
+ kind: "terrain" | "entity" | "vegetation" | "brush" | "static";
1456
+
1457
+ /**
1458
+ * The mesh of a vegetation instance or a brush, as the path the game loads it from -- `objects/natural/vegetation/trees/normal_trees/quercus_robur/quercus_robur_big_a.cgf`. Null for terrain, entities and `static`. A tree or a rock has no GUID, but its `model` and `position` together are the same on every client on the same level, which is what a server keeps a felled tree or a mined rock by.
1459
+ */
1460
+ model: string | null;
1461
+
1462
+ /**
1463
+ * Which of the game's own folders of natural objects `model` comes from: `tree` for `objects/natural/vegetation/trees` -- living, dead, fallen and stumps alike, which `model` tells apart -- `bush` for its bushes, `plant` for the rest of its vegetation (grass, ferns, mushrooms, branches), and `rock` for `objects/natural/rocks` and `objects/natural/stones`. Null for anything else, man-made included.
1464
+ */
1465
+ category: "tree" | "bush" | "plant" | "rock" | null;
1466
+
1467
+ /**
1468
+ * The material drawn where the ray met it, as the path the material manager keys it by, the sub-material when the mesh has several -- a trunk's bark rather than the tree's whole material. Null for terrain and when nothing names one.
1469
+ */
1470
+ material: string | null;
1471
+
1431
1472
  /**
1432
1473
  * The level's own identity for what was hit, as sixteen lowercase hex digits -- the same on every machine, and what `Door.find` and the other GUID lookups take. Null for terrain, for static geometry and for anything the session spawned, none of which the level names.
1433
1474
  */
@@ -1719,7 +1760,7 @@ declare global {
1719
1760
  *
1720
1761
  * Client-only, and nothing here is an order another machine takes. It is not invisible to the session either: in `body` mode the thing being flown is the entity this client replicates, so the other players watch the flier go. In `camera` mode the body never moves.
1721
1762
  *
1722
- * The game's controls are held for as long as the flight lasts, whichever side is driving. F7's map editor flies the same one camera: a flight in progress ends when the editor opens, and `enable` refuses while it is open.
1763
+ * The game's controls are held for as long as the flight lasts, whichever side is driving. The map editor (`MapEditor`) flies the same one camera: a flight in progress ends when the editor opens, and `enable` refuses while it is open.
1723
1764
  */
1724
1765
  const NoClip: {
1725
1766
  /**
@@ -1729,7 +1770,7 @@ declare global {
1729
1770
  * `input` is whether this machine's keyboard and mouse fly the camera -- on the keys the game's own photo mode is bound to in the controls menu (forward, back, left, right, jump to rise, crouch to sink, fast movement to boost), read through the active keyboard layout so AZERTY and the like work as the game does; Alt to crawl, mouse to turn. On by default; off, drive it with `move`.
1730
1771
  *
1731
1772
  * `speed` is metres a second at rest, 0.05 to 400 and 12 by default. `fov` is the vertical field of view in degrees, up to 140; omitted, the view keeps the game's.
1732
- * @returns `enabled` when the flight started. `alreadyActive` when one was already running -- the options are not re-applied. `noCamera` when there is no level to spawn the camera's anchor into. `cameraBusy` when F7's map editor holds the camera.
1773
+ * @returns `enabled` when the flight started. `alreadyActive` when one was already running -- the options are not re-applied. `noCamera` when there is no level to spawn the camera's anchor into. `cameraBusy` when the map editor holds the camera.
1733
1774
  */
1734
1775
  enable(options?: { mode?: "body" | "camera"; input?: boolean; speed?: number; fov?: number }): "enabled" | "alreadyActive" | "noCamera" | "cameraBusy";
1735
1776
 
@@ -1965,6 +2006,333 @@ declare global {
1965
2006
  isThirdPerson(): boolean;
1966
2007
  };
1967
2008
 
2009
+ /**
2010
+ * A position or offset in metres. Accepts plain objects and Vector3 instances.
2011
+ */
2012
+ interface GizmoPoint {
2013
+ /**
2014
+ * X coordinate.
2015
+ */
2016
+ x: number;
2017
+
2018
+ /**
2019
+ * Y coordinate.
2020
+ */
2021
+ y: number;
2022
+
2023
+ /**
2024
+ * Z coordinate.
2025
+ */
2026
+ z: number;
2027
+ }
2028
+
2029
+ /**
2030
+ * Appearance and lifetime of a client debug drawing.
2031
+ */
2032
+ interface GizmoStyle {
2033
+ /**
2034
+ * Unsigned 0xAARRGGBB color. Defaults to 0xFF6EE678 (opaque green).
2035
+ */
2036
+ color?: number | undefined;
2037
+
2038
+ /**
2039
+ * Line width in pixels, 0.5 to 8. Defaults to 1.5; polygon vertical edges use 60% of this width.
2040
+ */
2041
+ width?: number | undefined;
2042
+
2043
+ /**
2044
+ * Defaults to true: scene geometry occludes the drawing. Set false to show through walls. Drawings never write scene depth.
2045
+ */
2046
+ depthTest?: boolean | undefined;
2047
+
2048
+ /**
2049
+ * Unsigned 0xAARRGGBB fill color. Defaults to transparent (outline only). Supports boxes, spheres, circles, cones, cylinders, capsules, arrow heads and meshes. Throws for lines, polylines, grids, axes and polygon areas, which have no faces; fill a polygon with explicit mesh triangles.
2050
+ */
2051
+ fillColor?: number | undefined;
2052
+
2053
+ /**
2054
+ * Integer lifetime from 0 to 3600000 milliseconds. Zero (default) persists until removed. Replacing the drawing restarts its lifetime.
2055
+ */
2056
+ durationMs?: number | undefined;
2057
+ }
2058
+
2059
+ /**
2060
+ * Geometry from an Area.toJSON() or World Builder area export. Extra fields are ignored; this draws debug geometry and creates no trigger.
2061
+ */
2062
+ interface GizmoArea {
2063
+ /**
2064
+ * Which area geometry to draw.
2065
+ */
2066
+ type: 'box' | 'sphere' | 'shape';
2067
+
2068
+ /**
2069
+ * World origin in metres; defaults to zero.
2070
+ */
2071
+ position?: GizmoPoint | undefined;
2072
+
2073
+ /**
2074
+ * Local-to-world quaternion, normalized on input; defaults to identity. Plain {x,y,z,w} objects work.
2075
+ */
2076
+ rotation?: { x: number; y: number; z: number; w: number } | undefined;
2077
+
2078
+ /**
2079
+ * Box minimum in local space; defaults to {-1,-1,-1}. Each component must be less than max.
2080
+ */
2081
+ min?: GizmoPoint | undefined;
2082
+
2083
+ /**
2084
+ * Box maximum in local space; defaults to {1,1,1}.
2085
+ */
2086
+ max?: GizmoPoint | undefined;
2087
+
2088
+ /**
2089
+ * Required for spheres: radius in metres, greater than zero and less than 16384.
2090
+ */
2091
+ radius?: number | undefined;
2092
+
2093
+ /**
2094
+ * Required for shapes: 3 to 256 local points, forming a closed polygon.
2095
+ */
2096
+ points?: GizmoPoint[] | undefined;
2097
+
2098
+ /**
2099
+ * Shape height above its lowest transformed point, 0 to less than 16384 metres. Zero (default) draws one ring at the points' own heights.
2100
+ */
2101
+ height?: number | undefined;
2102
+ }
2103
+
2104
+ /**
2105
+ * Client debug line geometry.
2106
+ */
2107
+ interface GizmoLine {
2108
+ /**
2109
+ * Primitive kind.
2110
+ */
2111
+ type: 'line';
2112
+
2113
+ /**
2114
+ * World start.
2115
+ */
2116
+ from: GizmoPoint;
2117
+
2118
+ /**
2119
+ * World end.
2120
+ */
2121
+ to: GizmoPoint;
2122
+ }
2123
+
2124
+ /**
2125
+ * Client debug arrow geometry.
2126
+ */
2127
+ interface GizmoArrow {
2128
+ /**
2129
+ * Primitive kind.
2130
+ */
2131
+ type: 'arrow';
2132
+
2133
+ /**
2134
+ * World start.
2135
+ */
2136
+ from: GizmoPoint;
2137
+
2138
+ /**
2139
+ * World tip.
2140
+ */
2141
+ to: GizmoPoint;
2142
+
2143
+ /**
2144
+ * Head length in metres, greater than zero and no longer than the arrow. Defaults to the smaller of 0.5 and a quarter of the arrow length.
2145
+ */
2146
+ headLength?: number | undefined;
2147
+ }
2148
+
2149
+ /**
2150
+ * Client debug capsule/cone/cylinder geometry.
2151
+ */
2152
+ interface GizmoRoundVolume {
2153
+ /**
2154
+ * Primitive kind.
2155
+ */
2156
+ type: 'capsule' | 'cone' | 'cylinder';
2157
+
2158
+ /**
2159
+ * Capsule lower hemisphere center, or cone/cylinder base center.
2160
+ */
2161
+ from: GizmoPoint;
2162
+
2163
+ /**
2164
+ * Capsule upper hemisphere center, cone tip or cylinder top center. Capsule endpoints may coincide for a sphere.
2165
+ */
2166
+ to: GizmoPoint;
2167
+
2168
+ /**
2169
+ * Radius in metres, 0.001 to 16384.
2170
+ */
2171
+ radius: number;
2172
+
2173
+ /**
2174
+ * Integer radial segments, 8 to 64; default 24.
2175
+ */
2176
+ segments?: number | undefined;
2177
+ }
2178
+
2179
+ /**
2180
+ * Client debug circle geometry.
2181
+ */
2182
+ interface GizmoCircle {
2183
+ /**
2184
+ * Primitive kind.
2185
+ */
2186
+ type: 'circle';
2187
+
2188
+ /**
2189
+ * World center.
2190
+ */
2191
+ position: GizmoPoint;
2192
+
2193
+ /**
2194
+ * Non-zero plane normal; default {x:0,y:0,z:1}.
2195
+ */
2196
+ normal?: GizmoPoint | undefined;
2197
+
2198
+ /**
2199
+ * Radius in metres, 0.001 to 16384.
2200
+ */
2201
+ radius: number;
2202
+
2203
+ /**
2204
+ * Integer radial segments, 8 to 64; default 24.
2205
+ */
2206
+ segments?: number | undefined;
2207
+ }
2208
+
2209
+ /**
2210
+ * Client debug grid geometry.
2211
+ */
2212
+ interface GizmoGrid {
2213
+ /**
2214
+ * Primitive kind.
2215
+ */
2216
+ type: 'grid';
2217
+
2218
+ /**
2219
+ * World center.
2220
+ */
2221
+ position: GizmoPoint;
2222
+
2223
+ /**
2224
+ * Non-zero plane normal; default {x:0,y:0,z:1}.
2225
+ */
2226
+ normal?: GizmoPoint | undefined;
2227
+
2228
+ /**
2229
+ * Square side length in metres, 0.001 to 16384; default 10.
2230
+ */
2231
+ size?: number | undefined;
2232
+
2233
+ /**
2234
+ * Integer subdivisions on each side, 1 to 64; default 10.
2235
+ */
2236
+ divisions?: number | undefined;
2237
+ }
2238
+
2239
+ /**
2240
+ * Client debug axes geometry.
2241
+ */
2242
+ interface GizmoAxes {
2243
+ /**
2244
+ * Primitive kind.
2245
+ */
2246
+ type: 'axes';
2247
+
2248
+ /**
2249
+ * World origin.
2250
+ */
2251
+ position: GizmoPoint;
2252
+
2253
+ /**
2254
+ * Local-to-world quaternion, normalized on input; default identity.
2255
+ */
2256
+ rotation?: { x: number; y: number; z: number; w: number } | undefined;
2257
+
2258
+ /**
2259
+ * Axis length in metres, 0.001 to 16384; default 1. X is red, Y green and Z blue; these fixed colors override style.color.
2260
+ */
2261
+ size?: number | undefined;
2262
+ }
2263
+
2264
+ /**
2265
+ * Client debug polyline geometry.
2266
+ */
2267
+ interface GizmoPolyline {
2268
+ /**
2269
+ * Primitive kind.
2270
+ */
2271
+ type: 'polyline';
2272
+
2273
+ /**
2274
+ * 2 to 256 world positions.
2275
+ */
2276
+ points: GizmoPoint[];
2277
+
2278
+ /**
2279
+ * Join last to first; default false.
2280
+ */
2281
+ closed?: boolean | undefined;
2282
+ }
2283
+
2284
+ /**
2285
+ * Client debug mesh geometry.
2286
+ */
2287
+ interface GizmoMesh {
2288
+ /**
2289
+ * Primitive kind.
2290
+ */
2291
+ type: 'mesh';
2292
+
2293
+ /**
2294
+ * 3 to 1024 world positions.
2295
+ */
2296
+ points: GizmoPoint[];
2297
+
2298
+ /**
2299
+ * 3 to 3072 integer vertex indices in triangle triples, each from 0 to points.length - 1. Both triangle sides render.
2300
+ */
2301
+ indices: number[];
2302
+
2303
+ /**
2304
+ * Draw triangle edges with style.color and width; default true. Set fillColor to draw faces.
2305
+ */
2306
+ wireframe?: boolean | undefined;
2307
+ }
2308
+
2309
+ /**
2310
+ * Resource-owned native debug geometry visible only on this client, without opening World Builder. Scene depth testing is on by default; depthTest: false opts out. Stop/error, disconnect and moving to another level clear drawings; reloading a save of the same level keeps them. No replication or input capture.
2311
+ */
2312
+ const Gizmos: {
2313
+ /**
2314
+ * Creates or replaces a named primitive owned by this resource. Finite input coordinates within +/-16384 metres. IDs are 1 to 128 UTF-8 bytes. Limit: 128 IDs per resource, 16384 geometry units across resources (one per line, three per triangle). Throws on invalid input or budget overflow and preserves the previous drawing. Copies geometry and reapplies style defaults; use setTransform to move it.
2315
+ */
2316
+ set(id: string, primitive: GizmoArea | GizmoLine | GizmoArrow | GizmoRoundVolume | GizmoCircle | GizmoGrid | GizmoAxes | GizmoPolyline | GizmoMesh, style?: GizmoStyle): void;
2317
+
2318
+ /**
2319
+ * Moves this resource's named drawing without rebuilding it: every authored point p is drawn at position + rotation * p. Author the geometry around the origin to move it as a whole. The rotation is normalized and defaults to identity. set() resets the transform to identity.
2320
+ * @returns True if the drawing exists; false if this resource has no drawing with that ID.
2321
+ */
2322
+ setTransform(id: string, position: GizmoPoint, rotation?: { x: number; y: number; z: number; w: number }): boolean;
2323
+
2324
+ /**
2325
+ * Removes this resource's named drawing. Throws for an invalid ID or unknown resource.
2326
+ * @returns True if removed; false if this resource has no drawing with that ID.
2327
+ */
2328
+ remove(id: string): boolean;
2329
+
2330
+ /**
2331
+ * Removes all drawings owned by this resource. Other resources are unaffected. Throws if the caller's resource cannot be identified.
2332
+ */
2333
+ clear(): void;
2334
+ };
2335
+
1968
2336
  /**
1969
2337
  * The box a ghost occupies, in world space.
1970
2338
  */
@@ -2168,6 +2536,37 @@ declare global {
2168
2536
  on(event: "move" | "confirm" | "rejected" | "cancel" | "end", handler: PlacementHandler<PlacementPose>): Unsubscribe;
2169
2537
  };
2170
2538
 
2539
+ /**
2540
+ * The world builder: a free camera, the game's mesh catalog as an asset library, a placement brush, a gizmo that moves anything, and maps saved to and loaded from files.
2541
+ *
2542
+ * No key opens it. A resource decides when it does, and only on a server whose `server.json` sets `mod.map_editor` to true; anywhere else `open` refuses. While it is open it holds the one free camera, so a `NoClip` flight in progress ends and `NoClip.enable` refuses. The player can still close it from its own window.
2543
+ */
2544
+ const MapEditor: {
2545
+ /**
2546
+ * Opens the editor.
2547
+ * @returns `opened` when it opened. `alreadyOpen` when it was open already. `disabled` when the server has not turned `mod.map_editor` on, which includes no session at all.
2548
+ */
2549
+ open(): "opened" | "alreadyOpen" | "disabled";
2550
+
2551
+ /**
2552
+ * Closes the editor and hands the camera back. Doing nothing when it is closed is not an error.
2553
+ * @returns Nothing.
2554
+ */
2555
+ close(): void;
2556
+
2557
+ /**
2558
+ * Whether the editor is open at this client.
2559
+ * @returns True while it is open.
2560
+ */
2561
+ isOpen(): boolean;
2562
+
2563
+ /**
2564
+ * Whether the connected server lets the editor open.
2565
+ * @returns True when its `server.json` sets `mod.map_editor` to true.
2566
+ */
2567
+ isEnabled(): boolean;
2568
+ };
2569
+
2171
2570
  /**
2172
2571
  * A screen composed inside one of the game's own Scaleform movies.
2173
2572
  */
@@ -2560,6 +2959,20 @@ declare global {
2560
2959
  * The game's own Scaleform UI, opened from script. This is the second way to draw a UI at this client, beside `Web`: a web view is a browser and lays out anything, a native screen is composed out of the game's own movies, sits inside the game's own layer stack and is navigable with a controller.
2561
2960
  */
2562
2961
  const NativeUI: {
2962
+ /**
2963
+ * Prevents a vanilla menu from opening or being selected through native navigation. An already-open disabled menu closes on the next client tick. Requests are idempotent and resource-owned: a menu stays disabled while any resource disables it. Restrictions clear when the resource stops or the session ends. Key bindings are unchanged. Tab labels remain in the native screen. The custom character creator can still use the player stage.
2964
+ * @param menu The vanilla menu, including its detail pages.
2965
+ * @param enabled False prevents opening the menu; true releases this resource's restriction. All menus are enabled by default.
2966
+ */
2967
+ setMenuEnabled(menu: "inventory" | "player" | "map" | "codex" | "journal" | "crafting", enabled: boolean): void;
2968
+
2969
+ /**
2970
+ * Whether every resource permits this vanilla menu. Native gameplay rules may still prevent it from opening. Throws for unknown menu names.
2971
+ * @param menu The vanilla menu to query.
2972
+ * @returns True when no resource disables the menu.
2973
+ */
2974
+ isMenuEnabled(menu: "inventory" | "player" | "map" | "codex" | "journal" | "crafting"): boolean;
2975
+
2563
2976
  /**
2564
2977
  * Opens a screen. It is composed a few frames later, when its movie reports ready -- listen for `ready` rather than drawing into it straight away.
2565
2978
  * @param options `library` names which of the game's movies the screen may attach exported sprites from, empty for the default. `movie` is a path inside this resource to a movie it ships, which opens a screen in that instead. `assets` are further files that movie loads, and `layer` is where it sits in the game's own stack.
@@ -2722,32 +3135,32 @@ declare global {
2722
3135
  /**
2723
3136
  * The object in the player's hands: a red-covered book (the default), a plain-covered one, or a folded letter.
2724
3137
  */
2725
- style: "book" | "plainBook" | "letter" | undefined;
3138
+ style?: "book" | "plainBook" | "letter" | undefined;
2726
3139
 
2727
3140
  /**
2728
3141
  * The layout the movie uses, by `document_class` id: 1 book (the default), 2 recipe, 3 skill book, 4 map, 5 letter (the default for `letter`), 6 plan.
2729
3142
  */
2730
- type: number | undefined;
3143
+ type?: number | undefined;
2731
3144
 
2732
3145
  /**
2733
3146
  * How ornate the pages are, 1 plain to 7 embellished. Defaults to 1.
2734
3147
  */
2735
- visual: number | undefined;
3148
+ visual?: number | undefined;
2736
3149
 
2737
3150
  /**
2738
3151
  * How much of the text can be read, 0 to 1; values outside are clamped. Defaults to 1, fully legible. Below 1 the movie swaps letters for look-alike glyphs, the same effect a vanilla book shows a player with low reading skill. It works in tenths: each step brings roughly another tenth of the character classes back, so 0.31 and 0.39 look the same. The substitution is deterministic -- the same text at the same level always reads the same way -- and markup is never touched.
2739
3152
  */
2740
- legibility: number | undefined;
3153
+ legibility?: number | undefined;
2741
3154
 
2742
3155
  /**
2743
3156
  * A picture `Book.image` returned, replacing the carrier's own diffuse texture: the paper and the cover together, which the model maps from one atlas. Paint it over the vanilla atlas to keep the UV layout -- `Objects/manmade/task_specific_props/read_and_write/books/book_alchemy_diff.dds` for the two book styles, `.../scrolls/scroll_diff.dds` for `letter`. The material's diffuse colour multiplies it: `book` darkens it to about 78% and `letter` to about 72%, while `plainBook` shows it as painted. It applies to this book's own copy of the material only, and goes with the book.
2744
3157
  */
2745
- texture: string | undefined;
3158
+ texture?: string | undefined;
2746
3159
 
2747
3160
  /**
2748
3161
  * Pictures for the skill-book and map layouts. Inline pictures go in the page text as `<img>` instead.
2749
3162
  */
2750
- images: BookPageImage[] | undefined;
3163
+ images?: BookPageImage[] | undefined;
2751
3164
  }
2752
3165
 
2753
3166
  /**
@@ -2807,17 +3220,17 @@ declare global {
2807
3220
  /**
2808
3221
  * The look the stage starts on. Left out, it starts on the first gender offered with every part left to the figure -- the player's own look on the man, the game's default on the woman.
2809
3222
  */
2810
- appearance: Appearance | undefined;
3223
+ appearance?: Appearance | undefined;
2811
3224
 
2812
3225
  /**
2813
3226
  * Which bodies the player may choose between; `both` (the default) lets them switch.
2814
3227
  */
2815
- genders: "male" | "female" | "both" | undefined;
3228
+ genders?: "male" | "female" | "both" | undefined;
2816
3229
 
2817
3230
  /**
2818
3231
  * The panel's heading, at most 64 bytes. Defaults to `Character`.
2819
3232
  */
2820
- title: string | undefined;
3233
+ title?: string | undefined;
2821
3234
  }
2822
3235
 
2823
3236
  /**
@@ -4204,6 +4617,13 @@ declare global {
4204
4617
  * Client-only, resource-owned physical key bindings exposed as the global Key.
4205
4618
  */
4206
4619
  const Key: {
4620
+ /**
4621
+ * Returns the current layout's label for a physical key, even while UI owns input. Query again when refreshing prompts. Throws for unknown keys or non-string arguments.
4622
+ * @param key Case-insensitive physical key name, using the same names as bind.
4623
+ * @returns Uppercase printable text, or an English name such as Enter or Mouse 1. Falls back to the uppercase canonical key name when translation is unavailable.
4624
+ */
4625
+ getLabel(key: string): string;
4626
+
4207
4627
  /**
4208
4628
  * Binds a resource-owned handler that fires while the game has foreground input and no UI is capturing it.
4209
4629
  * @param key Case-insensitive supported keyboard or mouse key name.