-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can I say it? Introducing ModConf Standalone?
- Loading branch information
1 parent
bf04a0e
commit 6af65d0
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# ModConf Standalone | ||
|
||
ModConf Standalone nearly supports everything from the normal ModConf. | ||
|
||
## Getting started | ||
|
||
Create `/data/adb/mmrl/modconf/<MODID>/modconf.json` with the following content | ||
|
||
```json | ||
{ | ||
"id": "<MODID>", | ||
"name": "Your name", | ||
"description": "your description", | ||
"main": "<MCALONECWD>/src/index.jsx", | ||
"cwd": "<MCALONECWD>/src" | ||
} | ||
``` | ||
|
||
### `modconf.json` fields | ||
|
||
| Key | Required | Description | | ||
| ------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | ||
| `id` | Yes | The `id` should always match the folder name otherwise it won't show up | | ||
| `name` | Optional | Used to display the name | | ||
| `description` | Optional | Use to display the description and that it does | | ||
| `main` | No | Here can you set your own index file. Useful when you have a `src` folder.<br/><blockquote>ModFS supported</blockquote> | | ||
| `cwd` | No (yes if `main` is set) | It is required to use `cwd` if `main` is set to ensure the the imports are working<br/><blockquote>ModFS supported</blockquote> | | ||
|
||
## Index file | ||
|
||
As above decribed you can set your own index path | ||
|
||
`src/index.jsx` | ||
|
||
```jsx | ||
import React from "react"; | ||
import { Page } from "@mmrl/ui"; | ||
|
||
export default () => { | ||
return <Page>Test</Page>; | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# SuZip | ||
|
||
Here will you learn, how `SuZip` works in MMRL. It has the same style as `SuFile` | ||
|
||
> [!NOTE] | ||
> `SuZip` is a global part in ModConf. No need to import it. | ||
> | ||
> Unstable class! | ||
## Reading files | ||
|
||
```js | ||
const mkprop = new SuZip("file.zip", "path/to/file"); | ||
console.log(mkprop.read()); | ||
``` | ||
|
||
## Check for existing | ||
|
||
```js | ||
const mkprop = new SuZip("file.zip", "path/to/file"); | ||
|
||
if (mkprop.exist()) { | ||
console.log("File exist!"); | ||
} else { | ||
// stops ModConf | ||
throw new Error("File does not exist!"); | ||
} | ||
``` | ||
|
||
## Listing files | ||
|
||
```js | ||
const modules = new SuZip("file.zip", "path/to/file"); | ||
|
||
if (modules.exist()) { | ||
// path is ignored here | ||
console.log(modules.list()); | ||
} else { | ||
throw new Error("Modules folder does not exist"); | ||
} | ||
``` | ||
|
||
## Access native methods | ||
|
||
```js | ||
const native = new SuZip("file.zip", "path/to/file"); | ||
native.interface; | ||
``` |