Comparing version 1.5.5 to 2.0.0
{ | ||
"name": "cemu-smm", | ||
"version": "1.5.5", | ||
"version": "2.0.0", | ||
"description": "This is a module to simplify all kinds of tasks with Loadiine Super Mario Maker save files and respectively Cemu", | ||
"main": "index.js", | ||
"main": "lib", | ||
"scripts": { | ||
"test": "node test/test" | ||
"compile": "node compile", | ||
"transpile": "babel src --out-dir lib", | ||
"prepare": "npm run compile&& npm run transpile", | ||
"test": "npm run transpile&& node test/test" | ||
}, | ||
@@ -17,3 +20,5 @@ "author": "Mario Reder", | ||
"jimp": "^0.2.27", | ||
"rimraf": "^2.6.1" | ||
"protobufjs": "^6.7.3", | ||
"rimraf": "^2.6.1", | ||
"smm-protobuf": "git+https://github.com/Tarnadas/smm-protobuf.git" | ||
}, | ||
@@ -25,6 +30,11 @@ "repository": { | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.24.1", | ||
"babel-plugin-transform-async-to-generator": "^6.24.1", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-env": "^1.4.0" | ||
"babel-preset-env": "^1.4.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"jsdoc-babel": "^0.3.0", | ||
"jsdoc-to-markdown": "^3.0.0" | ||
} | ||
} |
@@ -14,7 +14,11 @@ # cemu-smm | ||
## API | ||
Please refer to the full [API Documentation](documentation/api.md) | ||
## Code Example | ||
```js | ||
let smm = require("cemu-smm"); | ||
let fs = require("fs"); | ||
const smm = require("cemu-smm"); | ||
const fs = require("fs"); | ||
@@ -31,3 +35,3 @@ (async () => { | ||
// internally done by reorder(), so unnecessary right here | ||
save.writeCrc(); | ||
await save.writeCrc(); | ||
@@ -46,3 +50,2 @@ // import all jpg files and create tnl files in their respective course folder | ||
//save.loadCourseElements(); // load whole save folder | ||
courses["course001"].loadElements(); // or load single course | ||
fs.writeFileSync(`${__dirname}/course001.json`, JSON.stringify(courses["course001"].getElements(), null, 2)); | ||
@@ -73,80 +76,20 @@ | ||
## API | ||
## Tutorials | ||
### Reorder | ||
[Installation](tutorial/installation.md) | ||
Load your save | ||
```js | ||
let save = await smm.loadSave("path/to/your/cemu/save/mlc01/emulatorSave/updateID"); | ||
``` | ||
[Basic Usage](tutorial/basic_usage.md) | ||
When calling | ||
```js | ||
save.reorder(); | ||
``` | ||
[Save Manipulation](tutorial/save_manipulation.md) | ||
![Alt text](https://raw.githubusercontent.com/Tarnadas/cemu-smm/master/test/reorder_before.jpg) | ||
[Course Manipulation](tutorial/course_manipulation.md) | ||
becomes | ||
[Thumbnail Manipulation](tutorial/thumbnail_manipulation.md) | ||
![Alt text](https://raw.githubusercontent.com/Tarnadas/cemu-smm/master/test/reorder_after.jpg) | ||
[Serialization](tutorial/serialization.md) | ||
### TNL to JPEG | ||
## Documentation | ||
Load an image with | ||
```js | ||
let tnl = smm.loadImage("path/to/your/tnl/file"); | ||
``` | ||
Do the conversion with | ||
```js | ||
let jpeg = await tnl.toJpeg(); | ||
``` | ||
Save your file | ||
```js | ||
fs.writeFileSync("path/to/newly/created/jpeg", jpeg); | ||
``` | ||
[Course File Structure](documentation/course_file.md) | ||
### JPEG to TNL | ||
Load an image with | ||
```js | ||
let jpeg = smm.loadImage("path/to/your/jpeg/file"); | ||
``` | ||
Do the conversion with | ||
```js | ||
let tnl = await jpeg.fromJpeg([isWide, [doCrop = false]]); | ||
``` | ||
If ```isWide === true```, thumbnail0 will be created, otherwise thumbnail1. | ||
If ```isWide === null```, the algorithm tries to guess the correct aspect ratio. | ||
If ```doCrop === false```, parts of the image may be letter boxed. | ||
If ```doCrop === false```, parts of the image may be cropped. | ||
Images will automatically be resized to fit Super Mario Maker standards. You can even convert 4k images. If the file is still too big after rescaling, the quality of the JPEG will be shrinked. | ||
Save your file | ||
```js | ||
fs.writeFileSync("path/to/newly/created/jpeg", tnl); | ||
``` | ||
### JPEG mass export | ||
To convert all tnl files inside your save to jpeg, call | ||
```js | ||
save.exportJpeg(); | ||
``` | ||
Navigate to your save folder and find jpeg files inside course folders. | ||
### JPEG mass import | ||
To convert all jpeg files inside your save to tnl, call | ||
```js | ||
save.importJpeg(); | ||
``` | ||
Files inside course folders must be named ```thumbnail0.jpg``` or ```thumbnail1.jpg````. | ||
Refer to [this](https://github.com/Tarnadas/cemu-smm/blob/master//tutorial/import_thumbnail.md) tutorial. | ||
## License | ||
@@ -153,0 +96,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
203231
16
1492
8
8
101
1
5
+ Addedprotobufjs@^6.7.3
+ Addedsmm-protobuf@git+https://github.com/Tarnadas/smm-protobuf.git
+ Added@protobufjs/aspromise@1.1.2(transitive)
+ Added@protobufjs/base64@1.1.2(transitive)
+ Added@protobufjs/codegen@2.0.4(transitive)
+ Added@protobufjs/eventemitter@1.1.0(transitive)
+ Added@protobufjs/fetch@1.1.0(transitive)
+ Added@protobufjs/float@1.0.2(transitive)
+ Added@protobufjs/inquire@1.1.0(transitive)
+ Added@protobufjs/path@1.1.2(transitive)
+ Added@protobufjs/pool@1.1.0(transitive)
+ Added@protobufjs/utf8@1.1.0(transitive)
+ Added@types/long@4.0.2(transitive)
+ Added@types/node@22.7.4(transitive)
+ Addedlong@4.0.0(transitive)
+ Addedprotobufjs@6.11.4(transitive)
+ Addedundici-types@6.19.8(transitive)