s2cfgtojson 1.0.0 → 1.0.1
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/Struct.mts +3 -0
- package/package.json +1 -1
- package/readme.md +7 -1
package/Struct.mts
CHANGED
|
@@ -197,6 +197,9 @@ export abstract class Struct<T extends Entries = {}> {
|
|
|
197
197
|
const stack = [];
|
|
198
198
|
while (index < lines.length) {
|
|
199
199
|
const line = lines[index++].trim();
|
|
200
|
+
if (line.startsWith("#") || line.startsWith("//")) {
|
|
201
|
+
continue; // Skip comments
|
|
202
|
+
}
|
|
200
203
|
const current = stack[stack.length - 1];
|
|
201
204
|
if (line.includes("struct.begin")) {
|
|
202
205
|
const newStruct = parseHead(line);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -18,6 +18,12 @@ A utility to convert Stalker 2 `.cfg` configuration files into structured JavaSc
|
|
|
18
18
|
- npm (or pnpm/yarn)
|
|
19
19
|
|
|
20
20
|
### Installation
|
|
21
|
+
In your project directory, run:
|
|
22
|
+
```bash
|
|
23
|
+
npm install s2cfgtojson
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or, if you checked out the repository, you can install dependencies directly:
|
|
21
27
|
```bash
|
|
22
28
|
npm install
|
|
23
29
|
```
|
|
@@ -47,7 +53,7 @@ BasePhantomAttack : struct.begin {refkey=BaseAttackAbility}
|
|
|
47
53
|
struct.end
|
|
48
54
|
`;
|
|
49
55
|
const parsed = Struct.fromString(configText)[0];
|
|
50
|
-
console.log(parsed.
|
|
56
|
+
console.log(parsed.entries.TriggeredCooldowns);
|
|
51
57
|
```
|
|
52
58
|
|
|
53
59
|
---
|