miijs 1.0.2 → 1.5.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/README.md +16 -0
- package/index.js +372 -5
- package/package.json +1 -2
- package/maddie.jpg +0 -0
package/README.md
CHANGED
|
@@ -13,6 +13,22 @@ To make a special Mii, read in the file using the appropriate function, set `mii
|
|
|
13
13
|
- readWiiBin(pathToMii), returns JSON
|
|
14
14
|
- writeWiiBin(miiJSON, path), writes new bin to the path specified
|
|
15
15
|
- render3DSMiiFromJSON(miiJSON, path), writes PNG representation of Mii's face to the path specified
|
|
16
|
+
- convertMii(miiJson, whatConsoleItIsForOriginallly ("3ds" or "wii")), converts the Mii JSON format
|
|
17
|
+
|
|
18
|
+
## Discrepancies in Conversion function
|
|
19
|
+
All of these discrepancies only apply when converting from the 3DS to the Wii, converting from the Wii to the 3DS should be a perfect conversion.
|
|
20
|
+
There is a reason that the Wii supports sending Miis to the 3DS, but not vice versa. Many of the fields on the 3DS are new, and not present on the Wii. This function does its absolute best to backport 3DS Miis, but it *is not perfect and never will be*. If you rely heavily on 3DS exclusive options in your Mii, the outputted Mii will likely not be satisfactory.
|
|
21
|
+
|
|
22
|
+
Here is a list of discrepancies this function attempts to handle.
|
|
23
|
+
- The 3DS has four more face shapes, thus some are converted to the closest possible for the Wii
|
|
24
|
+
- The 3DS allows you to set Makeup and Wrinkles simultaneously, as well as having 7 more "makeup" (including beard shadow and freckles) types and 5 more wrinkle types. This is probably one of the messiest conversions since one field has to be ignored entirely if both are set. Since the 3DS has some that are not even close to anything the Wii has, it will ignore these if the other field is set, allowing for the other field to be added in it's place, prioritizing wrinkles over makeup. The outputted Mii will almost certainly require further editing to be satisfactory if these fields are used.
|
|
25
|
+
- The 3DS has 6 extra nose types, all on the second page - these are mapped to similar noses on the first page that the Wii has
|
|
26
|
+
- The 3DS has an extra page of mouth types containing 12 extra mouth types. These are mapped to similar mouths on the other two pages that the Wii supports.
|
|
27
|
+
- The 3DS has two extra lip colors. These are changed into the default Orangey lip color if used since both of the extra colors are closest to this.
|
|
28
|
+
- The Wii does not have the option to "squish" parts to be thinner. This function ignores this field as a result.
|
|
29
|
+
- The 3DS has 60 extra hairstyles. These are mapped to hairstyles the Wii does have, but obviously out of 60 it won't be perfect. There will also be typoes more than likely, but I'm not testing 132 different Miis, sorry 😜. This will not be a perfect conversion and has a decent chance of needing a manual change anyway.
|
|
30
|
+
- The 3DS has an extra page of eye types that the Wii does not, which the function maps to a similar eye type that the Wii does support if used. Will likely require a manual edit.
|
|
31
|
+
- The 3DS has two extra mustaches and two extra beards. These are mapped to a similar beard or mustache if used - the two extra beards will likely need a manual change if used.
|
|
16
32
|
|
|
17
33
|
|
|
18
34
|
|
package/index.js
CHANGED
|
@@ -89,6 +89,20 @@ var wiiMouthColors=["Peach","Red","Pink"];
|
|
|
89
89
|
var wiiHairCols=["Black","Dark Brown","Mid Brown","Brown","Grey","Wooden Brown","Dark Blonde","Blonde"];
|
|
90
90
|
var wiiEyeCols=["Black","Grey","Brown","Lime","Blue","Green"];
|
|
91
91
|
var wiiGlassesCols=["Grey","Brown","Red","Blue","Yellow","White"];
|
|
92
|
+
var wiiNoses={
|
|
93
|
+
'0': 1,
|
|
94
|
+
'1': 10,
|
|
95
|
+
'2': 2,
|
|
96
|
+
'3': 3,
|
|
97
|
+
'4': 6,
|
|
98
|
+
'5': 0,
|
|
99
|
+
'6': 5,
|
|
100
|
+
'7': 4,
|
|
101
|
+
'8': 8,
|
|
102
|
+
'9': 9,
|
|
103
|
+
'10': 7,
|
|
104
|
+
'11': 11
|
|
105
|
+
};
|
|
92
106
|
var mouthTable={
|
|
93
107
|
'0': '113',
|
|
94
108
|
'1': '121',
|
|
@@ -273,6 +287,7 @@ var eyeCols3DS=["Black","Grey","Brown","Lime","Blue","Green"];
|
|
|
273
287
|
var hairCols3DS=["Black","Brown","Red","Reddish Brown","Grey","Light Brown","Dark Blonde","Blonde"];
|
|
274
288
|
var mouthCols3DS=["Orange","Red","Pink","Peach","Black"];
|
|
275
289
|
var glassesCols3DS=["Black","Brown","Red","Blue","Yellow","Grey"];
|
|
290
|
+
|
|
276
291
|
var tables={
|
|
277
292
|
faces: [
|
|
278
293
|
0x00,0x01,0x08,
|
|
@@ -381,6 +396,184 @@ var tables={
|
|
|
381
396
|
0x22,0x21,0x20]
|
|
382
397
|
]
|
|
383
398
|
};
|
|
399
|
+
var convTables={
|
|
400
|
+
face3DSToWii:[0,1,2,2,3,1,4,5,4,6,7,6],
|
|
401
|
+
features3DSToWii:["0","6",5,6,"6",4,7,7,8,10,"6",11],//If typeof===String, choose a makeup in that field's place - there is no suitable replacement. Read the discrepancies in the README for more information.
|
|
402
|
+
makeup3DSToWii:[0,1,1,2,1,1,2,2,2,3,9,9],
|
|
403
|
+
nose3DSToWii:[
|
|
404
|
+
[0,1,2,3,4,5,6,7,8,9,10,11],
|
|
405
|
+
[0,3,4,6,9,2]
|
|
406
|
+
],
|
|
407
|
+
mouth3DSToWii:[
|
|
408
|
+
["111","121","131","112","122","132","113","123","133","114","124","134"],
|
|
409
|
+
["211","221","231","212","222","232","213","223","233","214","224","234"],
|
|
410
|
+
["121","214","134","123","121","112","124","133","221","224","121","232"]
|
|
411
|
+
],
|
|
412
|
+
hair3DSToWii:[
|
|
413
|
+
[
|
|
414
|
+
"111","221","121",
|
|
415
|
+
"231","211","121",
|
|
416
|
+
"212","131","233",
|
|
417
|
+
"132","112","222"
|
|
418
|
+
],
|
|
419
|
+
[
|
|
420
|
+
"232","223","321",
|
|
421
|
+
"123","311","134",
|
|
422
|
+
"114","124","234",
|
|
423
|
+
"114","134","234"
|
|
424
|
+
],
|
|
425
|
+
[
|
|
426
|
+
"214","523","433",
|
|
427
|
+
"214","531","512",
|
|
428
|
+
"523","433","134",
|
|
429
|
+
"414","523","134"
|
|
430
|
+
],
|
|
431
|
+
[
|
|
432
|
+
"331","333","324",
|
|
433
|
+
"332","333","334",
|
|
434
|
+
"312","322","322",
|
|
435
|
+
"113","122","313"
|
|
436
|
+
],
|
|
437
|
+
[
|
|
438
|
+
"113","322","133",
|
|
439
|
+
"333","323","314",
|
|
440
|
+
"411","621","521",
|
|
441
|
+
"424","424","424"
|
|
442
|
+
],
|
|
443
|
+
[
|
|
444
|
+
"511","411","411",
|
|
445
|
+
"422","522","523",
|
|
446
|
+
"534","523","434",
|
|
447
|
+
"422","533","424"
|
|
448
|
+
],
|
|
449
|
+
[
|
|
450
|
+
"511","531","534",
|
|
451
|
+
"623","521","524",
|
|
452
|
+
"534","523","523",
|
|
453
|
+
"424","513","523"
|
|
454
|
+
],
|
|
455
|
+
[
|
|
456
|
+
"411","523","512",
|
|
457
|
+
"513","432","432",
|
|
458
|
+
"621","431","514",
|
|
459
|
+
"421","432","514"
|
|
460
|
+
],
|
|
461
|
+
[
|
|
462
|
+
"623","614","633",
|
|
463
|
+
"633","633","624",
|
|
464
|
+
"434","633","634",
|
|
465
|
+
"624","624","634"
|
|
466
|
+
],
|
|
467
|
+
[
|
|
468
|
+
"634","413","412",
|
|
469
|
+
"413","413","412",
|
|
470
|
+
"611","622","632",
|
|
471
|
+
"611","622","632"
|
|
472
|
+
],
|
|
473
|
+
[
|
|
474
|
+
"423","632","423",
|
|
475
|
+
"612","612","613",
|
|
476
|
+
"631","631","613",
|
|
477
|
+
"631","631","613"
|
|
478
|
+
]
|
|
479
|
+
],
|
|
480
|
+
eyebrows3DSToWii:[
|
|
481
|
+
[
|
|
482
|
+
"111","121","131",
|
|
483
|
+
"112","122","132",
|
|
484
|
+
"113","123","133",
|
|
485
|
+
"114","124","134"
|
|
486
|
+
],
|
|
487
|
+
[
|
|
488
|
+
"211","221","231",
|
|
489
|
+
"212","222","232",
|
|
490
|
+
"213","223","233",
|
|
491
|
+
"214","224","234"
|
|
492
|
+
]
|
|
493
|
+
],
|
|
494
|
+
eyes3DSToWii:[
|
|
495
|
+
[
|
|
496
|
+
"111","121","131",
|
|
497
|
+
"112","122","132",
|
|
498
|
+
"113","123","133",
|
|
499
|
+
"114","124","134"
|
|
500
|
+
],
|
|
501
|
+
[
|
|
502
|
+
"211","221","231",
|
|
503
|
+
"212","222","232",
|
|
504
|
+
"213","223","233",
|
|
505
|
+
"214","224","234"
|
|
506
|
+
],
|
|
507
|
+
[
|
|
508
|
+
"311","321","331",
|
|
509
|
+
"312","322","332",
|
|
510
|
+
"313","323","333",
|
|
511
|
+
"314","324","334"
|
|
512
|
+
],
|
|
513
|
+
[
|
|
514
|
+
"411","421","431",
|
|
515
|
+
"412","422","432",
|
|
516
|
+
"413","423","433",
|
|
517
|
+
"414","424","434"
|
|
518
|
+
],
|
|
519
|
+
[
|
|
520
|
+
"322","322","312",
|
|
521
|
+
"224","224","431",
|
|
522
|
+
"224","224","111",
|
|
523
|
+
"121","411","431"
|
|
524
|
+
]
|
|
525
|
+
],
|
|
526
|
+
hairWiiTo3DS:[
|
|
527
|
+
[
|
|
528
|
+
[0,0],[0,2],[0,7],
|
|
529
|
+
[0,10],[3,10],[0,9],
|
|
530
|
+
[4,0],[1,3],[3,8],
|
|
531
|
+
[1,6],[1,7],[1,5]
|
|
532
|
+
],
|
|
533
|
+
[
|
|
534
|
+
[0,4],[0,1],[0,3],
|
|
535
|
+
[0,6],[0,11],[1,0],
|
|
536
|
+
[2,5],[1,1],[0,8],
|
|
537
|
+
[2,0],[2,6],[1,8]
|
|
538
|
+
],
|
|
539
|
+
[
|
|
540
|
+
[1,4],[1,2],[3,0],
|
|
541
|
+
[4,0],[3,6],[3,3],
|
|
542
|
+
[3,11],[4,4],[4,3],
|
|
543
|
+
[4,5],[3,2],[3,5]
|
|
544
|
+
],
|
|
545
|
+
[
|
|
546
|
+
[4,6],[7,9],[7,7],
|
|
547
|
+
[9,5],[5,9],[7,5],
|
|
548
|
+
[9,1],[10,2],[7,0],
|
|
549
|
+
[6,1],[5,8],[8,9]
|
|
550
|
+
],
|
|
551
|
+
[
|
|
552
|
+
[5,0],[6,4],[2,4],
|
|
553
|
+
[4,8],[5,4],[5,5],
|
|
554
|
+
[6,10],[6,8],[5,10],
|
|
555
|
+
[7,8],[6,5],[6,6]
|
|
556
|
+
],
|
|
557
|
+
[
|
|
558
|
+
[9,6],[4,7],[10,6],
|
|
559
|
+
[10,1],[9,10],[9,8],
|
|
560
|
+
[10,8],[8,1],[2,0],
|
|
561
|
+
[9,1],[8,9],[8,8]
|
|
562
|
+
]
|
|
563
|
+
],
|
|
564
|
+
faceWiiTo3DS:[
|
|
565
|
+
0,1,
|
|
566
|
+
3,4,
|
|
567
|
+
6,7,
|
|
568
|
+
9,10
|
|
569
|
+
],
|
|
570
|
+
featureWiiTo3DS:[
|
|
571
|
+
0,"1","6",
|
|
572
|
+
"9",5,2,
|
|
573
|
+
3,7,8,
|
|
574
|
+
"10",9,11
|
|
575
|
+
]
|
|
576
|
+
};
|
|
384
577
|
function lookupTable(table,value,paginated){
|
|
385
578
|
if(paginated){
|
|
386
579
|
for(var i=0;i<tables[table].length;i++){
|
|
@@ -437,7 +630,11 @@ module.exports={
|
|
|
437
630
|
thisMii.face.feature=wiiFaceFeatures[parseInt(getBinaryFromAddress(0x20).slice(6,8)+temp.slice(0,2),2)];//0-11
|
|
438
631
|
thisMii.info.mingle=temp[5]==="1"?false:true;//0 for Mingle, 1 for Don't Mingle
|
|
439
632
|
temp=getBinaryFromAddress(0x2C);
|
|
440
|
-
|
|
633
|
+
for(var i=0;i<12;i++){
|
|
634
|
+
if(wiiNoses[i]===parseInt(temp.slice(0,4),2)){
|
|
635
|
+
thisMii.nose.type=i;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
441
638
|
thisMii.nose.size=parseInt(temp.slice(4,8),2);
|
|
442
639
|
thisMii.nose.vertPos=parseInt(getBinaryFromAddress(0x2D).slice(0,5),2);//From top to bottom, 0-18, default 9
|
|
443
640
|
temp=getBinaryFromAddress(0x2E);
|
|
@@ -474,7 +671,7 @@ module.exports={
|
|
|
474
671
|
temp2=getBinaryFromAddress(0x27);
|
|
475
672
|
thisMii.eyebrows.col=wiiHairCols[parseInt(temp.slice(0,3),2)];
|
|
476
673
|
thisMii.eyebrows.size=parseInt(temp.slice(3,7),2);//0-8, default 4
|
|
477
|
-
thisMii.eyebrows.yPos=parseInt(temp[7]+temp2.slice(0,4),2);//0-
|
|
674
|
+
thisMii.eyebrows.yPos=(parseInt(temp[7]+temp2.slice(0,4),2))-3;//0-15, default 10
|
|
478
675
|
thisMii.eyebrows.distApart=parseInt(temp2.slice(4,8),2);//0-12, default 2
|
|
479
676
|
thisMii.eyes.type=eyeTable[parseInt(getBinaryFromAddress(0x28).slice(0,6),2)];//0-47, needs lookup table
|
|
480
677
|
temp=getBinaryFromAddress(0x29);
|
|
@@ -677,7 +874,7 @@ module.exports={
|
|
|
677
874
|
miiBin+="000000";
|
|
678
875
|
miiBin+=wiiHairCols.indexOf(mii.eyebrows.col).toString(2).padStart(3,"0");
|
|
679
876
|
miiBin+=mii.eyebrows.size.toString(2).padStart(4,"0");
|
|
680
|
-
miiBin+=mii.eyebrows.yPos.toString(2).padStart(5,"0");
|
|
877
|
+
miiBin+=(mii.eyebrows.yPos+3).toString(2).padStart(5,"0");
|
|
681
878
|
miiBin+=mii.eyebrows.distApart.toString(2).padStart(4,"0");
|
|
682
879
|
miiBin+=(+getKeyByValue(eyeTable,mii.eyes.type)).toString(2).padStart(6,"0");
|
|
683
880
|
miiBin+="00";
|
|
@@ -688,7 +885,7 @@ module.exports={
|
|
|
688
885
|
miiBin+=mii.eyes.size.toString(2).padStart(3,"0");
|
|
689
886
|
miiBin+=mii.eyes.distApart.toString(2).padStart(4,"0");
|
|
690
887
|
miiBin+="00000";
|
|
691
|
-
miiBin+=mii.nose.type.toString(2).padStart(4,"0");
|
|
888
|
+
miiBin+=wiiNoses[mii.nose.type].toString(2).padStart(4,"0");
|
|
692
889
|
miiBin+=mii.nose.size.toString(2).padStart(4,"0");
|
|
693
890
|
miiBin+=mii.nose.vertPos.toString(2).padStart(5,"0");
|
|
694
891
|
miiBin+="000";
|
|
@@ -1023,7 +1220,7 @@ module.exports={
|
|
|
1023
1220
|
studioMii[0x27] = mii.mouth.yPos;
|
|
1024
1221
|
studioMii[0x29] = mii.facialHair.mustacheType;
|
|
1025
1222
|
studioMii[1] = mii.facialHair.beardType;
|
|
1026
|
-
studioMii[0] = mii.facialHair.col;
|
|
1223
|
+
studioMii[0] = hairCols3DS.indexOf(mii.facialHair.col);
|
|
1027
1224
|
if (!studioMii[0]) studioMii[0] = 8;
|
|
1028
1225
|
studioMii[0x28] = mii.facialHair.mustacheSize;
|
|
1029
1226
|
studioMii[0x2A] = mii.facialHair.mustacheYPos;
|
|
@@ -1043,5 +1240,175 @@ module.exports={
|
|
|
1043
1240
|
studioMii[0x21] = mii.mole.xPos;
|
|
1044
1241
|
studioMii[0x22] = mii.mole.yPos;
|
|
1045
1242
|
downloadImage('https://studio.mii.nintendo.com/miis/image.png?data=' + encodeStudio(studioMii) + "&width=270&type=face",outPath);
|
|
1243
|
+
},
|
|
1244
|
+
convertMii:function (jsonIn,typeFrom){
|
|
1245
|
+
typeFrom=typeFrom.toLowerCase();
|
|
1246
|
+
let mii=jsonIn;
|
|
1247
|
+
var miiTo={};
|
|
1248
|
+
if(typeFrom==="3ds"){
|
|
1249
|
+
miiTo={
|
|
1250
|
+
info:{},
|
|
1251
|
+
face:{},
|
|
1252
|
+
nose:{},
|
|
1253
|
+
mouth:{},
|
|
1254
|
+
mole:{},
|
|
1255
|
+
hair:{},
|
|
1256
|
+
eyebrows:{},
|
|
1257
|
+
eyes:{},
|
|
1258
|
+
glasses:{},
|
|
1259
|
+
facialHair:{}
|
|
1260
|
+
};
|
|
1261
|
+
miiTo.creatorName=mii.creatorName;
|
|
1262
|
+
miiTo.info.creatorName=miiTo.creatorName;
|
|
1263
|
+
miiTo.name=mii.name;
|
|
1264
|
+
miiTo.info.name=miiTo.name;
|
|
1265
|
+
miiTo.info.gender=mii.info.gender;
|
|
1266
|
+
miiTo.info.systemId="ffffffff";
|
|
1267
|
+
let miiId;
|
|
1268
|
+
switch(mii.info.type){
|
|
1269
|
+
case "Special":
|
|
1270
|
+
miiId="01000110";
|
|
1271
|
+
break;
|
|
1272
|
+
case "Foreign":
|
|
1273
|
+
miiId="11000110";
|
|
1274
|
+
break;
|
|
1275
|
+
default:
|
|
1276
|
+
miiId="10101001";
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
for(var i=0;i<3;i++){
|
|
1280
|
+
miiId+=Math.floor(Math.random()*255).toString(2).padStart(8,"0");
|
|
1281
|
+
}
|
|
1282
|
+
miiTo.info.miiId+=miiId;
|
|
1283
|
+
miiTo.info.mingle=mii.perms.copying;
|
|
1284
|
+
miiTo.info.birthMonth=mii.info.birthMonth;
|
|
1285
|
+
miiTo.info.birthday=mii.info.birthday;
|
|
1286
|
+
miiTo.info.favColor=mii.info.favColor;
|
|
1287
|
+
miiTo.info.favorited=false;
|
|
1288
|
+
miiTo.info.height=mii.info.height;
|
|
1289
|
+
miiTo.info.weight=mii.info.weight;
|
|
1290
|
+
miiTo.info.downloadedFromCheckMiiOut=false;
|
|
1291
|
+
miiTo.face.shape=convTables.face3DSToWii[mii.face.shape];
|
|
1292
|
+
miiTo.face.col=mii.face.col;
|
|
1293
|
+
//We prioritize Facial Features here because the Wii supports more of those than they do Makeup types, and is more likely to apply. The 3DS has two separate fields, so you can have makeup and wrinkles applied at the same time. The Wii only has one that covers both.
|
|
1294
|
+
if(typeof(convTables.features3DSToWii[faceFeatures3DS.indexOf(mii.face.feature)])==='string'){
|
|
1295
|
+
miiTo.face.feature=wiiFaceFeatures[convTables.makeup3DSToWii[makeups3DS.indexOf(mii.face.makeup)]];
|
|
1296
|
+
}
|
|
1297
|
+
else{
|
|
1298
|
+
miiTo.face.feature=wiiFaceFeatures[convTables.features3DSToWii[features3DS.indexOf(mii.face.feature)]];
|
|
1299
|
+
}
|
|
1300
|
+
miiTo.nose.type=convTables.nose3DSToWii[mii.nose.type[0]][mii.nose.type[1]];
|
|
1301
|
+
miiTo.nose.size=mii.nose.size;
|
|
1302
|
+
miiTo.nose.vertPos=mii.nose.yPos;
|
|
1303
|
+
miiTo.mouth.type=convTables.mouth3DSToWii[mii.mouth.type[0]][mii.mouth.type[1]];
|
|
1304
|
+
miiTo.mouth.col=wiiMouthColors[mouthCols3DS.indexOf(mii.mouth.col)>2?0:mouthCols3DS.indexOf(mii.mouth.col)];
|
|
1305
|
+
miiTo.mouth.size=mii.mouth.size;
|
|
1306
|
+
miiTo.mouth.yPos=mii.mouth.yPos;
|
|
1307
|
+
miiTo.mole=mii.mole;
|
|
1308
|
+
miiTo.hair.col=mii.hair.col;
|
|
1309
|
+
miiTo.hair.flipped=mii.hair.flipped;
|
|
1310
|
+
miiTo.hair.type=convTables.hair3DSToWii[mii.hair.style[0]][mii.hair.style[1]];
|
|
1311
|
+
miiTo.eyebrows.type=convTables.eyebrows3DSToWii[mii.eyebrows.style[0]][mii.eyebrows.style[1]];
|
|
1312
|
+
miiTo.eyebrows.col=mii.eyebrows.col;
|
|
1313
|
+
miiTo.eyebrows.rotation=mii.eyebrows.rot;
|
|
1314
|
+
miiTo.eyebrows.size=mii.eyebrows.size;
|
|
1315
|
+
miiTo.eyebrows.yPos=mii.eyebrows.yPos;
|
|
1316
|
+
miiTo.eyebrows.distApart=mii.eyebrows.distApart;
|
|
1317
|
+
miiTo.eyes.type=convTables.eyes3DSToWii[mii.eyes.type[0]][mii.eyes.type[1]];
|
|
1318
|
+
miiTo.eyes.rotation=mii.eyes.rot;
|
|
1319
|
+
miiTo.eyes.yPos=mii.eyes.yPos;
|
|
1320
|
+
miiTo.eyes.col=mii.eyes.col;
|
|
1321
|
+
miiTo.eyes.size=mii.eyes.size;
|
|
1322
|
+
miiTo.eyes.distApart=mii.eyes.distApart;
|
|
1323
|
+
miiTo.glasses=mii.glasses;
|
|
1324
|
+
miiTo.glasses.col=wiiGlassesCols[glassesCols3DS.indexOf(mii.glasses.col)];
|
|
1325
|
+
miiTo.facialHair=mii.facialHair;
|
|
1326
|
+
if(miiTo.facialHair.mustacheType===4){
|
|
1327
|
+
miiTo.facialHair.mustacheType=2;
|
|
1328
|
+
}
|
|
1329
|
+
else if(miiTo.facialHair.mustacheType===5){
|
|
1330
|
+
miiTo.facialHair.mustacheType=0;
|
|
1331
|
+
miiTo.facialHair.beardType=1;
|
|
1332
|
+
}
|
|
1333
|
+
if(mii.facialHair.beardType>4){
|
|
1334
|
+
mii.facialHair.beardType=3;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
else if(typeFrom==="wii"){
|
|
1338
|
+
miiTo={
|
|
1339
|
+
info:{},
|
|
1340
|
+
perms:{},
|
|
1341
|
+
hair:{},
|
|
1342
|
+
face:{},
|
|
1343
|
+
eyes:{},
|
|
1344
|
+
eyebrows:{},
|
|
1345
|
+
nose:{},
|
|
1346
|
+
mouth:{},
|
|
1347
|
+
facialHair:{},
|
|
1348
|
+
glasses:{},
|
|
1349
|
+
mole:{}
|
|
1350
|
+
};
|
|
1351
|
+
miiTo.info.birthday=mii.info.birthday;
|
|
1352
|
+
miiTo.info.birthMonth=mii.info.birthMonth;
|
|
1353
|
+
miiTo.name=mii.name;
|
|
1354
|
+
miiTo.info.name=miiTo.name;
|
|
1355
|
+
miiTo.creatorName=mii.creatorName;
|
|
1356
|
+
miiTo.info.creatorName=mii.creatorName;
|
|
1357
|
+
miiTo.info.height=mii.info.height;
|
|
1358
|
+
miiTo.info.weight=mii.info.weight;
|
|
1359
|
+
miiTo.info.favColor=mii.info.favColor;
|
|
1360
|
+
miiTo.info.gender=mii.info.gender;
|
|
1361
|
+
miiTo.perms.sharing=mii.info.mingle;
|
|
1362
|
+
miiTo.perms.copying=mii.info.mingle;
|
|
1363
|
+
miiTo.hair.col=hairCols3DS[wiiHairCols.indexOf(mii.hair.col)];
|
|
1364
|
+
miiTo.hair.flipped=mii.hair.flipped;
|
|
1365
|
+
miiTo.hair.style=convTables.hairWiiTo3DS[+mii.hair.type[0]-1][0+(3*(+mii.hair.type[2]-1))+(+mii.hair.type[1]-1)];
|
|
1366
|
+
miiTo.face.shape=convTables.faceWiiTo3DS[mii.face.shape];
|
|
1367
|
+
miiTo.face.col=skinCols3DS[wiiSkinColors.indexOf(mii.face.col)];
|
|
1368
|
+
miiTo.face.makeup="None";
|
|
1369
|
+
miiTo.face.feature="None";
|
|
1370
|
+
if(typeof(convTables.featureWiiTo3DS[wiiFaceFeatures.indexOf(mii.face.feature)])==='string'){
|
|
1371
|
+
miiTo.face.makeup=makeups3DS[+convTables.featureWiiTo3DS[wiiFaceFeatures.indexOf(mii.face.feature)]];
|
|
1372
|
+
}
|
|
1373
|
+
else{
|
|
1374
|
+
miiTo.face.feature=faceFeatures3DS[convTables.featureWiiTo3DS[wiiFaceFeatures.indexOf(mii.face.feature)]];
|
|
1375
|
+
}
|
|
1376
|
+
miiTo.eyes.col=eyeCols3DS[wiiEyeCols.indexOf(mii.eyes.col)];
|
|
1377
|
+
miiTo.eyes.type=[+mii.eyes.type[0]-1,(+mii.eyes.type[1]-1)+(3*(+mii.eyes.type[2]-1))];
|
|
1378
|
+
miiTo.eyes.size=mii.eyes.size;
|
|
1379
|
+
miiTo.eyes.squash=3;
|
|
1380
|
+
miiTo.eyes.rot=mii.eyes.rotation;
|
|
1381
|
+
miiTo.eyes.distApart=mii.eyes.distApart;
|
|
1382
|
+
miiTo.eyes.yPos=mii.eyes.yPos;
|
|
1383
|
+
miiTo.eyebrows.style=[+mii.eyebrows.type[0]-1,(+mii.eyebrows.type[1]-1)+(3*(+mii.eyebrows.type[2]-1))];
|
|
1384
|
+
miiTo.eyebrows.col=hairCols3DS[wiiHairCols.indexOf(mii.eyebrows.col)];
|
|
1385
|
+
miiTo.eyebrows.size=mii.eyebrows.size;
|
|
1386
|
+
miiTo.eyebrows.squash=3;
|
|
1387
|
+
miiTo.eyebrows.rot=mii.eyebrows.rotation;
|
|
1388
|
+
miiTo.eyebrows.distApart=mii.eyebrows.distApart;
|
|
1389
|
+
miiTo.eyebrows.yPos=mii.eyebrows.yPos;
|
|
1390
|
+
miiTo.nose.type=[0,mii.nose.type];
|
|
1391
|
+
miiTo.nose.size=mii.nose.size;
|
|
1392
|
+
miiTo.nose.yPos=mii.nose.vertPos;
|
|
1393
|
+
miiTo.mouth.type=[+mii.mouth.type[0]-1,(+mii.mouth.type[1]-1)+(3*(+mii.mouth.type[2]-1))];
|
|
1394
|
+
miiTo.mouth.col=mouthCols3DS[wiiMouthColors.indexOf(mii.mouth.col)];
|
|
1395
|
+
miiTo.mouth.size=mii.mouth.size;
|
|
1396
|
+
miiTo.mouth.squash=3;
|
|
1397
|
+
miiTo.mouth.yPos=mii.mouth.yPos;
|
|
1398
|
+
miiTo.facialHair.mustacheType=mii.facialHair.mustacheType;
|
|
1399
|
+
miiTo.facialHair.beardType=mii.facialHair.beardType;
|
|
1400
|
+
miiTo.facialHair.col=hairCols3DS[wiiHairCols.indexOf(mii.facialHair.col)];
|
|
1401
|
+
miiTo.facialHair.mustacheSize=mii.facialHair.mustacheSize;
|
|
1402
|
+
miiTo.facialHair.mustacheYPos=mii.facialHair.mustacheYPos;
|
|
1403
|
+
miiTo.glasses.type=mii.glasses.type;
|
|
1404
|
+
miiTo.glasses.col=glassesCols3DS[wiiGlassesCols.indexOf(mii.glasses.col)];
|
|
1405
|
+
miiTo.glasses.size=mii.glasses.size;
|
|
1406
|
+
miiTo.glasses.yPos=mii.glasses.yPos;
|
|
1407
|
+
miiTo.mole.on=mii.mole.on;
|
|
1408
|
+
miiTo.mole.size=mii.mole.size;
|
|
1409
|
+
miiTo.mole.xPos=mii.mole.xPos;
|
|
1410
|
+
miiTo.mole.yPos=mii.mole.yPos;
|
|
1411
|
+
}
|
|
1412
|
+
return miiTo;
|
|
1046
1413
|
}
|
|
1047
1414
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miijs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Read, Edit, Write, and make Special Miis from a Wiimote binary file or 3DS QR Code to a binary file or QR code",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"https": "^1.0.0",
|
|
31
31
|
"jimp": "^0.22.7",
|
|
32
32
|
"jsqr": "^1.4.0",
|
|
33
|
-
"pureimage": "^0.3.17",
|
|
34
33
|
"qrcode": "^1.5.3"
|
|
35
34
|
}
|
|
36
35
|
}
|
package/maddie.jpg
DELETED
|
Binary file
|