miijs 2.3.2 → 2.3.3
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/index.js +11 -11
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const httpsLib = require('https');
|
|
|
12
12
|
const asmCrypto = require("./asmCrypto.js");
|
|
13
13
|
const path = require("path");
|
|
14
14
|
const createGL = require('gl');
|
|
15
|
-
|
|
15
|
+
const typeCheat = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
|
|
16
16
|
const {
|
|
17
17
|
createCharModel, initCharModelTextures,
|
|
18
18
|
initializeFFL, exitFFL, parseHexOrB64ToUint8Array,
|
|
@@ -2518,7 +2518,7 @@ async function createFFLMiiIcon(data, options, shirtColor, fflRes) {
|
|
|
2518
2518
|
body.userData.isMiiBody = true;
|
|
2519
2519
|
|
|
2520
2520
|
// Recolor body (bakes into texture)
|
|
2521
|
-
var pantsColor=[0x808080,0xFFC000,0x89CFF0,0x913831][["default","special","foreign","favorite","favorited"].indexOf(options.pantsType
|
|
2521
|
+
var pantsColor=[0x808080,0xFFC000,0x89CFF0,0x913831,0x913831][["default","special","foreign","favorite","favorited"].indexOf(options.pantsType?.toLowerCase()||"default")];
|
|
2522
2522
|
body.traverse((o) => {
|
|
2523
2523
|
if (o.isMesh) {
|
|
2524
2524
|
if (!o.geometry.attributes.normal) o.geometry.computeVertexNormals();
|
|
@@ -2566,7 +2566,7 @@ async function createFFLMiiIcon(data, options, shirtColor, fflRes) {
|
|
|
2566
2566
|
const bakeAmbient = new THREE.AmbientLight(0xffffff, 0.15);
|
|
2567
2567
|
const bakeRim = new THREE.DirectionalLight(
|
|
2568
2568
|
0xffffff,
|
|
2569
|
-
|
|
2569
|
+
3
|
|
2570
2570
|
);
|
|
2571
2571
|
bakeRim.position.set(-3, 7, 1.0);
|
|
2572
2572
|
bakeAmbient.layers.enable(1);
|
|
@@ -2601,6 +2601,7 @@ async function createFFLMiiIcon(data, options, shirtColor, fflRes) {
|
|
|
2601
2601
|
const planeGeo = new THREE.PlaneGeometry(planeW, planeH);
|
|
2602
2602
|
const planeMat = new THREE.MeshBasicMaterial({ map: bodyTex, transparent: true, depthWrite: true, depthTest: true });
|
|
2603
2603
|
const bodyPlane = new THREE.Mesh(planeGeo, planeMat);
|
|
2604
|
+
bodyPlane.userData.isBodyPlane = true;
|
|
2604
2605
|
|
|
2605
2606
|
// Place plane at body world center so the neck peg aligns into head
|
|
2606
2607
|
bodyPlane.position.copy(bodyCenter);
|
|
@@ -3064,7 +3065,7 @@ function make3DSChild(dad, mom, options = {}) {
|
|
|
3064
3065
|
"height": 64,
|
|
3065
3066
|
"weight": 64,
|
|
3066
3067
|
"gender": g,
|
|
3067
|
-
"
|
|
3068
|
+
"favoriteColor": options.favoriteColor || favCols[Math.floor(Math.random() * favCols.length)]
|
|
3068
3069
|
},
|
|
3069
3070
|
"meta": {
|
|
3070
3071
|
"name": options.name || kidNames[g][Math.floor(Math.random() * kidNames[g].length)],
|
|
@@ -3114,7 +3115,6 @@ function make3DSChild(dad, mom, options = {}) {
|
|
|
3114
3115
|
function generateInstructions(mii, full) {
|
|
3115
3116
|
let type = mii.console?.toLowerCase();
|
|
3116
3117
|
if (type.toLowerCase() === "wii") {
|
|
3117
|
-
var typeCheat = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
|
|
3118
3118
|
var instrs = {
|
|
3119
3119
|
"base": `Select "${mii.general.gender}", and then "Start from Scratch".`,
|
|
3120
3120
|
"col": `On the info page (first tab), set the Favorite Color to ${lookupTables.favCols[mii.general.favoriteColor]} (${mii.general.favoriteColor <= 5 ? mii.general.favoriteColor + 1 : mii.general.favoriteColor - 5} from the left, ${mii.general.favoriteColor > 5 ? "bottom" : "top"} row).`,
|
|
@@ -3124,7 +3124,7 @@ function generateInstructions(mii, full) {
|
|
|
3124
3124
|
"makeup": `On the face page's makeup tab, set the makeup to the one ${Math.ceil((mii.face.feature + 1) / 3)} from the top, and ${typeCheat[mii.face.feature]} from the left.`,
|
|
3125
3125
|
"hairStyle": `On the hair page (fourth tab), set the hair style to the one ${typeCheat[mii.hair.type]} from the left, ${Math.ceil((mii.hair.type + 1) / 3)} from the top, on page ${mii.hair.page}.`,
|
|
3126
3126
|
"hairFlipped": `${mii.hair.flipped ? `On the hair page (fourth tab), press the button to flip the hair.` : ``}`,
|
|
3127
|
-
"hairColor": `On the hair page (fourth tab), set the hair color to the one ${mii.hair.
|
|
3127
|
+
"hairColor": `On the hair page (fourth tab), set the hair color to the one ${mii.hair.color + (mii.hair.color > 3 ? -3 : 1)} from the left, on the ${mii.hair.color > 3 ? `bottom` : `top`} row.`,
|
|
3128
3128
|
"eyebrowStyle": `On the eyebrow page (fifth tab), set the eyebrow style to the one ${typeCheat[mii.eyebrows.type]} from the left, ${Math.ceil((mii.eyebrows.type + 1) / 3)} from the top, on page ${mii.eyebrows.page}.`,
|
|
3129
3129
|
"eyebrowColor": `On the eyebrow page (fifth tab), set the eyebrow color to the one ${mii.eyebrows.color + (mii.eyebrows.color > 3 ? -3 : 1)} from the left, on the ${mii.eyebrows.color > 3 ? `bottom` : `top`} row.`,
|
|
3130
3130
|
"eyebrowY": `${mii.eyebrows.yPos !== 7 ? `On the eyebrow page (fifth tab), ` : ``}${mii.eyebrows.yPosition < 7 ? `press the up button ${7 - mii.eyebrows.yPosition} times.` : mii.eyebrows.yPosition > 7 ? `press the down button ${mii.eyebrows.yPosition - 7} times.` : ``}`,
|
|
@@ -3141,7 +3141,7 @@ function generateInstructions(mii, full) {
|
|
|
3141
3141
|
"noseY": `${mii.nose.yPosition !== 9 ? `On the nose page (seventh tab), ` : ``}${mii.nose.yPosition < 9 ? `press the up button ${9 - mii.nose.yPosition} times.` : mii.nose.yPosition > 9 ? `press the down button ${mii.nose.yPosition - 9} times.` : ``}`,
|
|
3142
3142
|
"noseSize": `${mii.nose.size !== 4 ? `On the nose page (seventh tab), ` : ``}${mii.nose.size < 4 ? `press the shrink button ${4 - mii.nose.size} times.` : mii.nose.size > 4 ? `press the enlarge button ${mii.nose.size - 4} times.` : ``}`,
|
|
3143
3143
|
"mouthType": `On the mouth page (eighth tab), set the mouth type to the one ${typeCheat[mii.mouth.type]} from the left, ${Math.ceil((mii.mouth.type + 1) / 3)} from the top, on page ${mii.mouth.page}.`,
|
|
3144
|
-
"mouthCol": `On the mouth page (eighth tab), set the color to the one ${mii.mouth.
|
|
3144
|
+
"mouthCol": `On the mouth page (eighth tab), set the color to the one ${mii.mouth.color + 1} from the left.`,
|
|
3145
3145
|
"mouthY": `${mii.mouth.yPosition !== 13 ? `On the mouth page (eighth tab), ` : ``}${mii.mouth.yPosition < 13 ? `press the up button ${13 - mii.mouth.yPosition} times.` : mii.mouth.yPosition > 13 ? `press the down button ${mii.mouth.yPosition - 13} times.` : ``}`,
|
|
3146
3146
|
"mouthSize": `${mii.mouth.size !== 4 ? `On the mouth page (eighth tab), ` : ``}${mii.mouth.size < 4 ? `press the shrink button ${4 - mii.mouth.size} times.` : mii.mouth.size > 4 ? `press the enlarge button ${mii.mouth.size - 4} times.` : ``}`,
|
|
3147
3147
|
"glasses": `On the glasses page (within the ninth tab), set the glasses to the one ${Math.ceil((mii.glasses.type + 1) / 3)} from the top, and ${typeCheat[mii.glasses.type]} from the left.`,
|
|
@@ -3156,7 +3156,7 @@ function generateInstructions(mii, full) {
|
|
|
3156
3156
|
"moleY": `${mii.mole.yPosition !== 20 ? `On the mole page (within the ninth tab), press the ` : ``}${mii.mole.yPosition > 20 ? `down button ${mii.mole.yPosition - 20} times.` : mii.mole.yPosition < 20 ? `up button ${20 - mii.mole.yPosition} times.` : ``}`,
|
|
3157
3157
|
"moleSize": `${mii.mole.size !== 4 ? `On the mole page (within the ninth tab), ` : ``}${mii.mole.size < 4 ? `press the shrink button ${4 - mii.mole.size} times.` : mii.mole.size > 4 ? `press the enlarge button ${mii.mole.size - 4} times.` : ``}`,
|
|
3158
3158
|
"beard": `On the beard page (within the ninth tab), set the beard to the one on the ${[0, 1].includes(mii.beard.type) ? `top` : `bottom`}-${[0, 2].includes(mii.beard.type) ? `left` : `right`}.`,
|
|
3159
|
-
"beardCol": `On the mustache OR beard pages (within the ninth tab), set the color to the one ${mii.beard.
|
|
3159
|
+
"beardCol": `On the mustache OR beard pages (within the ninth tab), set the color to the one ${mii.beard.color + (mii.beard.color > 3 ? -3 : 1)} from the left, on the ${mii.facialHair.color > 3 ? `bottom` : `top`} row.`,
|
|
3160
3160
|
"other": `The Nickname of this Mii is ${mii.info.name}.${mii.info.creatorName ? ` The creator was ${mii.info.creatorName}.` : ``} Mingle was turned ${mii.info.mingle ? `on` : `off`}.${mii.info.birthday !== 0 ? ` Its birthday is ${["", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][mii.info.birthMonth]} ${mii.info.birthday}.` : ``}`
|
|
3161
3161
|
};
|
|
3162
3162
|
if (!full) {
|
|
@@ -3187,7 +3187,7 @@ function generateInstructions(mii, full) {
|
|
|
3187
3187
|
"eyebrowDist": `${mii.eyebrows.distanceApart !== 2 ? `On the eyebrow page (third tab), ` : ``}${mii.eyebrows.distanceApart < 2 ? `press the closer-together button ${2 - mii.eyebrows.distanceApart} times.` : mii.eyebrows.distanceApart > 2 ? `press the further-apart button ${mii.eyebrows.distanceApart - 2} times.` : ``}`,
|
|
3188
3188
|
"eyebrowSquash": `${mii.eyebrows.squash !== 3 ? `On the eyebrow page (third tab), ` : ``}${mii.eyebrows.squash < 3 ? `press the squish button ${3 - mii.eyebrows.squash} times.` : mii.eyebrows.squash > 3 ? `press the un-squish button ${mii.eyebrows.squash - 3} times.` : ``}`,
|
|
3189
3189
|
"eyeType": `On the eye page (fourth tab), set the eye type to the one ${typeCheat[mii.eyes.type]} from the left, ${Math.ceil((mii.eyes.type + 1) / 3)} from the top, on page ${mii.eyes.page + 1}.`,
|
|
3190
|
-
"eyeColor": `On the eye page (fourth tab), set the color to the one ${mii.eyes.
|
|
3190
|
+
"eyeColor": `On the eye page (fourth tab), set the color to the one ${mii.eyes.color + 1} from the top.`,
|
|
3191
3191
|
"eyeY": `${mii.eyes.yPosition !== 12 ? `On the eye page (fourth tab), ` : ``}${mii.eyes.yPosition < 12 ? `press the up button ${12 - mii.eyes.yPosition} times.` : mii.eyes.yPosition > 12 ? `press the down button ${mii.eyes.yPosition - 12} times.` : ``}`,
|
|
3192
3192
|
"eyeSize": `${mii.eyes.size !== 4 ? `On the eye page (fourth tab), ` : ``}${mii.eyes.size < 4 ? `press the shrink button ${4 - mii.eyes.size} times.` : mii.eyes.size > 4 ? `press the enlarge button ${mii.eyes.size - 4} times.` : ``}`,
|
|
3193
3193
|
"eyeRot": `${mii.eyes.rotation !== (mii.general.gender === "Female" ? 3 : 4) ? `On the eye page (fourth tab), ` : ``}${mii.eyes.rotation < (mii.general.gender === "Female" ? 3 : 4) ? `press the rotate clockwise button ${(mii.general.gender === "Female" ? 3 : 4) - mii.eyes.rotation} times.` : mii.eyes.rotation > (mii.general.gender === "Female" ? 3 : 4) ? `press the rotate counter-clockwise button ${mii.eyes.rotation - (mii.general.gender === "Female" ? 3 : 4)} times.` : ``}`,
|
|
@@ -3202,7 +3202,7 @@ function generateInstructions(mii, full) {
|
|
|
3202
3202
|
"mouthSize": `${mii.mouth.size !== 4 ? `On the mouth page (sixth tab), ` : ``}${mii.mouth.size < 4 ? `press the shrink button ${4 - mii.mouth.size} times.` : mii.mouth.size > 4 ? `press the enlarge button ${mii.mouth.size - 4} times.` : ``}`,
|
|
3203
3203
|
"mouthSquash": `${mii.mouth.squash !== 3 ? `On the mouth page (sixth tab), ` : ``}${mii.mouth.squash < 3 ? `press the squish button ${3 - mii.mouth.squash} times.` : mii.mouth.squash > 3 ? `press the un-squish button ${mii.mouth.squash - 3} times.` : ``}`,
|
|
3204
3204
|
"glasses": `On the glasses page (within the seventh tab), set the glasses to the one ${Math.ceil((mii.glasses.type + 1) / 3)} from the top, and ${typeCheat[mii.glasses.type]} from the left.`,
|
|
3205
|
-
"glassesCol": `On the glasses page (within the seventh tab), set the color to the one ${mii.glasses.
|
|
3205
|
+
"glassesCol": `On the glasses page (within the seventh tab), set the color to the one ${mii.glasses.color + 1} from the top.`,
|
|
3206
3206
|
"glassesY": `${mii.glasses.yPosition !== 10 ? `On the glasses page (within the seventh tab), ` : ``}${mii.glasses.yPosition < 10 ? `press the up button ${10 - mii.glasses.yPosition} times.` : mii.glasses.yPosition > 10 ? `press the down button ${mii.glasses.yPosition - 10} times.` : ``}`,
|
|
3207
3207
|
"glassesSize": `${mii.glasses.size !== 4 ? `On the glasses page (within the seventh tab), ` : ``}${mii.glasses.size < 4 ? `press the shrink button ${4 - mii.glasses.size} times.` : mii.glasses.size > 4 ? `press the enlarge button ${mii.glasses.size - 4} times.` : ``}`,
|
|
3208
3208
|
"stache": `On the mustache page (within the seventh tab), set the mustache to the one on the ${[0, 1].includes(mii.beard.mustache.type) ? `top` : [2, 3].includes(mii.beard.mustache.type) ? `middle` : `bottom`}-${[0, 2, 4].includes(mii.beard.mustache.type) ? `left` : `right`}.`,
|
|
@@ -3216,7 +3216,7 @@ function generateInstructions(mii, full) {
|
|
|
3216
3216
|
"beardCol": `On the mustache OR beard pages (within the seventh tab), set the color to the one ${mii.beard.color + 1} from the top.`,
|
|
3217
3217
|
"heightWeight": `On the build page (eighth tab), set the height to ${Math.round((100 / 128) * mii.general.height)}%, and the weight to ${Math.round((100 / 128) * mii.general.weight)}%.`,
|
|
3218
3218
|
"col": `On the info page (after pressing "Next"), set the Favorite Color to ${mii.general.favoriteColor} (${mii.general.favoriteColor <= 5 ? mii.general.favoriteColor + 1 : mii.general.favoriteColor - 5} from the left, ${mii.general.favoriteColor > 5 ? "bottom" : "top"} row).`,
|
|
3219
|
-
"other": `The Nickname of this Mii is ${mii.
|
|
3219
|
+
"other": `The Nickname of this Mii is ${mii.meta.name}.${mii.meta.creatorName ? ` The creator was ${mii.meta.creatorName}.` : ``} ${mii.general.birthday !== 0 ? ` Its birthday is ${["", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][mii.general.birthMonth]} ${mii.general.birthday}.` : ``}`
|
|
3220
3220
|
};
|
|
3221
3221
|
if (!full) {
|
|
3222
3222
|
var defaultMiiInstrs = structuredClone(mii.general.gender === "Male" ? defaultInstrs["3ds"].male : defaultInstrs["3ds"].female);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miijs",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "Work with Mii characters in every possible way needed for your project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/
|
|
12
|
+
"url": "git+https://github.com/Stewared/MiiJS.git"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"Mii",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"Remote",
|
|
20
20
|
"Special"
|
|
21
21
|
],
|
|
22
|
-
"author": "
|
|
22
|
+
"author": "Stewared",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/
|
|
25
|
+
"url": "https://github.com/Stewared/MiiJS/issues"
|
|
26
26
|
},
|
|
27
|
-
"homepage": "https://github.com/
|
|
27
|
+
"homepage": "https://github.com/Stewared/MiiJS#readme",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"canvas": "^3.1.0",
|
|
30
30
|
"ffl.js": "github:ariankordi/FFL.js#06ede8f",
|