charinfo-ex 0.0.2 → 0.0.5

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/CHANGELOG.md CHANGED
@@ -1,9 +1,29 @@
1
- # Changelog
2
-
3
- ## [0.0.2] - 2026-04-09
4
-
5
- - Fix array loop having wrong value
6
-
7
- ## [0.0.1] - 2026-04-09
8
-
9
- - I made the thing.
1
+ # Changelog
2
+
3
+ ## [0.0.5] - 2026-04-10
4
+
5
+ - Add reading support for ShareMii .ltd files that probably works
6
+
7
+
8
+ ## [0.0.4] - 2026-04-10
9
+
10
+ - Add the color array and color order data.
11
+ - Add turning CharInfoEx back into a ArrayBuffer
12
+ - Add support for both cjs and esm
13
+
14
+ - Fix some weirdly named fields
15
+
16
+
17
+ ## [0.0.3] - 2026-04-09
18
+
19
+ - Add `fromJson` to return `CharInfoEx | CharInfoEx[]`.
20
+
21
+
22
+ ## [0.0.2] - 2026-04-09
23
+
24
+ - Fix array loop having wrong value
25
+
26
+
27
+ ## [0.0.1] - 2026-04-09
28
+
29
+ - I made the thing.
package/README.md CHANGED
@@ -8,8 +8,8 @@
8
8
 
9
9
  From Save File
10
10
  ```js
11
- import fs from 'fs';
12
- import { CharInfoEx } from '../src/index';
11
+ import fs from 'fs';
12
+ import { CharInfoEx } from 'charinfo-ex';
13
13
 
14
14
  var data = fs.readFileSync('./test/mii.sav');
15
15
  var act = CharInfoEx.FromSaveFileArrayBuffer(data.buffer, 1);
@@ -0,0 +1,608 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/CharInfoEx.ts
21
+ var CharInfoEx_exports = {};
22
+ __export(CharInfoEx_exports, {
23
+ CharInfoEx: () => CharInfoEx
24
+ });
25
+ module.exports = __toCommonJS(CharInfoEx_exports);
26
+
27
+ // src/Helpers.ts
28
+ function getStringUTF16NullTerminated(data, offset, maxChars, littleEndian = true) {
29
+ const chars = [];
30
+ for (let i = 0; i < maxChars; i++) {
31
+ const codeUnit = data.getUint16(offset, littleEndian);
32
+ offset += 2;
33
+ if (codeUnit === 0) {
34
+ offset += (maxChars - i - 1) * 2;
35
+ break;
36
+ }
37
+ chars.push(codeUnit);
38
+ }
39
+ return String.fromCharCode(...chars);
40
+ }
41
+
42
+ // src/CharInfoEx.ts
43
+ var CharInfoEx = class _CharInfoEx {
44
+ constructor() {
45
+ }
46
+ static bytesToUuidV4(bytes) {
47
+ const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
48
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`;
49
+ }
50
+ static uuidV4ToBytes(uuid) {
51
+ const out = new Uint8Array(16);
52
+ const hex = (uuid || "").replace(/-/g, "").toLowerCase();
53
+ if (!/^[0-9a-f]{32}$/.test(hex)) {
54
+ return out;
55
+ }
56
+ for (let i = 0; i < 16; i++) {
57
+ out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
58
+ }
59
+ return out;
60
+ }
61
+ static writeStringUTF16Fixed(data, offset, maxChars, value, littleEndian = true) {
62
+ const text = value ?? "";
63
+ for (let i = 0; i < maxChars; i++) {
64
+ const codeUnit = i < text.length ? text.charCodeAt(i) : 0;
65
+ data.setUint16(offset + i * 2, codeUnit, littleEndian);
66
+ }
67
+ }
68
+ static FromShareMiiFileArrayBuffer(saveBuffer) {
69
+ var data = new DataView(saveBuffer);
70
+ let offset = 5;
71
+ const len = data.getUint32(offset, true);
72
+ offset += 4;
73
+ const charInfo = _CharInfoEx.FromArrayBuffer(saveBuffer.slice(offset, offset + len));
74
+ return charInfo;
75
+ }
76
+ static FromSaveFileArrayBuffer(saveBuffer, index = void 0) {
77
+ var infoExHash = 2283577978;
78
+ var data = new DataView(saveBuffer);
79
+ var dataOffset = data.getUint32(8, true);
80
+ var offset = 40;
81
+ var exPosition = 0;
82
+ while (offset < dataOffset) {
83
+ var hash = data.getUint32(offset, true);
84
+ offset += 4;
85
+ var currentOffset = data.getUint32(offset, true);
86
+ offset += 4;
87
+ if (hash === infoExHash) {
88
+ exPosition = currentOffset;
89
+ }
90
+ }
91
+ var entryPositionCount = data.getUint32(exPosition, true);
92
+ exPosition += 4;
93
+ const charArray = [];
94
+ for (let index2 = 0; index2 < entryPositionCount; index2++) {
95
+ const len = data.getUint32(exPosition, true);
96
+ exPosition += 4;
97
+ const charInfo = _CharInfoEx.FromArrayBuffer(saveBuffer.slice(exPosition, exPosition + len));
98
+ exPosition += len;
99
+ charArray.push(charInfo);
100
+ }
101
+ if (!index) {
102
+ return charArray;
103
+ }
104
+ if (Array.isArray(index)) {
105
+ return index.map((v) => charArray[v - 1]);
106
+ } else {
107
+ return charArray[index - 1];
108
+ }
109
+ }
110
+ static FromArrayLike(arrayLike) {
111
+ var data = Uint8Array.from(arrayLike);
112
+ return _CharInfoEx.FromArrayBuffer(data.buffer);
113
+ }
114
+ static FromArrayBuffer(buffer) {
115
+ const charItem = new _CharInfoEx();
116
+ const dataView = new DataView(buffer);
117
+ const u8 = (offset) => dataView.getUint8(offset);
118
+ const u16 = (offset) => dataView.getUint16(offset, true);
119
+ const idBytes = new Uint8Array(buffer, 0 /* createId1 */, 16);
120
+ charItem.uuidv4 = _CharInfoEx.bytesToUuidV4(idBytes);
121
+ charItem.name = getStringUTF16NullTerminated(dataView, 16 /* name */, 11);
122
+ charItem.fontRegion = u8(38 /* fontRegion */);
123
+ charItem.gender = u8(39 /* gender */);
124
+ charItem.height = u8(40 /* height */);
125
+ charItem.build = u8(41 /* build */);
126
+ charItem.regionMove = u8(42 /* regionMove */);
127
+ charItem.faceFlags = u8(43 /* faceFlags */);
128
+ charItem.facelineType = u8(44 /* facelineType */);
129
+ charItem.facelineColor = u8(45 /* facelineColor */);
130
+ charItem.wrinkleLowerType = u8(46 /* wrinkleLowerType */);
131
+ charItem.wrinkleLowerScale = u8(47 /* wrinkleLowerScale */);
132
+ charItem.wrinkleLowerAspect = u8(48 /* wrinkleLowerAspect */);
133
+ charItem.wrinkleLowerX = u8(49 /* wrinkleLowerX */);
134
+ charItem.wrinkleLowerY = u8(50 /* wrinkleLowerY */);
135
+ charItem.wrinkleUpperType = u8(51 /* wrinkleUpperType */);
136
+ charItem.wrinkleUpperScale = u8(52 /* wrinkleUpperScale */);
137
+ charItem.wrinkleUpperAspect = u8(53 /* wrinkleUpperAspect */);
138
+ charItem.wrinkleUpperX = u8(54 /* wrinkleUpperX */);
139
+ charItem.wrinkleUpperY = u8(55 /* wrinkleUpperY */);
140
+ charItem.makeup0 = u8(56 /* makeup0 */);
141
+ charItem.makeup0Color = u8(57 /* makeup0Color */);
142
+ charItem.makeup0Scale = u8(58 /* makeup0Scale */);
143
+ charItem.makeup0Aspect = u8(59 /* makeup0Aspect */);
144
+ charItem.makeup0X = u8(60 /* makeup0X */);
145
+ charItem.makeup0Y = u8(61 /* makeup0Y */);
146
+ charItem.makeup1 = u8(62 /* makeup1 */);
147
+ charItem.makeup1Color = u8(63 /* makeup1Color */);
148
+ charItem.makeup1Scale = u8(64 /* makeup1Scale */);
149
+ charItem.makeup1Aspect = u8(65 /* makeup1Aspect */);
150
+ charItem.makeup1X = u8(66 /* makeup1X */);
151
+ charItem.makeup1Y = u8(67 /* makeup1Y */);
152
+ charItem.hairType = u16(68 /* hairType */);
153
+ charItem.hairColor0 = u8(70 /* hairColor0 */);
154
+ charItem.hairColor1 = u8(71 /* hairColor1 */);
155
+ charItem.hairTypeFront = u8(72 /* hairTypeFront */);
156
+ charItem.hairTypeBack = u8(73 /* hairTypeBack */);
157
+ charItem.hairStyle = u8(74 /* hairStyle */);
158
+ charItem.earType = u8(75 /* earType */);
159
+ charItem.earScale = u8(76 /* earScale */);
160
+ charItem.earY = u8(77 /* earY */);
161
+ charItem.eyeType = u8(78 /* eyeType */);
162
+ charItem.eyeColor = u8(79 /* eyeColor */);
163
+ charItem.eyeScale = u8(80 /* eyeScale */);
164
+ charItem.eyeAspect = u8(81 /* eyeAspect */);
165
+ charItem.eyeRotate = u8(82 /* eyeRotate */);
166
+ charItem.eyeX = u8(83 /* eyeX */);
167
+ charItem.eyeY = u8(84 /* eyeY */);
168
+ charItem.eyeShadowColor = u8(85 /* eyeShadowColor */);
169
+ charItem.eyeHighlightType = u8(86 /* eyeHighlightType */);
170
+ charItem.eyeHighlightScale = u8(87 /* eyeHighlightScale */);
171
+ charItem.eyeHighlightAspect = u8(88 /* eyeHighlightAspect */);
172
+ charItem.eyeHighlightRotate = u8(89 /* eyeHighlightRotate */);
173
+ charItem.eyeHighlightX = u8(90 /* eyeHighlightX */);
174
+ charItem.eyeHighlightY = u8(91 /* eyeHighlightY */);
175
+ charItem.eyelashUpperType = u8(92 /* eyelashUpperType */);
176
+ charItem.eyelashUpperScale = u8(93 /* eyelashUpperScale */);
177
+ charItem.eyelashUpperAspect = u8(94 /* eyelashUpperAspect */);
178
+ charItem.eyelashUpperRotate = u8(95 /* eyelashUpperRotate */);
179
+ charItem.eyelashUpperX = u8(96 /* eyelashUpperX */);
180
+ charItem.eyelashUpperY = u8(97 /* eyelashUpperY */);
181
+ charItem.eyelashLowerType = u8(98 /* eyelashLowerType */);
182
+ charItem.eyelashLowerScale = u8(99 /* eyelashLowerScale */);
183
+ charItem.eyelashLowerAspect = u8(100 /* eyelashLowerAspect */);
184
+ charItem.eyelashLowerRotate = u8(101 /* eyelashLowerRotate */);
185
+ charItem.eyelashLowerX = u8(102 /* eyelashLowerX */);
186
+ charItem.eyelashLowerY = u8(103 /* eyelashLowerY */);
187
+ charItem.eyelidUpperType = u8(104 /* eyelidUpperType */);
188
+ charItem.eyelidUpperScale = u8(105 /* eyelidUpperScale */);
189
+ charItem.eyelidUpperAspect = u8(106 /* eyelidUpperAspect */);
190
+ charItem.eyelidUpperRotate = u8(107 /* eyelidUpperRotate */);
191
+ charItem.eyelidUpperX = u8(108 /* eyelidUpperX */);
192
+ charItem.eyelidUpperY = u8(109 /* eyelidUpperY */);
193
+ charItem.eyelidLowerType = u8(110 /* eyelidLowerType */);
194
+ charItem.eyelidLowerScale = u8(111 /* eyelidLowerScale */);
195
+ charItem.eyelidLowerAspect = u8(112 /* eyelidLowerAspect */);
196
+ charItem.eyelidLowerRotate = u8(113 /* eyelidLowerRotate */);
197
+ charItem.eyelidLowerX = u8(114 /* eyelidLowerX */);
198
+ charItem.eyelidLowerY = u8(115 /* eyelidLowerY */);
199
+ charItem.eyebrowType = u8(116 /* eyebrowType */);
200
+ charItem.eyebrowColor = u8(117 /* eyebrowColor */);
201
+ charItem.eyebrowScale = u8(118 /* eyebrowScale */);
202
+ charItem.eyebrowAspect = u8(119 /* eyebrowAspect */);
203
+ charItem.eyebrowRotate = u8(120 /* eyebrowRotate */);
204
+ charItem.eyebrowX = u8(121 /* eyebrowX */);
205
+ charItem.eyebrowY = u8(122 /* eyebrowY */);
206
+ charItem.noseType = u8(123 /* noseType */);
207
+ charItem.noseScale = u8(124 /* noseScale */);
208
+ charItem.noseY = u8(125 /* noseY */);
209
+ charItem.mouthType = u8(126 /* mouthType */);
210
+ charItem.mouthColor = u8(127 /* mouthColor */);
211
+ charItem.mouthScale = u8(128 /* mouthScale */);
212
+ charItem.mouthAspect = u8(129 /* mouthAspect */);
213
+ charItem.mouthRotate = u8(130 /* mouthRotate */);
214
+ charItem.mouthY = u8(131 /* mouthY */);
215
+ charItem.beardType = u8(132 /* beardType */);
216
+ charItem.beardColor = u8(133 /* beardColor */);
217
+ charItem.beardShortType = u8(134 /* beardShortType */);
218
+ charItem.beardShortColor = u8(135 /* beardShortColor */);
219
+ charItem.mustacheType = u8(136 /* mustacheType */);
220
+ charItem.mustacheColor = u8(137 /* mustacheColor */);
221
+ charItem.mustacheScale = u8(138 /* mustacheScale */);
222
+ charItem.mustacheAspect = u8(139 /* mustacheAspect */);
223
+ charItem.mustacheY = u8(140 /* mustacheY */);
224
+ charItem.glassType1 = u8(141 /* glassType1 */);
225
+ charItem.glassColor1 = u8(142 /* glassColor1 */);
226
+ charItem.glassScale = u8(143 /* glassScale */);
227
+ charItem.glassAspect = u8(144 /* glassAspect */);
228
+ charItem.glassY = u8(145 /* glassY */);
229
+ charItem.glassType2 = u8(146 /* glassType2 */);
230
+ charItem.glassColor2 = u8(147 /* glassColor2 */);
231
+ charItem.moleScale = u8(148 /* moleScale */);
232
+ charItem.moleX = u8(149 /* moleX */);
233
+ charItem.moleY = u8(150 /* moleY */);
234
+ charItem.unkDefault45 = u8(151 /* unkDefault45 */);
235
+ return charItem;
236
+ }
237
+ ToArrayBuffer() {
238
+ const buffer = new ArrayBuffer(152);
239
+ const dataView = new DataView(buffer);
240
+ const u8 = (offset, value) => dataView.setUint8(offset, value & 255);
241
+ const u16 = (offset, value) => dataView.setUint16(offset, value & 65535, true);
242
+ new Uint8Array(buffer, 0 /* createId1 */, 16).set(_CharInfoEx.uuidV4ToBytes(this.uuidv4));
243
+ _CharInfoEx.writeStringUTF16Fixed(dataView, 16 /* name */, 11, this.name);
244
+ u8(38 /* fontRegion */, this.fontRegion);
245
+ u8(39 /* gender */, this.gender);
246
+ u8(40 /* height */, this.height);
247
+ u8(41 /* build */, this.build);
248
+ u8(42 /* regionMove */, this.regionMove);
249
+ u8(43 /* faceFlags */, this.faceFlags);
250
+ u8(44 /* facelineType */, this.facelineType);
251
+ u8(45 /* facelineColor */, this.facelineColor);
252
+ u8(46 /* wrinkleLowerType */, this.wrinkleLowerType);
253
+ u8(47 /* wrinkleLowerScale */, this.wrinkleLowerScale);
254
+ u8(48 /* wrinkleLowerAspect */, this.wrinkleLowerAspect);
255
+ u8(49 /* wrinkleLowerX */, this.wrinkleLowerX);
256
+ u8(50 /* wrinkleLowerY */, this.wrinkleLowerY);
257
+ u8(51 /* wrinkleUpperType */, this.wrinkleUpperType);
258
+ u8(52 /* wrinkleUpperScale */, this.wrinkleUpperScale);
259
+ u8(53 /* wrinkleUpperAspect */, this.wrinkleUpperAspect);
260
+ u8(54 /* wrinkleUpperX */, this.wrinkleUpperX);
261
+ u8(55 /* wrinkleUpperY */, this.wrinkleUpperY);
262
+ u8(56 /* makeup0 */, this.makeup0);
263
+ u8(57 /* makeup0Color */, this.makeup0Color);
264
+ u8(58 /* makeup0Scale */, this.makeup0Scale);
265
+ u8(59 /* makeup0Aspect */, this.makeup0Aspect);
266
+ u8(60 /* makeup0X */, this.makeup0X);
267
+ u8(61 /* makeup0Y */, this.makeup0Y);
268
+ u8(62 /* makeup1 */, this.makeup1);
269
+ u8(63 /* makeup1Color */, this.makeup1Color);
270
+ u8(64 /* makeup1Scale */, this.makeup1Scale);
271
+ u8(65 /* makeup1Aspect */, this.makeup1Aspect);
272
+ u8(66 /* makeup1X */, this.makeup1X);
273
+ u8(67 /* makeup1Y */, this.makeup1Y);
274
+ u16(68 /* hairType */, this.hairType);
275
+ u8(70 /* hairColor0 */, this.hairColor0);
276
+ u8(71 /* hairColor1 */, this.hairColor1);
277
+ u8(72 /* hairTypeFront */, this.hairTypeFront);
278
+ u8(73 /* hairTypeBack */, this.hairTypeBack);
279
+ u8(74 /* hairStyle */, this.hairStyle);
280
+ u8(75 /* earType */, this.earType);
281
+ u8(76 /* earScale */, this.earScale);
282
+ u8(77 /* earY */, this.earY);
283
+ u8(78 /* eyeType */, this.eyeType);
284
+ u8(79 /* eyeColor */, this.eyeColor);
285
+ u8(80 /* eyeScale */, this.eyeScale);
286
+ u8(81 /* eyeAspect */, this.eyeAspect);
287
+ u8(82 /* eyeRotate */, this.eyeRotate);
288
+ u8(83 /* eyeX */, this.eyeX);
289
+ u8(84 /* eyeY */, this.eyeY);
290
+ u8(85 /* eyeShadowColor */, this.eyeShadowColor);
291
+ u8(86 /* eyeHighlightType */, this.eyeHighlightType);
292
+ u8(87 /* eyeHighlightScale */, this.eyeHighlightScale);
293
+ u8(88 /* eyeHighlightAspect */, this.eyeHighlightAspect);
294
+ u8(89 /* eyeHighlightRotate */, this.eyeHighlightRotate);
295
+ u8(90 /* eyeHighlightX */, this.eyeHighlightX);
296
+ u8(91 /* eyeHighlightY */, this.eyeHighlightY);
297
+ u8(92 /* eyelashUpperType */, this.eyelashUpperType);
298
+ u8(93 /* eyelashUpperScale */, this.eyelashUpperScale);
299
+ u8(94 /* eyelashUpperAspect */, this.eyelashUpperAspect);
300
+ u8(95 /* eyelashUpperRotate */, this.eyelashUpperRotate);
301
+ u8(96 /* eyelashUpperX */, this.eyelashUpperX);
302
+ u8(97 /* eyelashUpperY */, this.eyelashUpperY);
303
+ u8(98 /* eyelashLowerType */, this.eyelashLowerType);
304
+ u8(99 /* eyelashLowerScale */, this.eyelashLowerScale);
305
+ u8(100 /* eyelashLowerAspect */, this.eyelashLowerAspect);
306
+ u8(101 /* eyelashLowerRotate */, this.eyelashLowerRotate);
307
+ u8(102 /* eyelashLowerX */, this.eyelashLowerX);
308
+ u8(103 /* eyelashLowerY */, this.eyelashLowerY);
309
+ u8(104 /* eyelidUpperType */, this.eyelidUpperType);
310
+ u8(105 /* eyelidUpperScale */, this.eyelidUpperScale);
311
+ u8(106 /* eyelidUpperAspect */, this.eyelidUpperAspect);
312
+ u8(107 /* eyelidUpperRotate */, this.eyelidUpperRotate);
313
+ u8(108 /* eyelidUpperX */, this.eyelidUpperX);
314
+ u8(109 /* eyelidUpperY */, this.eyelidUpperY);
315
+ u8(110 /* eyelidLowerType */, this.eyelidLowerType);
316
+ u8(111 /* eyelidLowerScale */, this.eyelidLowerScale);
317
+ u8(112 /* eyelidLowerAspect */, this.eyelidLowerAspect);
318
+ u8(113 /* eyelidLowerRotate */, this.eyelidLowerRotate);
319
+ u8(114 /* eyelidLowerX */, this.eyelidLowerX);
320
+ u8(115 /* eyelidLowerY */, this.eyelidLowerY);
321
+ u8(116 /* eyebrowType */, this.eyebrowType);
322
+ u8(117 /* eyebrowColor */, this.eyebrowColor);
323
+ u8(118 /* eyebrowScale */, this.eyebrowScale);
324
+ u8(119 /* eyebrowAspect */, this.eyebrowAspect);
325
+ u8(120 /* eyebrowRotate */, this.eyebrowRotate);
326
+ u8(121 /* eyebrowX */, this.eyebrowX);
327
+ u8(122 /* eyebrowY */, this.eyebrowY);
328
+ u8(123 /* noseType */, this.noseType);
329
+ u8(124 /* noseScale */, this.noseScale);
330
+ u8(125 /* noseY */, this.noseY);
331
+ u8(126 /* mouthType */, this.mouthType);
332
+ u8(127 /* mouthColor */, this.mouthColor);
333
+ u8(128 /* mouthScale */, this.mouthScale);
334
+ u8(129 /* mouthAspect */, this.mouthAspect);
335
+ u8(130 /* mouthRotate */, this.mouthRotate);
336
+ u8(131 /* mouthY */, this.mouthY);
337
+ u8(132 /* beardType */, this.beardType);
338
+ u8(133 /* beardColor */, this.beardColor);
339
+ u8(134 /* beardShortType */, this.beardShortType);
340
+ u8(135 /* beardShortColor */, this.beardShortColor);
341
+ u8(136 /* mustacheType */, this.mustacheType);
342
+ u8(137 /* mustacheColor */, this.mustacheColor);
343
+ u8(138 /* mustacheScale */, this.mustacheScale);
344
+ u8(139 /* mustacheAspect */, this.mustacheAspect);
345
+ u8(140 /* mustacheY */, this.mustacheY);
346
+ u8(141 /* glassType1 */, this.glassType1);
347
+ u8(142 /* glassColor1 */, this.glassColor1);
348
+ u8(143 /* glassScale */, this.glassScale);
349
+ u8(144 /* glassAspect */, this.glassAspect);
350
+ u8(145 /* glassY */, this.glassY);
351
+ u8(146 /* glassType2 */, this.glassType2);
352
+ u8(147 /* glassColor2 */, this.glassColor2);
353
+ u8(148 /* moleScale */, this.moleScale);
354
+ u8(149 /* moleX */, this.moleX);
355
+ u8(150 /* moleY */, this.moleY);
356
+ u8(151 /* unkDefault45 */, this.unkDefault45);
357
+ return buffer;
358
+ }
359
+ static ToArrayBuffer(charInfo) {
360
+ return charInfo.ToArrayBuffer();
361
+ }
362
+ toJson(pretty = true) {
363
+ if (pretty) {
364
+ return JSON.stringify(this, null, 4);
365
+ } else {
366
+ return JSON.stringify(this);
367
+ }
368
+ }
369
+ static fromJson(jsonString) {
370
+ const parsed = JSON.parse(jsonString);
371
+ if (Array.isArray(parsed)) {
372
+ return parsed.map((item) => Object.assign(new _CharInfoEx(), item));
373
+ }
374
+ return Object.assign(new _CharInfoEx(), parsed);
375
+ }
376
+ uuidv4 = "";
377
+ name = "";
378
+ // utf16 - 11 char
379
+ fontRegion = 0;
380
+ gender = 0;
381
+ // u8
382
+ height = 0;
383
+ // u8
384
+ build = 0;
385
+ // u8
386
+ regionMove = 0;
387
+ // u8
388
+ faceFlags = 0;
389
+ // u8
390
+ facelineType = 0;
391
+ // u8
392
+ facelineColor = 0;
393
+ // u8
394
+ wrinkleLowerType = 0;
395
+ // u8
396
+ wrinkleLowerScale = 0;
397
+ // u8
398
+ wrinkleLowerAspect = 0;
399
+ // u8
400
+ wrinkleLowerX = 0;
401
+ // u8
402
+ wrinkleLowerY = 0;
403
+ // u8
404
+ wrinkleUpperType = 0;
405
+ // u8
406
+ wrinkleUpperScale = 0;
407
+ // u8
408
+ wrinkleUpperAspect = 0;
409
+ // u8
410
+ wrinkleUpperX = 0;
411
+ // u8
412
+ wrinkleUpperY = 0;
413
+ // u8
414
+ makeup0 = 0;
415
+ // u8
416
+ makeup0Color = 0;
417
+ // u8
418
+ makeup0Scale = 0;
419
+ // u8
420
+ makeup0Aspect = 0;
421
+ // u8
422
+ makeup0X = 0;
423
+ // u8
424
+ makeup0Y = 0;
425
+ // u8
426
+ makeup1 = 0;
427
+ // u8
428
+ makeup1Color = 0;
429
+ // u8
430
+ makeup1Scale = 0;
431
+ // u8
432
+ makeup1Aspect = 0;
433
+ // u8
434
+ makeup1X = 0;
435
+ // u8
436
+ makeup1Y = 0;
437
+ // u8
438
+ hairType = 0;
439
+ // u16
440
+ hairColor0 = 0;
441
+ // u8
442
+ hairColor1 = 0;
443
+ // u8
444
+ hairTypeFront = 0;
445
+ // u8
446
+ hairTypeBack = 0;
447
+ // u8
448
+ hairStyle = 0;
449
+ // u8
450
+ earType = 0;
451
+ // u8
452
+ earScale = 0;
453
+ // u8
454
+ earY = 0;
455
+ // u8
456
+ eyeType = 0;
457
+ // u8
458
+ eyeColor = 0;
459
+ // u8
460
+ eyeScale = 0;
461
+ // u8
462
+ eyeAspect = 0;
463
+ // u8
464
+ eyeRotate = 0;
465
+ // u8
466
+ eyeX = 0;
467
+ // u8
468
+ eyeY = 0;
469
+ // u8
470
+ eyeShadowColor = 0;
471
+ // u8
472
+ eyeHighlightType = 0;
473
+ // u8
474
+ eyeHighlightScale = 0;
475
+ // u8
476
+ eyeHighlightAspect = 0;
477
+ // u8
478
+ eyeHighlightRotate = 0;
479
+ // u8
480
+ eyeHighlightX = 0;
481
+ // u8
482
+ eyeHighlightY = 0;
483
+ // u8
484
+ eyelashUpperType = 0;
485
+ // u8
486
+ eyelashUpperScale = 0;
487
+ // u8
488
+ eyelashUpperAspect = 0;
489
+ // u8
490
+ eyelashUpperRotate = 0;
491
+ // u8
492
+ eyelashUpperX = 0;
493
+ // u8
494
+ eyelashUpperY = 0;
495
+ // u8
496
+ eyelashLowerType = 0;
497
+ // u8
498
+ eyelashLowerScale = 0;
499
+ // u8
500
+ eyelashLowerAspect = 0;
501
+ // u8
502
+ eyelashLowerRotate = 0;
503
+ // u8
504
+ eyelashLowerX = 0;
505
+ // u8
506
+ eyelashLowerY = 0;
507
+ // u8
508
+ eyelidUpperType = 0;
509
+ // u8
510
+ eyelidUpperScale = 0;
511
+ // u8
512
+ eyelidUpperAspect = 0;
513
+ // u8
514
+ eyelidUpperRotate = 0;
515
+ // u8
516
+ eyelidUpperX = 0;
517
+ // u8
518
+ eyelidUpperY = 0;
519
+ // u8
520
+ eyelidLowerType = 0;
521
+ // u8
522
+ eyelidLowerScale = 0;
523
+ // u8
524
+ eyelidLowerAspect = 0;
525
+ // u8
526
+ eyelidLowerRotate = 0;
527
+ // u8
528
+ eyelidLowerX = 0;
529
+ // u8
530
+ eyelidLowerY = 0;
531
+ // u8
532
+ eyebrowType = 0;
533
+ // u8
534
+ eyebrowColor = 0;
535
+ // u8
536
+ eyebrowScale = 0;
537
+ // u8
538
+ eyebrowAspect = 0;
539
+ // u8
540
+ eyebrowRotate = 0;
541
+ // u8
542
+ eyebrowX = 0;
543
+ // u8
544
+ eyebrowY = 0;
545
+ // u8
546
+ noseType = 0;
547
+ // u8
548
+ noseScale = 0;
549
+ // u8
550
+ noseY = 0;
551
+ // u8
552
+ mouthType = 0;
553
+ // u8
554
+ mouthColor = 0;
555
+ // u8
556
+ mouthScale = 0;
557
+ // u8
558
+ mouthAspect = 0;
559
+ // u8
560
+ mouthRotate = 0;
561
+ // u8
562
+ mouthY = 0;
563
+ // u8
564
+ beardType = 0;
565
+ // u8
566
+ beardColor = 0;
567
+ // u8
568
+ beardShortType = 0;
569
+ // u8
570
+ beardShortColor = 0;
571
+ // u8
572
+ mustacheType = 0;
573
+ // u8
574
+ mustacheColor = 0;
575
+ // u8
576
+ mustacheScale = 0;
577
+ // u8
578
+ mustacheAspect = 0;
579
+ // u8
580
+ mustacheY = 0;
581
+ // u8
582
+ glassType1 = 0;
583
+ // u8
584
+ glassColor1 = 0;
585
+ // u8
586
+ glassScale = 0;
587
+ // u8
588
+ glassAspect = 0;
589
+ // u8
590
+ glassY = 0;
591
+ // u8
592
+ glassType2 = 0;
593
+ // u8
594
+ glassColor2 = 0;
595
+ // u8
596
+ moleScale = 0;
597
+ // u8
598
+ moleX = 0;
599
+ // u8
600
+ moleY = 0;
601
+ // u8
602
+ unkDefault45 = 0;
603
+ // u8
604
+ };
605
+ // Annotate the CommonJS export names for ESM import in node:
606
+ 0 && (module.exports = {
607
+ CharInfoEx
608
+ });