Skip to content

Commit ebc1f3d

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

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

headerapi.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ title: Header API
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.
1212
* `api` - A global (and pre-defined) instance of `HeaderAPI`.
1313
* `fileBuffer` - decrypted save data used by the UI - stored as a `Uint8Array`.
14+
* `playerOffsets` - a global array containing the start pos' of each player block (`[0x5390, 0x5418, 0x54A0]`).
1415

1516
## Formats
1617
* `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+
1819
## HeaderAPI
1920
* Constructor: `HeaderAPI(filebuf = fileBuffer)`
2021
* `filebuf` is where the save data is stored in the API.
@@ -24,5 +25,11 @@ title: Header API
2425
* `getPlayers()` - Exports a JSON snapshot of the API's save data in this format:
2526
* `[{ 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 */]`
2627
* `setPlayerName(index, newName)` - Takes a `playerIndex` and `name` and sets that player's name to the input.
27-
28+
29+
## Text Class
30+
* `static Encode(str, utf8 = window.utf8)` - Encodes a string -> `Uint8Array`, if `utf8` is true it'll use UTF-8 encoding otherwise cp932/Windows 31-J (UTF-8 is needed for INTL versions while cp932 for JP).
31+
* `static Decode(bytes, utf8 = window.utf8)` - Decodes a `Uint8Array` -> string, if `utf8` is true it'll use UTF-8 encoding otherwise cp932/Windows 31-J (UTF-8 is needed for INTL versions while cp932 for JP).
32+
* `constructor() { throw new Error("Do NOT use the constructor.")}` - Warning.
33+
34+
2835
## Errors

0 commit comments

Comments
 (0)