@s2script/sdk 0.35.0 → 0.36.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 (2) hide show
  1. package/package.json +1 -1
  2. package/sound.d.ts +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s2script/sdk",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "description": "s2script SDK — the builtin capability types (imported as @s2script/sdk/entity, …) plus the `s2s` CLI for building Source 2 / CS2 plugins.",
6
6
  "type": "module",
package/sound.d.ts CHANGED
@@ -73,6 +73,19 @@ export interface PrecacheContext {
73
73
  * precache, and its resources stay unusable until the next map change.
74
74
  */
75
75
  add(path: string): boolean;
76
+ /**
77
+ * Precache an entity class: everything that class needs to spawn (its models, particles and
78
+ * soundevents, and the classes it precaches in turn), the same precache the engine runs for each
79
+ * entity a map spawns. Use it for a class the map doesn't already contain, before you create one.
80
+ *
81
+ * @example
82
+ * pc.addEntity("chicken");
83
+ * pc.addEntity("prop_physics_multiplayer");
84
+ *
85
+ * Returns true when the engine ran the class's precache. It does not check the class name: an
86
+ * unknown class precaches nothing and still returns true. Same TIMING rule as {@link add}.
87
+ */
88
+ addEntity(classname: string): boolean;
76
89
  }
77
90
 
78
91
  /**