menu
games/tbs/include/menu on GitHub
m7_interfaces.h
games/tbs/include/menu/m7_interfaces.h
menu.h
Structures
ScrollPair
struct ScrollPair
A background's horizontal and vertical scroll offsets.
| Field | Declared as | |
|---|---|---|
x | u16 x | pixels |
y | u16 y | pixels |
Used by Title_LoadBackground.
Macros, without a comment: MENU_H.
Globals, without a comment: gCharacterMenu_CursorWidths, gMenu_ListOrderDefault, gMenu_ListOrderMode0, gMenu_ListOrderMode1, gMenu_ListOrderMode2, gMenu_MinusSignString, gMenu_PlusSignString, gMenu_TopEntryCommandByPosition, gMenu_TopEntryPositionByCommand, gShop_GlyphBytes, gStatusMenu_LevelLetterString, gMenu_SmallDownArrowTiles, gMenu_ArrowTiles, gMenu_PairSpriteATiles, gMenu_PairSpriteBTiles, gMenu_QuantityTiles, gDjinnMenu_TextLevel, gDjinnMenu_TextSlash, gMenuCtrlWork, gNumberTextBuffer, gResQueueWork, gTitleExtraOptionEnabled, gItemMenu_ArrangeKeysString, gItemMenu_CommandColumnXTable, gItemMenu_EquipmentKeyString, gMenu_BackdropFrameTile, gMenu_ColonString, gMenu_CursorLeftObjectTiles, gMenu_HexDigitsString, gMenu_HpString, gMenu_LvString, gMenu_PartySpriteResourceIds, gMenu_PointString, gMenu_PpString, gMenu_SaveSlotActionByPosition, gMenu_SelectionStepDelays, gMenu_ShortcutLColonString, gMenu_ShortcutLString, gMenu_ShortcutRColonString, gMenu_ShortcutRString, gMenu_SlashString, gMenu_TimesString, gOptionMenu_SleepFrames, gOptionMenu_SpeechFrames, gOptionMenu_SpeedFrames, gUi_LvString, gUiMenu_CursorBobX, gUiMenu_CursorBobY, gWorkspace_EnergyTitle, gWorkspace_ItemTitle, gWorkspace_PageLabel, gWorkspace_RangeDash, gWorkspace_StatusTitle, gWorkspaceOptions_SliderPalette, gWorkspaceOptions_SliderTiles.
Declarations, without a comment: Ability_GetData, Item_FindSlot, PaletteFar_Entry00, PaletteFar_Entry20, ScrollFar_Entry00, UiText_DrawAt, UiWindow_Clear, UiWindow_Commit.
node_chain.h
games/tbs/include/menu/node_chain.h
Structures, without a comment: NodeChainNode, NodeChainState.
resource_menu.h
games/tbs/include/menu/resource_menu.h
Structures
ResourceMenuEntry
struct ResourceMenuEntry
A command icon of the resource menu: its OAM attributes, its place and its VRAM cache slot.
| Field | Declared as | |
|---|---|---|
link | u32 link | |
attr01 | u32 attr01 | |
attr2 | u32 attr2 | |
x | s16 x | screen pixels |
y | s16 y | screen pixels |
unk10 | u16 unk10 | |
slot | u16 slot |
Used by AffineEffect_UpdateFrame, Menu_AppendResourceEntry, Menu_CenterResourceEntries, Menu_LayoutResourceEntries.
ResourceMenuWork
struct ResourceMenuWork
The resource menu: up to six command icons in a row, the windows of their labels, the icons' resource ids, the selection and the layout.
| Field | Declared as | |
|---|---|---|
entries | struct ResourceMenuEntry entries[6] | |
window | struct UiWindow *window | |
lowerWindow | struct UiWindow *lowerWindow | |
upperWindow | struct UiWindow *upperWindow | |
resourceIds | u8 resourceIds[8] | |
selection | s16 selection | |
count | s16 count | |
width | s16 width | tiles |
resourceBase | s16 resourceBase | |
row | s16 row | tiles |
previousMode | s16 previousMode |
Used by AffineEffect_UpdateFrame, Menu_AppendResourceEntry, Menu_CenterResourceEntries, Menu_DrawModeIndicator, Menu_DrawModeLabel, Menu_EndResourceSelection, Menu_LayoutResourceEntries, Menu_RunResourceSelectionLoop, Menu_SelectResource, Menu_SelectResourceLayout, gMenuSelectWork.
Globals, without a comment: gMenuSelectWork.
select.h
games/tbs/include/menu/select.h
Structures
SelectionSprite
struct SelectionSprite
A selection screen sprite: a list link and its OAM attributes.
| Field | Declared as | |
|---|---|---|
next | struct SelectionSprite *next | |
y | u8 y | |
affine | u8 affine : 2 | |
mode | u8 mode : 2 | |
mosaic | u8 mosaic : 1 | |
colors | u8 colors : 1 | |
shape | u8 shape : 2 | |
x | u16 x : 9 | |
param | u16 param : 5 | |
size | u16 size : 2 | |
tile | u16 tile : 10 | |
priority | u16 priority : 2 | |
palette | u16 palette : 4 |
Used by BattleTarget_RunSelection, Menu_ConfirmSelection, SelectionScreen_Draw, SelectionScreen_DrawArrow, SelectionScreen_SetupArrow, SelectionScreen_SetupIcon, UiGlyph_ResetWorkState.
SelectionNode
struct SelectionNode
An icon of the selection screen: its list links, the entry it shows, its place and its slide toward a target, its zoom and its sprite.
| Field | Declared as | |
|---|---|---|
prev | struct SelectionNode *prev | the icon before it in its row |
next | struct SelectionNode *next | the icon after it in its row |
base | u16 base | the entry's id, as listed in SelectionScreen.bases |
kind | u16 kind | the entry's kind, as listed in SelectionScreen.kinds; 0 free |
slot | u16 slot | VRAM cache slot of its picture |
tile | u16 tile | first sprite tile of its picture |
x | s16 x | screen pixels |
y | s16 y | screen pixels |
dx | s16 dx | pixels a frame |
dy | s16 dy | pixels a frame |
targetX | s16 targetX | screen pixels |
targetY | s16 targetY | screen pixels |
homeX | s16 homeX | screen pixels, where it stood when chosen |
homeY | s16 homeY | screen pixels, where it stood when chosen |
message | u16 message | its name, shown in the screen's window |
scale | s16 scale | 8.8 fixed point, 0x100 full size |
scaleStep | s16 scaleStep | 8.8 fixed point a frame |
scaleEnd | s16 scaleEnd | 8.8 fixed point, 0x100 full size |
sprite | struct SelectionSprite sprite |
Used by MenuSelection_BuildEntries, Menu_ConfirmSelection, Menu_OpenSelectionWindow, Menu_ScrollSelectionList, Menu_SendNodeCountList, Menu_SetNodeCoordinates, Menu_StepLeft, Menu_StepRight, Resource_ResetOwnerEntries, Resource_ResetPendingTransfer, SelectionScreen_Draw, SelectionScreen_FindFreeIcon, SelectionScreen_HighlightIcon, SelectionScreen_LoadLargeIcon, SelectionScreen_RedrawIcon, SelectionScreen_SetupIcon, Selection_GetCursorNode.
SelectionScreen
struct SelectionScreen
The selection screen (heap block 18): the row of icons the player picks from, with arrows at each end and a pointing hand over the chosen target.
| Field | Declared as | |
|---|---|---|
records | struct SelectionNode records[16] | The icons; 14 is the pointing hand, whose picture is loaded at setup. |
transform | struct AffineTransform transform | a zooming icon's scale |
head | struct SelectionNode *head | the first icon of the row |
path | struct SelectionNode *path | the icons chosen so far |
window | struct UiWindow *window | the window naming the chosen entry |
kinds | u16 kinds[16] | The listed entries, up to 16 (Resource_PushPendingPair). @{ |
bases | u16 bases[16] | |
count | u16 count | |
baseX | u16 baseX | @} screen pixels |
baseY | u16 baseY | screen pixels |
unk39a | u16 unk39a | cleared with the list; not read by name in TBS |
top | u16 top | the first listed entry shown |
cursorIndex | u16 cursorIndex | The entry under the hand, from top; bit 7 asks the next list to start again from its first entry. |
verticalScroll | u16 verticalScroll | pixels added to the icons' y; 32 at setup |
status | u16 status | 1 shown, 33 while scrolling; counts up each frame drawn |
pathTop | u16 pathTop[5] | top, kept for each icon chosen on the path |
pathCursor | u16 pathCursor[5] | cursorIndex, kept for each icon chosen on the path |
locked | u16 locked | 999 from setup on. While 0, kind 6 icons sit at the top of the screen and the window opens there; no TBS code clears it by name. |
unk3ba | u8 unk3ba[42] | not named by TBS code |
Used by MenuSelection_BuildEntries, Menu_ConfirmSelection, Menu_MoveSelectionBackward, Menu_MoveSelectionForward, Menu_OpenSelectionWindow, Menu_RunSelectionForValue, Menu_ScrollSelectionList, Menu_SelectionLoop, Menu_SendNodeCountList, Menu_SetNodeCoordinates, Menu_SetupSelectionBothSides, Menu_StepLeft, Menu_StepRight, Menu_WaitForSelectionInput, Resource_ClearOwnerListAndCounters, Resource_PushPendingPair, Resource_ResetOwnerEntries, SelectionScreen_Draw, SelectionScreen_DrawArrow, SelectionScreen_FindFreeIcon, SelectionScreen_HighlightIcon, SelectionScreen_LoadLargeIcon, SelectionScreen_RedrawIcon, SelectionScreen_SetupArrow, Selection_GetCursorNode, UiGlyph_ResetWorkState, gResQueueWork.