party_status.c
The party status window.
games/tbs/src/window/battle_command/party_status.c on GitHub
The party status window.
Functions
UiWindow_BuildLayoutBounds
void UiWindow_BuildLayoutBounds(s32 flags)
Works out where the party status window goes for flags: one column per
party member (those in battle when a battle is on), plus the Djinn column,
right-aligned on the 30-tile screen row at the top. It is four tiles high
outside battle and three in battle, plus one with the PP row.
Used by UiWindow_CreateWithLayoutBounds.
UiWindow_CreateWithLayoutBounds
void UiWindow_CreateWithLayoutBounds(s32 flags)
Opens the party status window with flags (see PARTY_STATUS_*) in a new
heap block, PARTY_STATUS_BLOCK, which PartyStatus_Close frees, and draws
it; the tilemap upload is held back (menuBusy) while it is drawn. A battle
opens it with flags 9, which lays it out with the PP row and leaves it
erased until the battle draws it (Battle_RunEncounter); the field opens it
with flags 1 (object/object/events.c).
Used by UiWindow_OpenMode1AndWaitFrame.
UiWindow_DrawColumnBorders
void UiWindow_DrawColumnBorders(struct UiWindow *window, u32 flags)
Draws the vertical lines between the members' columns of the party status
window, with their top and bottom joints, at the offsets listed in
gUiWindow_PartyColumnOffsets (shifted right past the Djinn column, whose own
line comes first in the list). In battle it also draws the window's bottom
edge.
Macros
PARTY_STATUS_BLOCK
#define PARTY_STATUS_BLOCK 16
The heap block the party status window's layout lives in.
Used by UiWindow_BuildLayoutBounds, UiWindow_CreateWithLayoutBounds.
TILE_ROW_FROM_BOTTOM
#define TILE_ROW_FROM_BOTTOM(tile, up)
The address of pixel row 7 - up of BG tile tile (4bpp, 32 bytes a tile,
4 bytes a row): the status bars are drawn from a tile's bottom row up.
Also, macros without a comment: PARTY_STATUS_PUT_DIGIT, PARTY_STATUS_PUT_DIGIT, PARTY_STATUS_SHOW_PP, PARTY_STATUS_SHOW_DJINN, PARTY_STATUS_CLOSED, PARTY_STATUS_KEEP_FLAGS, PARTY_STATUS_COLUMN_WIDTH, PARTY_STATUS_DJINN_WIDTH.