Skip to content

Commit fdd2af6

Browse files
authored
Update headerapi.md
1 parent 8a6a413 commit fdd2af6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

headerapi.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ nav_order: 3
55
title: Header API
66
---
77

8+
## Quick Start
89

910
## Misc
10-
* `utf8` - A global var that determines whether to use `cp932` (JP ver.) or `UTF-8` (International ver.). True by default.
11+
* `utf8` - A global boolean that determines whether to use `cp932` (JP ver.) or `UTF-8` (International ver.). True by default.
1112
* `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.
1213
* `api` - A global (and pre-defined) instance of `HeaderAPI`.
1314
* `fileBuffer` - decrypted save data used by the UI - stored as a `Uint8Array`.
@@ -29,6 +30,8 @@ title: Header API
2930

3031
## Formats
3132
* `playerIndex` - A number from 0-2 where 0 is the 1st save file/player, 1 is the 2nd and 2 is the 3rd.
33+
* `rankVal` - A `Number` that controls Rank - `0` = E, `1` = D, ... `5` = S
34+
* `timeBlock` - An object structured like `{ year: 0x7E9, month: 0x0A, day: 0x02, hour: 0xB, minute: 0x00 }`.
3235

3336
## HeaderAPI
3437
* Constructor: `HeaderAPI(filebuf = fileBuffer)`
@@ -39,7 +42,12 @@ title: Header API
3942
* `getPlayers()` - Exports a JSON snapshot of the API's save data in this format:
4043
* `[{ 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 */]`
4144
* `setPlayerName(index, newName)` - Takes a `playerIndex` and `name` and sets that player's name to the input.
45+
* `setWatchRank(index, rankVal)` - Takes a `playerIndex` and a `rankVal` and sets that player's watch rank to that rank.
46+
* `setPlayTime(index, seconds)` - Takes a `playerIndex` and a `Number` (seconds) and sets that player's play time to that time.
47+
* `setLastSaveDate(index, { year, month, day, hour, minute })` - Takes a `playerIndex` and a `timeBlock` and sets that player's last save date to that date.
4248

49+
50+
4351
## Text Class
4452
* `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).
4553
* `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).

0 commit comments

Comments
 (0)