Skip to content

Commit b6bbd78

Browse files
authored
Update headerapi.md
1 parent 6680292 commit b6bbd78

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

headerapi.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,20 @@ title: Header API
99
## Misc
1010
* `utf8` - A global var that determines whether to use `cp932` (JP ver.) or `UTF-8` (International ver.). True by default.
1111
* `panic()` - A function used to signal warnings - this is usually used by the API to signal errors, more can be found in the Error section.
12+
* `api` - A global (and pre-defined) instance of `HeaderAPI`.
13+
* `fileBuffer` - decrypted save data used by the UI - stored as a `Uint8Array`.
1214

15+
## Formats
16+
* `playerIndex` - A number from 0-2 where 0 is the 1st save file/player, 1 is the 2nd and 2 is the 3rd.
17+
*
18+
## HeaderAPI
19+
* Constructor: `HeaderAPI(filebuf = fileBuffer)`
20+
* `filebuf` is where the save data is stored in the API.
21+
* `async refreshUI()` - Refreshes/reloads the UI based on the API's save data.
22+
* `async grabChanges()` - Saves the UI changes and sets the API's save data to the UI save data.
23+
* `exportSave()` - Exports the API's save data as a `Uint8Array`.
24+
* `getPlayers()` - Exports a JSON snapshot of the API's save data in this format:
25+
* `[{ name, rank, playTime, year, month, day, hour, minute, party } /* player 1 */, { name, rank, playTime, year, month, day, hour, minute, party } /* player 2 */, { name, rank, playTime, year, month, day, hour, minute, party } /* player 3 */]`
26+
* `setPlayerName(index, newName)` - Takes a `playerIndex` and `name` and sets that player's name to the input.
27+
1328
## Errors

0 commit comments

Comments
 (0)