menu_list.h
games/tbs/include/menu_list.h on GitHub
Structures
MenuSprite
struct MenuSprite
A menu sprite: a list link and its OAM attributes, as two words or as fields.
| Field | Declared as | |
|---|---|---|
next | struct MenuSprite *next | |
attr01, attr23, word, y, affine, mode, mosaic, colors, shape, x, affineIndex, size, tile, priority, palette, unused, f, oam | union { struct { unsigned long attr01; unsigned long attr23; } word; struct { u16 y : 8; u16 affine : 2; u16 mode : 2; u16 mosaic : 1; u16 colors : 1; u16 shape : 2; u16 x : 9; u16 affineIndex : 5; u16 size : 2; u16 tile : 10; u16 priority : 2; u16 palette : 4; u16 unused; } f; } oam |
Used by BattleMenu_RunActionSelection, Battle_CollectPartyCommands, FieldUiTextResource_Initialize, FieldUiTextResource_SetPosition, HeatGauge_Draw, ItemList_SelectEntry, SummonMenu_SelectSummon, UiTextResource_Initialize, UiTextResource_SetPosition, Ui_RunOwnerStatusScreen, UpdateLinkSessionCountdown, gLamakanDesert_SandWork.
CursorSprite
struct CursorSprite
A cursor or prompt sprite: a list link and its OAM attributes as fields.
| Field | Declared as | |
|---|---|---|
next | struct CursorSprite *next | |
y | u16 y : 8 | |
affine | u16 affine : 2 | |
mode | u16 mode : 2 | |
mosaic | u16 mosaic : 1 | |
colors | u16 colors : 1 | |
shape | u16 shape : 2 | |
x | u16 x : 9 | |
affineIndex | u16 affineIndex : 5 | |
size | u16 size : 2 | |
tile | u16 tile : 10 | |
priority | u16 priority : 2 | |
palette | u16 palette : 4 | |
unused | u16 unused |
Used by BattlePresentation_WaitForPromptAt, Battle_SelectAbility, ItemList_SelectEntry, RenderOutput_UpdateScaleAnimation, SummonMenu_SelectSummon, UiText_DrawGlyph, UiWindow_PutGlyph, UiWork_AnimateSpriteSlots.
PartyStatusWindow
struct PartyStatusWindow
The party status window's layout: its window, its place and size, and what it shows (PARTY_STATUS_ flags).
| Field | Declared as | |
|---|---|---|
window | struct UiWindow *window | |
x | u16 x | tiles |
y | u16 y | tiles |
width | u16 width | tiles |
height | u16 height | tiles |
flags | u16 flags | PARTY_STATUS_ flags |
Used by Battle_SelectAbility, UiWindow_BuildLayoutBounds, UiWindow_CreateWithLayoutBounds.
MenuPoint
struct MenuPoint
A point on the screen where a menu shows its cursor.
| Field | Declared as | |
|---|---|---|
x | s32 x | screen pixels |
y | s32 y | screen pixels |
Used by BattleMenu_RunActionSelection, BattlePresentation_WaitForPromptAt, Battle_SelectAbility, ItemList_SelectEntry, SummonMenu_SelectSummon, Ui_RunOwnerStatusScreen.
BattleMenuWork
struct BattleMenuWork
The battle command menus' work, heap slot 57 (0x104 bytes), reached as gLinkCountdownWork. Battle_CollectPartyCommands allocates it each round; it holds the icons beside the command window, the camera slide, the cursor each list remembers, the link battle's timer, the Djinn tutorial's key presses and what each command has spent.
| Field | Declared as | |
|---|---|---|
icons | struct MenuSprite icons[3] | The sprites UpdateLinkSessionCountdown draws each frame: the chosen command's icon, the chosen ability's icon and the member's portrait. |
iconShown | u8 iconShown[3] | whether each of icons is drawn |
unk27 | u8 unk27 | |
targetSceneOffset | s32 targetSceneOffset | Where the battle scene slides to (Camera_ConfigureScene's vertical offset): -2 or 16 by the target menu's mode, 0 otherwise. |
sceneOffset | s32 sceneOffset | where the slide has reached; a third of the way a frame |
row | s32 row | the list row chosen last |
page | s32 page | the list page chosen last |
preferredRow | s32 preferredRow | the row to return to |
commandSelection | s32 commandSelection[2] | The command row's choice: [0] for the party's row (fight, flee, status), [1] for a member's commands. |
timerWindow | s32 timerWindow | The window that shows the link battle's seconds left, a struct UiWindow pointer kept as a word (as a pointer, two of the round's first stores swap), or 0. |
timerHidden | s32 timerHidden | Set while the status screen is open, so the timer opens no window. |
timer | s32 timer | Frames left to choose commands in a link battle; -1 outside link battles. At 0 a menu ends as if cancelled, or takes the first command. |
linkTimer | s32 linkTimer | 1 while the link battle's timer runs |
standbyDjinn | u8 standbyDjinn[8][4] | The party's standby Djinn by element before each command: what the summons chosen by the earlier commands leave. |
listSlots | u8 listSlots[34] | the Psynergy list's action slots, ended by 0 |
listAbilities | u16 listAbilities[33] | the Psynergy list's ability ids, ended by 0 |
tutorialStep | s32 tutorialStep | The Djinn tutorial's step: 0 off, 1 from the start of each round while FLAG_DJINN_TUTORIAL is set, then one more for each hint shown. While it is not 0 the menus press keys for the player. |
tutorialDelay | s32 tutorialDelay | frames until the tutorial's next key press |
commandActor | s32 commandActor | The member whose commands are being chosen; -1 between members. |
chosenDjinn | u32 chosenDjinn[8] | The Djinni each command has chosen, element << 8 | index, or 0x80000000. |
Used by BattleMenu_RunActionSelection, BattleTarget_RunSelection, Battle_CollectPartyCommands, Battle_SelectAbility, ItemList_SelectEntry, Menu_RunCommandRow, SummonMenu_SelectSummon, Ui_RunOwnerStatusScreen, UpdateLinkSessionCountdown, gLinkCountdownWork.
Macros, without a comment: MENU_SPRITE_SIZE_16, MenuSprite_Init, BATTLE_MENU_GET_CURSOR, BATTLE_MENU_SET_CURSOR.
Globals, without a comment: gLinkCountdownWork, gResource_FixedBlockBTiles, gMenu_AnimatedCursorTiles.