miijs 1.6.6 → 1.6.8

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.
Files changed (2) hide show
  1. package/index.js +8 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1110,13 +1110,13 @@ module.exports={
1110
1110
  const ctx = canvas.getContext('2d');
1111
1111
  ctx.drawImage(img, 0, 0);
1112
1112
  const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
1113
- qrCode = jsQR(imageData.data, imageData.width, imageData.height);
1113
+ qrCode = jsQR(imageData.data, imageData.width, imageData.height).binaryData;
1114
1114
  }
1115
1115
  else{
1116
1116
  qrCode=binOrPath;
1117
1117
  }
1118
1118
  if (qrCode) {
1119
- var data = decodeAesCcm(new Uint8Array(qrCode.binaryData));
1119
+ var data = decodeAesCcm(new Uint8Array(qrCode));
1120
1120
  fs.writeFileSync("./decryptedTemp.3dMii",Buffer.from(data));
1121
1121
  return Promise.resolve(readMii());
1122
1122
  } else {
@@ -1164,6 +1164,7 @@ module.exports={
1164
1164
  miiBin+=wiiFaceFeatures.indexOf(mii.face.feature).toString(2).padStart(4,"0");
1165
1165
  miiBin+="000";
1166
1166
  if(mii.info.mingle&&mii.info.type==="Special"){
1167
+ mii.info.mingle=false;
1167
1168
  console.error("A Special Mii cannot have Mingle on and still render on the Wii. Turned Mingle off in the output file.");
1168
1169
  }
1169
1170
  miiBin+=mii.info.mingle?"0":"1";
@@ -1179,7 +1180,7 @@ module.exports={
1179
1180
  miiBin+="000000";
1180
1181
  miiBin+=wiiHairCols.indexOf(mii.eyebrows.col).toString(2).padStart(3,"0");
1181
1182
  miiBin+=mii.eyebrows.size.toString(2).padStart(4,"0");
1182
- miiBin+=(mii.eyebrows.yPos+3).toString(2).padStart(5,"0");
1183
+ miiBin+=mii.eyebrows.yPos.toString(2).padStart(5,"0");
1183
1184
  miiBin+=mii.eyebrows.distApart.toString(2).padStart(4,"0");
1184
1185
  miiBin+=(+getKeyByValue(eyeTable,mii.eyes.type)).toString(2).padStart(6,"0");
1185
1186
  miiBin+="00";
@@ -1202,7 +1203,7 @@ module.exports={
1202
1203
  miiBin+=wiiGlassesCols.indexOf(mii.glasses.col).toString(2).padStart(3,"0");
1203
1204
  miiBin+="0";
1204
1205
  miiBin+=mii.glasses.size.toString(2).padStart(3,"0");
1205
- miiBin+=mii.glasses.yPos.toString(2).padStart(5,"0");
1206
+ miiBin+=(mii.glasses.yPos-3).toString(2).padStart(5,"0");
1206
1207
  miiBin+=mii.facialHair.mustacheType.toString(2).padStart(2,"0");
1207
1208
  miiBin+=mii.facialHair.beardType.toString(2).padStart(2,"0");
1208
1209
  miiBin+=wiiHairCols.indexOf(mii.facialHair.col).toString(2).padStart(3,"0");
@@ -1229,8 +1230,7 @@ module.exports={
1229
1230
  for(var i=0;i<toWrite.length;i++){
1230
1231
  buffers.push(parseInt(toWrite[i],2));
1231
1232
  }
1232
- const buffer = Buffer.from(buffers);
1233
- fs.writeFileSync(outPath, buffer);
1233
+ fs.writeFileSync(outPath, Buffer.from(buffers));
1234
1234
  },
1235
1235
  write3DSQR:function(jsonIn,outPath){
1236
1236
  var mii=jsonIn;
@@ -1638,7 +1638,7 @@ module.exports={
1638
1638
  miiTo.facialHair.mustacheType=0;
1639
1639
  miiTo.facialHair.beardType=1;
1640
1640
  }
1641
- if(mii.facialHair.beardType>4){
1641
+ if(mii.facialHair.beardType>3){
1642
1642
  mii.facialHair.beardType=3;
1643
1643
  }
1644
1644
  }
@@ -1756,7 +1756,7 @@ module.exports={
1756
1756
  "col": "Black",
1757
1757
  "mustacheSize": 4,
1758
1758
  "mustacheYPos": 10
1759
- }:dad.facialHair,
1759
+ }:Math.floor(Math.random()*2)===0?dad.facialHair:mom.facialHair,
1760
1760
  "glasses":Math.floor(Math.random()*2)===1?dad.glasses:mom.glasses,
1761
1761
  "mole":Math.floor(Math.random()*2)===1?dad.mole:mom.mole,
1762
1762
  "creatorName":""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miijs",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
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": {