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