miijs
Version:
The most complete and easy to use Mii library available.
1,784 lines (1,781 loc) • 35.7 kB
JavaScript
//This is a JS file exclusively because I want to have comments, it would be JSON otherwise.
export const backTables={
"3ds":{
//These are lossy, but as close as we can get to the original feature when backporting.
//Positions for eyes will be somewhat troublesome.
//There are a LOT of hairs to sort through. I am open to modifying this conversion.
"hairs":[
25,64,63,64,44,61,19,1,24,69,4,53,9,71,67,50,65,47,0,1,
2,4,13,12,7,9,63,16,14,71,71,18,19,12,12,33,58,9,27,28,
1,35,46,33,70,6,67,35,11,64,37,0,25,64,46,1,14,14,9,15
],//If type>71 hairs[type-72]
"faces":[0,1,4,6],//If type>7 faces[type-8]
"eyes":[32,37,27,9,44,12,40,31,17,2,40,40],//If type>47 eyes[type-48]
"noses":[8,3,10,3,9,8],//If type>11 noses[type-12]
"mouths":[1,8,6,1,18,1,10,9,4,21,14,10],//If type>23 mouths[type-24]
"features": [//Because we need to merge features and makeups going from the 3DS to the Wii, if it's a string, prefer makeup. Otherwise prefer facial features.
"0","6",5,
6,"6",4,
7,7,8,
10,"6",11
],
"makeups": [
0,1,1,
2,1,1,
2,2,2,
3,9,9
],
},
"switch":{
"glassesTypes":[4,2,2,3,6,8,6,7,8,6,6],
"faceColors":[0,1,2,3,4,5,3,2,4,5],
// Tables originally from MiiPort:
// https://github.com/Genwald/MiiPort/blob/4ee38bbb8aa68a2365e9c48d59d7709f760f9b5d/include/convert_mii.h#L18-L28
// Cross-referenced against Arian Kordi's notes:
// https://jsfiddle.net/arian_/n8fesLdj/3/
"glassesColors":[
0, 1, 1, 1, 5, 1, 1, 4, 0, 5,
1, 1, 3, 5, 1, 2, 3, 4, 5, 4,
2, 2, 4, 4, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 0, 0, 0, 5,
3, 5, 5, 5, 5, 0, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 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hair":{
"wii":[
[//Page 1
33, 40, 51,
44, 39, 70,
45, 49, 59,
56, 68, 31
],
[//Page 2
32, 47, 37,
48, 66, 52,
58, 50, 55,
64, 60, 62
],
[//Page 3
43, 38, 42,
23, 67, 54,
36, 41, 65,
30, 57, 34
],
[//Page 4
12, 13, 69,
26, 4, 25,
1, 19, 5,
8, 27, 7
],
[//Page 5
14, 3, 22,
10, 6, 20,
11, 63, 17,
35, 21, 0
],
[//Page 6
61, 16, 46,
9, 18, 2,
28, 53, 71,
24, 15, 29
]
],
"3ds":[
[//Page 1
33,47,40,
37,32,107,
48,51,55,
70,44,66
],
[//Page 2
52,50,38,
49,43,31,
56,68,62,
115,76,119
],
[//Page 3
64,81,116,
121,22,58,
60,87,125,
117,73,75
],
[//Page 4
42,89,57,
54,80,34,
23,86,88,
118,39,36
],
[//Page 5
45,67,59,
65,41,30,
12,16,10,
82,128,129
],
[//Page 6
14,95,105,
100,6,20,
93,102,27,
4,17,110
],
[//Page 7
123,8,106,
72,3,21,
0,98,63,
90,11,120
],
[//Page 8
5,74,108,
94,124,25,
99,69,35,
13,122,113
],
[//Page 9
53,24,85,
83,71,131,
96,101,29,
7,15,112
],
[//Page 10
79,1,109,
127,91,26,
61,103,2,
77,18,92
],
[//Page 11
84,9,19,
130,97,104,
46,78,28,
114,126,111
]
]
},
"faces":[//Wii does not yet have 8-11 (3rd Column)
0,1,8,
2,3,9,
4,5,10,
6,7,11
],
"eyebrows":[
[
6,0,12,
1,9,19,
7,21,8,
17,5,4
],
[
11,10,2,
3,14,20,
15,13,22,
18,16,23
]
],
"eyes":[
[
2,4,0,
8,39,17,
1,26,16,
15,27,20
],
[
33,11,19,
32,9,12,
23,34,21,
25,40,35
],
[
5,41,13,
36,37,6,
24,30,31,
18,28,46
],
[
7,44,38,
42,45,29,
3,43,22,
10,14,47
],
[//Wii does not yet have
48,49,50,
53,59,56,
54,58,57,
55,51,52
],
],
"noses":[
[
1,10,2,
3,6,0,
5,4,8,
9,7,11
],
[//Wii does not yet have
13,14,12,
17,16,15
]
],
"mouths":[
[
23,1,18,
21,22,5,
0,8,10,
16,6,13
],
[
7,9,2,
11,3,4,
15,17,20,
19,14,12
],
[
27,30,24,
25,29,28,
26,35,31,
34,33,32
]
]
},
"favoriteColors":["Red","Orange","Yellow","Lime","Green","Blue","Cyan","Pink","Purple","Brown","White","Black"],
"switch":{
"faceColors":[
0,2,7,6,3,
4,5,1,8,9
]
},
"grids":{
"colors":[
[ 2,24,10,23,15,20,21,25,26,27],
[],
[],
[],
[],
[],
[ 5,11,75,75,77,78,79,80,81,82],
[],
[ 1, 3,89,19,90,91,22,92,93,94],
[ 8, 0,95, 9,18, 4,96,97,98,99]
],
"skinColors":[
[],
[]
],
"hairs":[
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[]
],
"noses":[
[],
[],
[]
],
"eyebrows":[
[],
[],
[],
[]
],
"mouths":[
[],
[],
[],
[],
[],
[]
],
"eyes":[
[],
[],
[],
[],
[],
[],
[],
[],
[],
[]
],
"glasses":[
[],
[],
[],
[]
]
},
"instrGrids":{
twoBy:[
[],
[],
[],
[]
],
threeBy:[
[],
[],
[],
[]
],
fourBy:[
[],
[]
]
},
"glassesTypes":[
0,8,3,
4,1,5,
14,13,11
],
"makeupsFeatures":[
0,'1','6',
'9',5,2,
3,7,8,
'10',9,11
]
};
export const childGenTables={
"hairStyleGroupMappings": [
[
2,
8
],
[
0,
6
],
[
0,
6
],
[
2,
8
],
[
2,
5
],
[
0,
4
],
[
2,
8
],
[
1,
9
],
[
1,
9
],
[
0,
6
],
[
2,
8
],
[
0,
4
],
[
2,
7
],
[
0,
4
],
[
2,
8
],
[
1,
9
],
[
2,
8
],
[
1,
9
],
[
2,
8
],
[
0,
6
],
[
2,
5
],
[
2,
5
],
[
2,
7
],
[
0,
5
],
[
1,
9
],
[
2,
5
],
[
0,
6
],
[
2,
7
],
[
0,
6
],
[
1,
9
],
[
0,
4
],
[
1,
6
],
[
0,
4
],
[
0,
4
],
[
1,
5
],
[
2,
5
],
[
1,
5
],
[
0,
4
],
[
1,
6
],
[
2,
5
],
[
0,
4
],
[
2,
5
],
[
3,
9
],
[
1,
6
],
[
2,
7
],
[
1,
8
],
[
0,
6
],
[
0,
4
],
[
2,
7
],
[
1,
6
],
[
2,
7
],
[
2,
4
],
[
0,
4
],
[
1,
9
],
[
3,
9
],
[
2,
7
],
[
1,
6
],
[
1,
8
],
[
2,
7
],
[
1,
8
],
[
1,
6
],
[
0,
6
],
[
1,
4
],
[
0,
4
],
[
1,
6
],
[
1,
8
],
[
0,
4
],
[
2,
8
],
[
3,
9
],
[
2,
8
],
[
2,
7
],
[
1,
9
],
[
2,
5
],
[
1,
6
],
[
0,
4
],
[
1,
6
],
[
3,
9
],
[
0,
6
],
[
0,
6
],
[
1,
9
],
[
3,
9
],
[
2,
7
],
[
2,
7
],
[
1,
9
],
[
0,
6
],
[
1,
9
],
[
2,
8
],
[
2,
7
],
[
2,
8
],
[
3,
9
],
[
0,
4
],
[
0,
6
],
[
2,
5
],
[
2,
7
],
[
0,
4
],
[
2,
7
],
[
1,
9
],
[
0,
6
],
[
0,
4
],
[
0,
4
],
[
2,
5
],
[
1,
9
],
[
0,
4
],
[
0,
6
],
[
0,
6
],
[
2,
7
],
[
2,
7
],
[
0,
4
],
[
0,
4
],
[
0,
6
],
[
2,
7
],
[
0,
6
],
[
1,
9
],
[
2,
5
],
[
0,
6
],
[
1,
6
],
[
2,
7
],
[
2,
7
],
[
3,
9
],
[
0,
9
],
[
0,
4
],
[
1,
6
],
[
2,
5
],
[
2,
8
],
[
2,
5
],
[
1,
6
],
[
0,
6
],
[
1,
9
],
[
2,
7
],
[
2,
7
],
[
0,
6
],
[
1,
9
]
],
"hairStyleGroups": [
[
[
30
],
[
45,
47
],
[
40,
33,
107
],
[
32,
37,
66,
52
]
],
[
[
45
],
[
56,
38,
43,
49
],
[
115,
31,
87,
60
],
[
64,
121,
125,
73,
75
]
],
[
[
51
],
[
55,
48,
51
],
[
44,
52
],
[
70,
50,
116,
58,
117,
22,
81,
87
]
],
[
[
45
],
[
68,
62
],
[
76,
119,
118
],
[
42,
54,
89,
80
]
],
[
[
30
],
[
51,
62
],
[
98,
11,
5,
94
],
[
63,
120,
90,
99,
13,
74,
108,
102
]
],
[
[
45
],
[
35,
122,
21
],
[
113,
124,
25
],
[
100,
20,
4,
72,
21,
92
]
],
[
[
45,
51
],
[
11,
21
],
[
46,
114,
61,
77
],
[
19,
104,
28,
9,
126,
78,
111,
97,
2,
103,
84,
130,
109,
26,
1,
91
]
],
[
[
51
],
[
62,
122
],
[
106,
17,
12
],
[
82,
128,
129,
27,
93,
95,
105,
110
]
],
[
[
45
],
[
122,
21
],
[
69,
16,
17
],
[
123,
3,
0,
10,
18,
14,
6
]
],
[
[
30,
51
],
[
62,
122,
11
],
[
53,
83,
17
],
[
96,
101,
29,
79,
7,
15,
112,
127,
71,
24,
131,
8,
85
]
]
],
"skinColorMixing": [
[
[
0,
-1,
-1,
-1
],
[
0,
1,
-1,
-1
],
[
0,
1,
2,
3
],
[
0,
3,
-1,
-1
],
[
1,
2,
-1,
-1
],
[
2,
4,
-1,
-1
]
],
[
[
-1,
-1,
-1,
-1
],
[
1,
-1,
-1,
-1
],
[
1,
2,
-1,
-1
],
[
1,
3,
-1,
-1
],
[
2,
-1,
-1,
-1
],
[
2,
4,
-1,
-1
]
],
[
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
2,
-1,
-1,
-1
],
[
2,
3,
-1,
-1
],
[
2,
4,
-1,
-1
],
[
4,
-1,
-1,
-1
]
],
[
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
3,
-1,
-1,
-1
],
[
2,
-1,
-1,
-1
],
[
2,
4,
-1,
-1
]
],
[
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
4,
-1,
-1,
-1
],
[
4,
5,
-1,
-1
]
],
[
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
-1,
-1,
-1,
-1
],
[
5,
-1,
-1,
-1
]
]
],
"names": [
[
"Aaron",
"Adam",
"Adrian",
"Aiden",
"Ayden",
"Alex",
"Alexander",
"Alfie",
"Andrew",
"Anthony",
"Archie",
"Austin",
"Ben",
"Benjamin",
"Bentley",
"Bill",
"Billy",
"Blake",
"Bradley",
"Brandon",
"Brayden",
"Brody",
"Bryson",
"Caleb",
"Callum",
"Cameron",
"Carlos",
"Charlie",
"Charles",
"Carson",
"Carter",
"Chase",
"Chris",
"Christian",
"Cody",
"Colton",
"Connor",
"Cooper",
"Damian",
"Daniel",
"David",
"Dexter",
"Dominic",
"Dylan",
"Easton",
"Edward",
"Eli",
"Elijah",
"Elliot",
"Ethan",
"Evan",
"Finlay",
"Frankie",
"Freddie",
"Gabriel",
"Gavin",
"George",
"Grayson",
"Harrison",
"Harvey",
"Henry",
"Hudson",
"Hugo",
"Hunter",
"Ian",
"Isaac",
"Isaiah",
"Jace",
"Jack",
"Jackson",
"Jaxon",
"Jacob",
"Jake",
"James",
"Jason",
"Jayden",
"Jenson",
"Jeremiah",
"John",
"Juan",
"Jonathan",
"Jordan",
"Jose",
"Joseph",
"Josiah",
"Joshua",
"Jude",
"Julian",
"Justin",
"Kai",
"Kayden",
"Kevin",
"Kian",
"Landon",
"Levi",
"Leo",
"Logan",
"Lucas",
"Luke",
"Luis",
"Lachlan",
"Mason",
"Matthew",
"Max",
"Michael",
"Miguel",
"Nathan",
"Nathaniel",
"Nicholas",
"Noah",
"Nolan",
"Olly",
"Oliver",
"Owen",
"Parker",
"Philip",
"Rhys",
"Reece",
"Rob",
"Robert",
"Ryan",
"Ryder",
"Samuel",
"Sebastian",
"Seth",
"Thomas",
"Tommy",
"Trent",
"Tristan",
"Tyler",
"William",
"Liam",
"Wyatt",
"Xavier",
"Zac",
"Zachary",
"Alex",
"Alexis",
"Angel",
"Bailey",
"Darcy",
"Darcey",
"Genesis",
"Kennedy",
"Mackenzie",
"Morgan",
"Peyton",
"Sam",
"Taylor"
],
[
"Aaliyah",
"Abigail",
"Addison",
"Madison",
"Maddison",
"Alexa",
"Alexandra",
"Alison",
"Allison",
"Alyssa",
"Amelia",
"Amy",
"Andrea",
"Anna",
"Annabelle",
"Aria",
"Ariana",
"Arianna",
"Ashley",
"Aubree",
"Aubrey",
"Audrey",
"Autumn",
"Ava",
"Avery",
"Bella",
"Bethany",
"Brianna",
"Brooklyn",
"Camila",
"Caroline",
"Charlotte",
"Chloe",
"Khloe",
"Claire",
"Ella",
"Ellie",
"Elenor",
"Elizabeth",
"Lizabeth",
"Liza",
"Emily",
"Emma",
"Eva",
"Evie",
"Evelyn",
"Faith",
"Gabriella",
"Gianna",
"Grace",
"Hailey",
"Hannah",
"Harper",
"Heidi",
"Hollie",
"Holly",
"Isabella",
"Isobel",
"Jasmine",
"Jessica",
"Jocelyn",
"Julia",
"Katherine",
"Kayla",
"Kaylee",
"Kimberly",
"Kylie",
"Lacey",
"Lauren",
"Layla",
"Leah",
"Lexie",
"Lilian",
"Lily",
"Lola",
"London",
"Lucy",
"Lydia",
"Madeline",
"Madelyn",
"Maisie",
"Makayla",
"Maya",
"Mya",
"Megan",
"Melanie",
"Mia",
"Molly",
"Naomi",
"Natalie",
"Nevaeh",
"Olivia",
"Paige",
"Poppy",
"Piper",
"Reagan",
"Rebecca",
"Riley",
"Rosie",
"Samantha",
"Sarah",
"Savannah",
"Scarlett",
"Serenity",
"Skye",
"Skylar",
"Sofia",
"Sophia",
"Sophie",
"Spring",
"Stella",
"Summer",
"Sydney",
"Trinity",
"Vanessa",
"Victoria",
"Violet",
"Winter",
"Zara",
"Zoe",
"Zoey",
"Alex",
"Alexis",
"Angel",
"Bailey",
"Darcy",
"Darcey",
"Genesis",
"Kennedy",
"Mackenzie",
"Morgan",
"Peyton",
"Sam",
"Taylor"
]
]
};
export const islandAddresses=[
"Ice-Cream Cone",
"Apple Pie",
"Strawberry",
"Prawn Salad",
"Sashimi",
"Orange Juice",
"Chocolate Gâteau",
"Chewing Gum",
"Fried Chicken",
"Mushroom",
"Caviar",
"Gummy Candy",
"Gratin",
"Creamy Stew",
"Crepe",
"Grapefruit",
"Croissant",
"Coffee",
"Cheese",
"Rice",
"Cherries",
"Salad",
"Sandwich",
"Buttered Potato",
"Strawberry Shortcake",
"Watermelon",
"Steak",
"Sausage",
"Soft-Serve Ice Cream",
"Tacos",
"Roasted Chestnuts",
"Red Chili Pepper",
"Fried Tofu",
"Corn on the Cob",
"Doughnut",
"Banana",
"Cheeseburger",
"Salisbury Steak",
"Pizza",
"Cracker",
"Grapes",
"French Fries",
"Barbecue",
"Blue Cheese",
"French Toast",
"Potato Chips",
"Macadamia Nuts",
"Orange",
"Peach",
"Hard-Boiled Egg",
"Ramen",
"Apple",
"Tomato Juice",
"Avocado",
"Bacon",
"Broccoli",
"Calamari",
"Quiche",
"Cotton Candy",
"Cappuccino",
"Coconut",
"Cornflakes",
"Cheesecake",
"Kiwi",
"Lasagna",
"Macaron",
"Meatballs",
"Melon",
"Muffin",
"Paella",
"Peanuts",
"Pretzel",
"Risotto",
"Roast Beef",
"Salami",
"Escargot",
"Spaghetti Peperoncino",
"Tiramisu",
"Truffle",
"Waffle",
"Yogurt",
"Gelatin Snack",
"Soda",
"Pancakes",
"Instant Noodles",
"Stuffed Cabbage Roll",
"Tomato",
"Apple Juice",
"Mango",
"Hot Dog",
"Pineapple",
"Octopus",
"Green Pepper",
"Sushi",
"Pot-au-Feu",
"Celery",
"Popcorn",
"Durian",
"Garlic",
"Fried Egg",
];