mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
feat: tomodachi life data decrypting and fix hair color rendering
This commit is contained in:
parent
fae79e67af
commit
5de6e924f2
4 changed files with 107 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ import { MII_DECRYPTION_KEY } from "@/lib/constants";
|
|||
import { nameSchema, tagsSchema } from "@/lib/schemas";
|
||||
|
||||
import Mii from "@/utils/mii.js/mii";
|
||||
import TomodachiLifeMii from "@/utils/tomodachi-life-mii";
|
||||
|
||||
import TagSelector from "./submit/tag-selector";
|
||||
import QrUpload from "./submit/qr-upload";
|
||||
|
|
@ -107,9 +108,16 @@ export default function SubmitForm() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Convert to Mii class
|
||||
// Convert to Mii classes
|
||||
const buffer = Buffer.from(result);
|
||||
const mii = new Mii(buffer);
|
||||
const tomodachiLifeMii = TomodachiLifeMii.fromBytes(qrBytes);
|
||||
|
||||
if (tomodachiLifeMii.hairDyeEnabled) {
|
||||
mii.hairColor = tomodachiLifeMii.studioHairColor;
|
||||
mii.eyebrowColor = tomodachiLifeMii.studioHairColor;
|
||||
mii.facialHairColor = tomodachiLifeMii.studioHairColor;
|
||||
}
|
||||
|
||||
try {
|
||||
setStudioUrl(mii.studioUrl({ width: 128 }));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue