Skip to content

Commit

Permalink
Fix Switch Toolbox importing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatRambler committed Jan 11, 2021
1 parent a775c16 commit ca8bd1e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
14 changes: 7 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@
"program": "${workspaceFolder}/bin/miitoumii.exe",
"args": [
"-i",
"Npc_HatenoVillage.jpg",
"-r",
"C:/Users/aehar/Downloads/romfs",
"-p",
"C:/Users/aehar/Downloads/mod",
"-x"
"https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/794b41f3-df19-4dcf-8e17-aa1ea362d0ca/d8ox3vz-dc09f6b8-fe73-454a-987c-66cf2098f2ed.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvNzk0YjQxZjMtZGYxOS00ZGNmLThlMTctYWExZWEzNjJkMGNhXC9kOG94M3Z6LWRjMDlmNmI4LWZlNzMtNDU0YS05ODdjLTY2Y2YyMDk4ZjJlZC5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.gzsz7ZewPZuSPvW7mr7ZLrUr3cD2m172zzMTEDGHoMo",
"-x",
"-b"
],
"logging": {
"moduleLoad": true,
Expand All @@ -42,7 +39,10 @@
"request": "launch",
"program": "${workspaceFolder}/bin/miitoumii",
"args": [
"-i","https://www.miicharacters.com/miis/qr_thumb/1972_peterg.jpg","-b","-x"
"-i",
"https://www.miicharacters.com/miis/qr_thumb/1972_peterg.jpg",
"-b",
"-x"
],
"logging": {
"moduleLoad": true,
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"csignal": "cpp",
"strstream": "cpp",
"charconv": "cpp",
"*.inc": "cpp"
"*.inc": "cpp",
"*.ipp": "cpp"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Usage:
-h, --help Print usage
```

* `input`: The input Mii to convert. Miis for Wii, Wii U, 3DS, Switch and Mii Studio are all supported, as well as Miis from [the online Mii editor here](https://rc24.xyz/goodies/mii/) and QR codes
* `input`: The input Mii to convert. Miis for Wii, Wii U, 3DS, Switch and Mii Studio are all supported, as well as Miis from [the online Mii editor here](https://rc24.xyz/goodies/mii/) and QR codes. URLs are also supported, as well as file wildcards like `*.jpg` to convert all QR codes in a folder
* `output`: The path to the output Mii
* `type`: The type of the input Mii. Either you can leave this blank and have the program guess the type from the extension:
```
Expand Down
17 changes: 9 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ static const std::string programVersion = "0.0.1";
std::string getStringifiedUmii (Mii::MiiInfo& info) {
// clang-format off
return fmt::format(
"!io\n"
"version: 0\n"
"version: 2\n"
"io_version: 0\n"
"type: xml\n"
"param_root: !list\n"
" objects:\n"
Expand All @@ -85,8 +85,8 @@ std::string getStringifiedUmii (Mii::MiiInfo& info) {
" head_fav_color: {}\n"
" shoulder_fav_color: {}\n"
" shoulder_sub_color_1: {}\n"
" personality: {}\n"
" voice_type: {}\n"
" personality: !strRef {}\n"
" voice_type: !strRef {}\n"
" common: !obj\n"
" backpack: {}\n"
" hat: {}\n"
Expand Down Expand Up @@ -315,10 +315,11 @@ int main (int argc, char* argv[]) {
if (curl) {
FILE* fp = fopen (filename.c_str (), "wb");
curl_easy_setopt (curl, CURLOPT_URL, inputFileString.c_str ());
curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, +[](void* ptr, size_t size, size_t nmemb, FILE* stream) {
size_t written = fwrite (ptr, size, nmemb, stream);
return written;
});
curl_easy_setopt (
curl, CURLOPT_WRITEFUNCTION, +[] (void* ptr, size_t size, size_t nmemb, FILE* stream) {
size_t written = fwrite (ptr, size, nmemb, stream);
return written;
});
curl_easy_setopt (curl, CURLOPT_WRITEDATA, fp);
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0L);
CURLcode res = curl_easy_perform (curl);
Expand Down

0 comments on commit ca8bd1e

Please sign in to comment.